Commit 61bb4a1
committed
ext4: fix possible UAF when remounting r/o a mmp-protected file system
After commit 618f003 ("ext4: fix memory leak in
ext4_fill_super"), after the file system is remounted read-only, there
is a race where the kmmpd thread can exit, causing sbi->s_mmp_tsk to
point at freed memory, which the call to ext4_stop_mmpd() can trip
over.
Fix this by only allowing kmmpd() to exit when it is stopped via
ext4_stop_mmpd().
Link: https://lore.kernel.org/r/20210707002433.3719773-1-tytso@mit.edu
Reported-by: Ye Bin <yebin10@huawei.com>
Bug-Report-Link: <20210629143603.2166962-1-yebin10@huawei.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>1 parent cd84bbb commit 61bb4a1
2 files changed
Lines changed: 20 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
160 | 165 | | |
161 | 166 | | |
162 | 167 | | |
| |||
177 | 182 | | |
178 | 183 | | |
179 | 184 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | 185 | | |
191 | 186 | | |
192 | 187 | | |
| |||
207 | 202 | | |
208 | 203 | | |
209 | 204 | | |
210 | | - | |
| 205 | + | |
211 | 206 | | |
212 | 207 | | |
213 | 208 | | |
| |||
221 | 216 | | |
222 | 217 | | |
223 | 218 | | |
224 | | - | |
| 219 | + | |
225 | 220 | | |
226 | 221 | | |
227 | 222 | | |
| |||
244 | 239 | | |
245 | 240 | | |
246 | 241 | | |
247 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
248 | 249 | | |
249 | 250 | | |
250 | 251 | | |
| |||
391 | 392 | | |
392 | 393 | | |
393 | 394 | | |
394 | | - | |
395 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5993 | 5993 | | |
5994 | 5994 | | |
5995 | 5995 | | |
5996 | | - | |
5997 | 5996 | | |
5998 | 5997 | | |
5999 | 5998 | | |
| |||
6107 | 6106 | | |
6108 | 6107 | | |
6109 | 6108 | | |
| 6109 | + | |
| 6110 | + | |
| 6111 | + | |
6110 | 6112 | | |
6111 | 6113 | | |
6112 | 6114 | | |
| |||
6140 | 6142 | | |
6141 | 6143 | | |
6142 | 6144 | | |
| 6145 | + | |
| 6146 | + | |
6143 | 6147 | | |
6144 | 6148 | | |
6145 | 6149 | | |
| |||
0 commit comments