diff options
| author | Mathias Krause <[email protected]> | 2024-02-04 07:51:52 +0000 |
|---|---|---|
| committer | Kent Overstreet <[email protected]> | 2024-02-05 06:16:15 +0000 |
| commit | dd839f31d7cd5e04f4111a219024268c6f6973f0 (patch) | |
| tree | 7d9cdd7be6e268d2ecfd020f868d56c0f3e466e3 /drivers/fpga/tests/fpga-mgr-test.c | |
| parent | bcachefs: unlock parent dir if entry is not found in subvolume deletion (diff) | |
| download | kernel-dd839f31d7cd5e04f4111a219024268c6f6973f0.tar.gz kernel-dd839f31d7cd5e04f4111a219024268c6f6973f0.zip | |
bcachefs: install fd later to avoid race with close
Calling fd_install() makes a file reachable for userland, including the
possibility to close the file descriptor, which leads to calling its
'release' hook. If that happens before the code had a chance to bump the
reference of the newly created task struct, the release callback will
call put_task_struct() too early, leading to the premature destruction
of the kernel thread.
Avoid that race by calling fd_install() later, after all the setup is
done.
Fixes: 1c6fdbd8f246 ("bcachefs: Initial commit")
Signed-off-by: Mathias Krause <[email protected]>
Signed-off-by: Kent Overstreet <[email protected]>
Diffstat (limited to 'drivers/fpga/tests/fpga-mgr-test.c')
0 files changed, 0 insertions, 0 deletions
