[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240105012326.2516274-1-lizhi.xu@windriver.com>
Date: Fri, 5 Jan 2024 09:23:26 +0800
From: Lizhi Xu <lizhi.xu@...driver.com>
To: <syzbot+f9238a0a31f9b5603fef@...kaller.appspotmail.com>
CC: <linux-kernel@...r.kernel.org>, <syzkaller-bugs@...glegroups.com>
Subject: Re: [syzbot] [fs?] BUG: unable to handle kernel NULL pointer dereference in do_pagemap_scan
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 861deac3b092
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 435b61054b5b..f547057f096b 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -2433,6 +2433,9 @@ static long do_pagemap_scan(struct mm_struct *mm, unsigned long uarg)
/* Protection change for the range is going to happen. */
if (p.arg.flags & PM_SCAN_WP_MATCHING) {
+ if (IS_ERR_OR_NULL(mm))
+ return -EINVAL;
+
mmu_notifier_range_init(&range, MMU_NOTIFY_PROTECTION_VMA, 0,
mm, p.arg.start, p.arg.end);
mmu_notifier_invalidate_range_start(&range);
Powered by blists - more mailing lists