Skip to content

Commit e45f591

Browse files
author
Miklos Szeredi
committed
fuse: check connection state on notification
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>
1 parent da6fcc6 commit e45f591

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

fs/fuse/dev.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2098,6 +2098,13 @@ static int fuse_notify_prune(struct fuse_conn *fc, unsigned int size,
20982098
static int fuse_notify(struct fuse_conn *fc, enum fuse_notify_code code,
20992099
unsigned int size, struct fuse_copy_state *cs)
21002100
{
2101+
/*
2102+
* Only allow notifications during while the connection is in an
2103+
* initialized and connected state
2104+
*/
2105+
if (!fc->initialized || !fc->connected)
2106+
return -EINVAL;
2107+
21012108
/* Don't try to move folios (yet) */
21022109
cs->move_folios = false;
21032110

0 commit comments

Comments
 (0)