]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fat: fix uninit-memory access for partial initialized inode
authorOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Fri, 6 Mar 2020 06:28:36 +0000 (22:28 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Mar 2020 06:18:32 +0000 (07:18 +0100)
commitff93da05516a4f87e7e267bb2d2d749570170b66
treec9e5a8f3bc5366d0df040ad49fdc0e165dc19339
parent186739e83333dc2a0222b739124e61bd523e2377
fat: fix uninit-memory access for partial initialized inode

commit bc87302a093f0eab45cd4e250c2021299f712ec6 upstream.

When get an error in the middle of reading an inode, some fields in the
inode might be still not initialized.  And then the evict_inode path may
access those fields via iput().

To fix, this makes sure that inode fields are initialized.

Reported-by: syzbot+9d82b8de2992579da5d0@syzkaller.appspotmail.com
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: <stable@vger.kernel.org>
Link: http://lkml.kernel.org/r/871rqnreqx.fsf@mail.parknet.co.jp
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/fat/inode.c