Commit a260bd2
media: mc: fix potential use-after-free in media_request_alloc()
Commit 6f504cb ("media: convert media_request_alloc() to
FD_PREPARE()") moved the call to fd_install() (now hidden in
fd_publish()) before the snprintf(), making the later write to
potentially already freed memory, as userland is free to call
close() concurrently right after the call to fd_install() which
may end up in the request_fops.release() handler freeing 'req'.
Fixes: 6f504cb ("media: convert media_request_alloc() to FD_PREPARE()")
Signed-off-by: Mathias Krause <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Christian Brauner <[email protected]>1 parent 8f0b4cc commit a260bd2
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
318 | | - | |
319 | | - | |
320 | 318 | | |
321 | | - | |
| 319 | + | |
322 | 320 | | |
323 | 321 | | |
| 322 | + | |
| 323 | + | |
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
| |||
0 commit comments