Skip to content
Unverified Commit 4f8703fb authored by Zizhi Wo's avatar Zizhi Wo Committed by Christian Brauner
Browse files

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: default avatarZizhi Wo <wozizhi@huawei.com>
Signed-off-by: default avatarBaokun Li <libaokun1@huawei.com>
Link: https://lore.kernel.org/r/20240522114308.2402121-11-libaokun@huaweicloud.com


Acked-by: default avatarJeff Layton <jlayton@kernel.org>
Reviewed-by: default avatarJia Zhu <zhujia.zj@bytedance.com>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 4b4391e7
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment