integrity: Fix possible multiple allocation in integrity_inode_get()
mainline inclusion from mainline-v6.5-rc1 commit 9df6a487 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8C2DB CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9df6a4870dc371136e90330cfbbc51464ee66993 -------------------------------- When integrity_inode_get() is querying and inserting the cache, there is a conditional race in the concurrent environment. The race condition is the result of not properly implementing "double-checked locking". In this case, it first checks to see if the iint cache record exists before taking the lock, but doesn't check again after taking the integrity_iint_lock. Fixes: bf2276d1 ("ima: allocating iint improvements") Signed-off-by:Tianjia Zhang <tianjia.zhang@linux.alibaba.com> Cc: Dmitry Kasatkin <dmitry.kasatkin@gmail.com> Cc: <stable@vger.kernel.org> # v3.10+ Signed-off-by:
Mimi Zohar <zohar@linux.ibm.com> Signed-off-by:
Felix Fu <fuzhen5@huawei.com>
Loading
Please sign in to comment