]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fuse: check connection state on notification
authorMiklos Szeredi <mszeredi@redhat.com>
Thu, 26 Mar 2026 10:45:44 +0000 (11:45 +0100)
committerMiklos Szeredi <mszeredi@redhat.com>
Thu, 2 Apr 2026 18:43:24 +0000 (20:43 +0200)
Check if the connection is fully initialized and connected before trying to
process a notification form the fuse server.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/dev.c

index 8d5bab05adf4971b918f3a095d59da55f2399f8c..952dd56f0a02d60be556989b05289df45776381c 100644 (file)
@@ -2098,6 +2098,13 @@ static int fuse_notify_prune(struct fuse_conn *fc, unsigned int size,
 static int fuse_notify(struct fuse_conn *fc, enum fuse_notify_code code,
                       unsigned int size, struct fuse_copy_state *cs)
 {
+       /*
+        * Only allow notifications during while the connection is in an
+        * initialized and connected state
+        */
+       if (!fc->initialized || !fc->connected)
+               return -EINVAL;
+
        /* Don't try to move folios (yet) */
        cs->move_folios = false;