Re: [syzbot] [net?] [nfs?] KASAN: slab-out-of-bounds Read in cache_seq_start_rcu

From: Jeongjun Park

Date: Tue Apr 21 2026 - 12:26:48 EST


#syz test upstream master

---
net/sunrpc/cache.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index 7081c1214e6c..8cb14838c654 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -1357,6 +1357,9 @@ static void *__cache_seq_start(struct seq_file *m, loff_t *pos)
hlist_first_rcu(&cd->hash_table[hash])),
struct cache_head, cache_list);

+ if (hash >= cd->hash_size)
+ return NULL;
+
*pos = ((long long)hash << 32) + 1;
return ch;
}
--