Re: [syzbot] Re: [syzbot] [squashfs?] possible deadlock in fsnotify_destroy_mark

syzbot
2024-09-27T07:00:06Z

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.

***

Subject: Re: [syzbot] [squashfs?] possible deadlock in fsnotify_destroy_mark
Author: lizhi.xu@windriver.com

Use NOFS to replace

#syz test

diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c
index c7e451d5bd51..3d0dde410b04 100644
--- a/fs/notify/inotify/inotify_user.c
+++ b/fs/notify/inotify/inotify_user.c
@@ -596,7 +596,7 @@ static int inotify_new_watch(struct fsnotify_group *group,
struct idr *idr = &group->inotify_data.idr;
spinlock_t *idr_lock = &group->inotify_data.idr_lock;

- tmp_i_mark = kmem_cache_alloc(inotify_inode_mark_cachep, GFP_KERNEL);
+ tmp_i_mark = kmem_cache_alloc(inotify_inode_mark_cachep, GFP_NOFS);
if (unlikely(!tmp_i_mark))
return -ENOMEM;