[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <wzxs6mjqlpf2eszoaw2ozvocqg3lpaqx7mzog4tygxexugrbsu@3pxs2vthfagb>
Date: Tue, 26 Nov 2024 09:21:50 -0800
From: Leo Stone <leocstone@...il.com>
To: Jan Kara <jack@...e.cz>
Cc: syzbot+2db3c7526ba68f4ea776@...kaller.appspotmail.com,
brauner@...nel.org, quic_jjohnson@...cinc.com, viro@...iv.linux.org.uk,
sandeen@...hat.com, linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com, shuah@...nel.org, anupnewsmail@...il.com,
linux-kernel-mentees@...ts.linuxfoundation.org
Subject: Re: [PATCH] hfs: Sanity check the root record
Hello,
On Tue, Nov 26, 2024 at 10:33:13AM +0100, Jan Kara wrote:
>
> This certainly won't hurt but shouldn't we also add some stricter checks
> for entry length so that we know we've loaded enough data to have full info
> about the root dir?
Yes, that would be a good idea. Do we want to keep the existing checks
and just make sure we have at least enough to initialize the struct:
if (fd.entrylength > sizeof(rec) || fd.entrylength < 0 ||
fd.entrylength < sizeof(rec.dir)) {
res = -EIO;
goto bail_hfs_find;
}
Or be even stricter and only accept the exact length:
if (fd.entrylength != sizeof(rec.dir)) {
res = -EIO;
goto bail_hfs_find;
}
Thanks for your feedback,
Leo
Powered by blists - more mailing lists