diff options
author | Miklos Szeredi <[email protected]> | 2021-08-04 13:22:58 +0200 |
---|---|---|
committer | Miklos Szeredi <[email protected]> | 2021-08-04 13:22:58 +0200 |
commit | e1e71c168813564be0f6ea3d6740a059ca42d177 (patch) | |
tree | fae8cc56016feb9703453a553229b4161d62e49f /lib/test_overflow.c | |
parent | e73f0f0ee7541171d89f2e2491130c7771ba58d3 (diff) |
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 <[email protected]>
Signed-off-by: Miklos Szeredi <[email protected]>
Diffstat (limited to 'lib/test_overflow.c')
0 files changed, 0 insertions, 0 deletions