diff options
author | Zizhi Wo <[email protected]> | 2024-05-22 19:43:06 +0800 |
---|---|---|
committer | Christian Brauner <[email protected]> | 2024-05-29 13:03:30 +0200 |
commit | 4f8703fb3482f92edcfd31661857b16fec89c2c0 (patch) | |
tree | 87749db91367792d846c561c7b30f495e3b17e46 /lib/test_fortify/write_overflow-strncpy-src.c | |
parent | 4b4391e77a6bf24cba2ef1590e113d9b73b11039 (diff) |
cachefiles: Set object to close if ondemand_id < 0 in copen
If copen is maliciously called in the user mode, it may delete the request
corresponding to the random id. And the request may have not been read yet.
Note that when the object is set to reopen, the open request will be done
with the still reopen state in above case. As a result, the request
corresponding to this object is always skipped in select_req function, so
the read request is never completed and blocks other process.
Fix this issue by simply set object to close if its id < 0 in copen.
Signed-off-by: Zizhi Wo <[email protected]>
Signed-off-by: Baokun Li <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Acked-by: Jeff Layton <[email protected]>
Reviewed-by: Jia Zhu <[email protected]>
Signed-off-by: Christian Brauner <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions