Re: [syzbot] [mm?] BUG: unable to handle kernel paging request in list_lru_add

From: Hillf Danton
Date: Fri Jul 12 2024 - 21:51:47 EST


On Fri, 12 Jul 2024 10:11:25 -0700
> syzbot has found a reproducer for the following issue on:
>
> HEAD commit: 43db1e03c086 Merge tag 'for-6.10/dm-fixes-2' of git://git...
> git tree: upstream
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12b1da7e980000

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 43db1e03c086

--- x/mm/list_lru.c
+++ y/mm/list_lru.c
@@ -94,6 +94,8 @@ bool list_lru_add(struct list_lru *lru,
spin_lock(&nlru->lock);
if (list_empty(item)) {
l = list_lru_from_memcg_idx(lru, nid, memcg_kmem_id(memcg));
+ if (NULL == l)
+ l = &lru->node[nid].lru;
list_add_tail(item, &l->list);
/* Set shrinker bit if the first element was added */
if (!l->nr_items++)
--