[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <66f66f10.050a0220.38ace9.0011.GAE@google.com>
Date: Fri, 27 Sep 2024 01:38:40 -0700
From: syzbot <syzbot+c679f13773f295d2da53@...kaller.appspotmail.com>
To: linux-kernel@...r.kernel.org
Subject: Re: [syzbot] Re: [syzbot] [squashfs?] possible deadlock in fsnotify_destroy_mark
For archival purposes, forwarding an incoming command email to
linux-kernel@...r.kernel.org.
***
Subject: Re: [syzbot] [squashfs?] possible deadlock in fsnotify_destroy_mark
Author: lizhi.xu@...driver.com
Use memalloc_nofs_save/memalloc_nofs_restore to make sure we don't end
up with the fs reclaim dependency.
#syz test
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c
index c7e451d5bd51..70b77b6186a6 100644
--- a/fs/notify/inotify/inotify_user.c
+++ b/fs/notify/inotify/inotify_user.c
@@ -643,8 +643,13 @@ static int inotify_update_watch(struct fsnotify_group *group, struct inode *inod
/* try to update and existing watch with the new arg */
ret = inotify_update_existing_watch(group, inode, arg);
/* no mark present, try to add a new one */
- if (ret == -ENOENT)
+ if (ret == -ENOENT) {
+ unsigned int nofs_flag;
+
+ nofs_flag = memalloc_nofs_save();
ret = inotify_new_watch(group, inode, arg);
+ memalloc_nofs_restore(nofs_flag);
+ }
fsnotify_group_unlock(group);
return ret;
Powered by blists - more mailing lists