diff options
author | Linus Torvalds <[email protected]> | 2024-05-03 13:36:09 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2024-05-05 14:00:48 -0700 |
commit | 4efaa5acf0a1d2b5947f98abb3acf8bfd966422b (patch) | |
tree | 0a7f074026609c4fed7d2c4add29c12e5c051ce0 /drivers/acpi/cppc_acpi.c | |
parent | f462ae0edd3703edd6f22fe41d336369c38b884b (diff) |
epoll: be better about file lifetimes
epoll can call out to vfs_poll() with a file pointer that may race with
the last 'fput()'. That would make f_count go down to zero, and while
the ep->mtx locking means that the resulting file pointer tear-down will
be blocked until the poll returns, it means that f_count is already
dead, and any use of it won't actually get a reference to the file any
more: it's dead regardless.
Make sure we have a valid ref on the file pointer before we call down to
vfs_poll() from the epoll routines.
Link: https://lore.kernel.org/lkml/[email protected]/
Reported-by: [email protected]
Reviewed-by: Jens Axboe <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'drivers/acpi/cppc_acpi.c')
0 files changed, 0 insertions, 0 deletions