Re: [syzbot] general protection fault in list_lru_add

From: Linus Torvalds
Date: Wed Mar 23 2022 - 19:11:40 EST


Muchun,
mind taking a look at this asap? This seems like a pretty core thing,
and the fact that it oopses on that

> RIP: 0010:list_add_tail include/linux/list.h:102 [inline]
> RIP: 0010:list_lru_add+0x277/0x510 mm/list_lru.c:129
> d_lru_add fs/dcache.c:431 [inline]
> retain_dentry fs/dcache.c:685 [inline]
> dput+0x7a7/0xdb0 fs/dcache.c:908

just worries me a lot.

The dentry lru list rules are odd but not outrageously so. The main
oddity is that the DCACHE_LRU_LIST bit in the dentry flags indicate
whether the dentry is on a LRU list or not.

And it's not one single list - it can be *either* the usual
sb->lists_dentry_lru list, or the special "shrink list".

But this oops is for the regular d_lru_add() path that adds the dentry
to the sb->s_dentry_lru list as the dentry count goes down to zero
(and it's not one of the dentries that get insta-free'd).

So it looks like quite a regular path and something is horribly wrong
with a very core data structure.

Linus