Repository navigation
Commit cf01f4e
committed
locks: only validate the lock vs. f_mode in F_SETLK codepaths
v2: replace missing break in switch statement (as pointed out by Dave
Jones)
commit bce7560 (locks: consolidate checks for compatible
filp->f_mode values in setlk handlers) introduced a regression in the
F_GETLK handler.
flock64_to_posix_lock is a shared codepath between F_GETLK and F_SETLK,
but the f_mode checks should only be applicable to the F_SETLK codepaths
according to POSIX.
Instead of just reverting the patch, add a new function to do this
checking and have the F_SETLK handlers call it.
Cc: Dave Jones <davej@redhat.com>
Reported-and-Tested-by: Reuben Farrelly <reuben@reub.net>
Signed-off-by: Jeff Layton <jlayton@poochiereds.net>1 parent afcf0a2 commit cf01f4e
1 file changed
Lines changed: 24 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | 392 | | |
405 | 393 | | |
406 | 394 | | |
| |||
2034 | 2022 | | |
2035 | 2023 | | |
2036 | 2024 | | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
2037 | 2041 | | |
2038 | 2042 | | |
2039 | 2043 | | |
| |||
2071 | 2075 | | |
2072 | 2076 | | |
2073 | 2077 | | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
2074 | 2082 | | |
2075 | 2083 | | |
2076 | 2084 | | |
| |||
2206 | 2214 | | |
2207 | 2215 | | |
2208 | 2216 | | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
2209 | 2221 | | |
2210 | 2222 | | |
2211 | 2223 | | |
| |||
0 commit comments