Commit f381640
fs: consistently deref the files table with rcu_dereference_raw()
... 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:
8a81252 ("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>1 parent 64a56f6 commit f381640
1 file changed
Lines changed: 17 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
421 | 435 | | |
422 | | - | |
| 436 | + | |
423 | 437 | | |
424 | 438 | | |
425 | 439 | | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | 440 | | |
433 | 441 | | |
434 | 442 | | |
| |||
680 | 688 | | |
681 | 689 | | |
682 | 690 | | |
683 | | - | |
| 691 | + | |
684 | 692 | | |
685 | 693 | | |
686 | 694 | | |
| |||
1248 | 1256 | | |
1249 | 1257 | | |
1250 | 1258 | | |
1251 | | - | |
| 1259 | + | |
1252 | 1260 | | |
1253 | 1261 | | |
1254 | 1262 | | |
| |||
0 commit comments