+7
−2
Loading
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IB5UKT -------------------------------- Commit 27756c07db81 ("cachefiles: add consistency check for copen/cread") added some validation to prevent malicious commands. But there is another case: 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. In addition, the "ret != 0" condition is no need in get_fd function as it always meet, remove it. Signed-off-by:Zizhi Wo <wozizhi@huawei.com> Signed-off-by:
Baokun Li <libaokun1@huawei.com>