mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
aio: hold an extra file reference over AIO read/write operations
Otherwise we might dereference an already freed file and/or inode when aio_complete is called before we return from the read_iter or write_iter method. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
a909d3e636
commit
0b944d3a4b
1 changed files with 2 additions and 0 deletions
2
fs/aio.c
2
fs/aio.c
|
|
@ -1460,6 +1460,7 @@ rw_common:
|
|||
return ret;
|
||||
}
|
||||
|
||||
get_file(file);
|
||||
if (rw == WRITE)
|
||||
file_start_write(file);
|
||||
|
||||
|
|
@ -1467,6 +1468,7 @@ rw_common:
|
|||
|
||||
if (rw == WRITE)
|
||||
file_end_write(file);
|
||||
fput(file);
|
||||
kfree(iovec);
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue