From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Jan Kara <jack@suse.cz>, <linux-fsdevel@vger.kernel.org>,
Amir Goldstein <amir73il@gmail.com>,
syzbot+3ce5dea5b1539ff36769@syzkaller.appspotmail.com
Subject: Re: [PATCH] fat: Fix uninitialized field in nostale filehandles
Date: Mon, 05 Feb 2024 23:35:18 +0900 [thread overview]
Message-ID: <87ttmnf07t.fsf@mail.parknet.co.jp> (raw)
In-Reply-To: <20240205122626.13701-1-jack@suse.cz> (Jan Kara's message of "Mon, 5 Feb 2024 13:26:26 +0100")
Jan Kara <jack@suse.cz> writes:
> When fat_encode_fh_nostale() encodes file handle without a parent it
> stores only first 10 bytes of the file handle. However the length of the
> file handle must be a multiple of 4 so the file handle is actually 12
> bytes long and the last two bytes remain uninitialized. This is not
> great at we potentially leak uninitialized information with the handle
> to userspace. Properly initialize the full handle length.
>
> Reported-by: syzbot+3ce5dea5b1539ff36769@syzkaller.appspotmail.com
> Fixes: ea3983ace6b7 ("fat: restructure export_operations")
> Signed-off-by: Jan Kara <jack@suse.cz>
We can clean up more though, the fix itself looks good. Thanks.
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
> ---
> fs/fat/nfs.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/fs/fat/nfs.c b/fs/fat/nfs.c
> index c52e63e10d35..509eea96a457 100644
> --- a/fs/fat/nfs.c
> +++ b/fs/fat/nfs.c
> @@ -130,6 +130,12 @@ fat_encode_fh_nostale(struct inode *inode, __u32 *fh, int *lenp,
> fid->parent_i_gen = parent->i_generation;
> type = FILEID_FAT_WITH_PARENT;
> *lenp = FAT_FID_SIZE_WITH_PARENT;
> + } else {
> + /*
> + * We need to initialize this field because the fh is actually
> + * 12 bytes long
> + */
> + fid->parent_i_pos_hi = 0;
> }
>
> return type;
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
prev parent reply other threads:[~2024-02-05 14:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-05 12:26 [PATCH] fat: Fix uninitialized field in nostale filehandles Jan Kara
2024-02-05 14:35 ` OGAWA Hirofumi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ttmnf07t.fsf@mail.parknet.co.jp \
--to=hirofumi@mail.parknet.co.jp \
--cc=akpm@linux-foundation.org \
--cc=amir73il@gmail.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=syzbot+3ce5dea5b1539ff36769@syzkaller.appspotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).