Commit 3ca02e6
smb: client: Avoid race in open_cached_dir with lease breaks
A pre-existing valid cfid returned from find_or_create_cached_dir might
race with a lease break, meaning open_cached_dir doesn't consider it
valid, and thinks it's newly-constructed. This leaks a dentry reference
if the allocation occurs before the queued lease break work runs.
Avoid the race by extending holding the cfid_list_lock across
find_or_create_cached_dir and when the result is checked.
Cc: stable@vger.kernel.org
Reviewed-by: Henrique Carvalho <henrique.carvalho@suse.com>
Signed-off-by: Paul Aurich <paul@darkrain42.org>
Signed-off-by: Steve French <stfrench@microsoft.com>1 parent d90b023 commit 3ca02e6
1 file changed
+2
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
| |||
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | | - | |
42 | 40 | | |
43 | 41 | | |
44 | 42 | | |
45 | | - | |
46 | 43 | | |
47 | 44 | | |
48 | 45 | | |
49 | 46 | | |
50 | | - | |
51 | 47 | | |
52 | 48 | | |
53 | 49 | | |
54 | | - | |
55 | 50 | | |
56 | 51 | | |
57 | 52 | | |
58 | 53 | | |
59 | | - | |
60 | 54 | | |
61 | 55 | | |
62 | 56 | | |
| |||
74 | 68 | | |
75 | 69 | | |
76 | 70 | | |
77 | | - | |
78 | 71 | | |
79 | 72 | | |
80 | 73 | | |
| |||
187 | 180 | | |
188 | 181 | | |
189 | 182 | | |
| 183 | + | |
190 | 184 | | |
191 | 185 | | |
| 186 | + | |
192 | 187 | | |
193 | 188 | | |
194 | 189 | | |
| |||
197 | 192 | | |
198 | 193 | | |
199 | 194 | | |
200 | | - | |
201 | 195 | | |
202 | 196 | | |
203 | 197 | | |
| |||
0 commit comments