]> git.itanic.dy.fi Git - linux-stable/commit
mtd: core: check partition before dereference
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Mon, 25 Jul 2022 13:49:25 +0000 (22:49 +0900)
committerRichard Weinberger <richard@nod.at>
Mon, 1 Aug 2022 19:33:11 +0000 (21:33 +0200)
commit7ec4cdb321738d44ae5d405e7b6ac73dfbf99caa
tree46b80b2017aec2031048be5fe6068ed234855560
parent9661524b9b26a45ecb045d7d36f85e83d8021a86
mtd: core: check partition before dereference

syzbot is reporting NULL pointer dereference at mtd_check_of_node() [1],
for mtdram test device (CONFIG_MTD_MTDRAM) is not partition.

Link: https://syzkaller.appspot.com/bug?extid=fe013f55a2814a9e8cfd
Reported-by: syzbot <syzbot+fe013f55a2814a9e8cfd@syzkaller.appspotmail.com>
Reported-by: kernel test robot <oliver.sang@intel.com>
Fixes: ad9b10d1eaada169 ("mtd: core: introduce of support for dynamic partitions")
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
CC: stable@vger.kernel.org
Signed-off-by: Richard Weinberger <richard@nod.at>
drivers/mtd/mtdcore.c