diff options
author | Mateusz Guzik <mjguzik@gmail.com> | 2025-03-13 14:57:25 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-04-20 10:22:22 +0200 |
commit | 82a2b3f5f9a84b87edd26810799818f70b394b8c (patch) | |
tree | ea89b6424ff73fc4423acf9ff0bc0027f8f791f0 /fs/namespace.c | |
parent | 1267bd38f161c1a27d9b722de017027167a225a0 (diff) |
fs: consistently deref the files table with rcu_dereference_raw()
[ Upstream commit f381640e1bd4f2de7ccafbfe8703d33c3718aad9 ]
... except when the table is known to be only used by one thread.
A file pointer can get installed at any moment despite the ->file_lock
being held since the following:
8a81252b774b53e6 ("fs/file.c: don't acquire files->file_lock in fd_install()")
Accesses subject to such a race can in principle suffer load tearing.
While here redo the comment in dup_fd -- it only covered a race against
files showing up, still assuming fd_install() takes the lock.
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Link: https://lore.kernel.org/r/20250313135725.1320914-1-mjguzik@gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/namespace.c')
0 files changed, 0 insertions, 0 deletions