Skip to content
Commit d4b74482 authored by Abdun Nihaal's avatar Abdun Nihaal Committed by Greg Kroah-Hartman
Browse files

fs/ntfs3: Fix NULL dereference in ni_write_inode

[ Upstream commit 8dae4f63 ]

Syzbot reports a NULL dereference in ni_write_inode.
When creating a new inode, if allocation fails in mi_init function
(called in mi_format_new function), mi->mrec is set to NULL.
In the error path of this inode creation, mi->mrec is later
dereferenced in ni_write_inode.

Add a NULL check to prevent NULL dereference.

Link: https://syzkaller.appspot.com/bug?extid=f45957555ed4a808cc7a


Reported-and-tested-by: default avatar <syzbot+f45957555ed4a808cc7a@syzkaller.appspotmail.com>
Signed-off-by: default avatarAbdun Nihaal <abdun.nihaal@gmail.com>
Signed-off-by: default avatarKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 1fd5b80c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment