linux/fs/fuse
Miklos Szeredi e1e71c1688 fuse: fix use after free in fuse_read_interrupt()
There is a potential race between fuse_read_interrupt() and
fuse_request_end().

TASK1
  in fuse_read_interrupt(): delete req->intr_entry (while holding
  fiq->lock)

TASK2
  in fuse_request_end(): req->intr_entry is empty -> skip fiq->lock
  wake up TASK3

TASK3
  request is freed

TASK1
  in fuse_read_interrupt(): dereference req->in.h.unique ***BAM***


Fix by always grabbing fiq->lock if the request was ever interrupted
(FR_INTERRUPTED set) thereby serializing with concurrent
fuse_read_interrupt() calls.

FR_INTERRUPTED is set before the request is queued on fiq->interrupts.
Dequeing the request is done with list_del_init() but FR_INTERRUPTED is not
cleared in this case.

Reported-by: lijiazi <lijiazi@xiaomi.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2021-08-04 13:22:58 +02:00
..
acl.c fuse: add a flag FUSE_SETXATTR_ACL_KILL_SGID to kill SGID 2021-04-14 10:40:57 +02:00
control.c fuse: split fuse_mount off of fuse_conn 2020-09-18 15:17:41 +02:00
cuse.c cuse: simplify refcount 2021-04-14 10:40:58 +02:00
dax.c fuse update for 5.14 2021-07-06 11:17:41 -07:00
dev.c fuse: fix use after free in fuse_read_interrupt() 2021-08-04 13:22:58 +02:00
dir.c fuse: fix illegal access to inode with reused nodeid 2021-06-22 09:15:36 +02:00
file.c fuse update for 5.14 2021-07-06 11:17:41 -07:00
fuse_i.h fuse: fix illegal access to inode with reused nodeid 2021-06-22 09:15:36 +02:00
inode.c fuse: fix illegal access to inode with reused nodeid 2021-06-22 09:15:36 +02:00
ioctl.c fuse: convert to fileattr 2021-04-12 15:04:30 +02:00
Kconfig virtiofs: implement dax read/write operations 2020-09-10 11:39:23 +02:00
Makefile fuse: move ioctl to separate source file 2021-04-12 15:04:30 +02:00
readdir.c fuse: fix illegal access to inode with reused nodeid 2021-06-22 09:15:36 +02:00
virtio_fs.c fuse: add dedicated filesystem context ops for submounts 2021-06-22 09:15:35 +02:00
xattr.c fuse: extend FUSE_SETXATTR request 2021-04-14 10:40:57 +02:00