Commit 1f282cd
Al Viro
fs/fhandle.c: fix a race in call of has_locked_children()
may_decode_fh() is calling has_locked_children() while holding no locks.
That's an oopsable race...
The rest of the callers are safe since they are holding namespace_sem and
are guaranteed a positive refcount on the mount in question.
Rename the current has_locked_children() to __has_locked_children(), make
it static and switch the fs/namespace.c users to it.
Make has_locked_children() a wrapper for __has_locked_children(), calling
the latter under read_seqlock_excl(&mount_lock).
Reviewed-by: Christian Brauner <brauner@kernel.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Fixes: 620c266 ("fhandle: relax open_by_handle_at() permission checks")
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>1 parent a82ba83 commit 1f282cd
1 file changed
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2425 | 2425 | | |
2426 | 2426 | | |
2427 | 2427 | | |
2428 | | - | |
| 2428 | + | |
2429 | 2429 | | |
2430 | 2430 | | |
2431 | 2431 | | |
| |||
2439 | 2439 | | |
2440 | 2440 | | |
2441 | 2441 | | |
| 2442 | + | |
| 2443 | + | |
| 2444 | + | |
| 2445 | + | |
| 2446 | + | |
| 2447 | + | |
| 2448 | + | |
| 2449 | + | |
| 2450 | + | |
| 2451 | + | |
2442 | 2452 | | |
2443 | 2453 | | |
2444 | 2454 | | |
| |||
2499 | 2509 | | |
2500 | 2510 | | |
2501 | 2511 | | |
2502 | | - | |
| 2512 | + | |
2503 | 2513 | | |
2504 | 2514 | | |
2505 | 2515 | | |
| |||
3036 | 3046 | | |
3037 | 3047 | | |
3038 | 3048 | | |
3039 | | - | |
| 3049 | + | |
3040 | 3050 | | |
3041 | 3051 | | |
3042 | 3052 | | |
| |||
3429 | 3439 | | |
3430 | 3440 | | |
3431 | 3441 | | |
3432 | | - | |
| 3442 | + | |
3433 | 3443 | | |
3434 | 3444 | | |
3435 | 3445 | | |
| |||
0 commit comments