Commit 5616ee9c authored by Tianjia Zhang's avatar Tianjia Zhang Committed by Yongqiang Liu
Browse files

integrity: Fix possible multiple allocation in integrity_inode_get()

stable inclusion
from stable-v4.19.291
commit 2a3ff660ccab67d3fde64ecd88caa73c883eb265
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7ZELT


CVE: NA

--------------------------------

commit 9df6a487 upstream.

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: default avatarTianjia Zhang <tianjia.zhang@linux.alibaba.com>
Cc: Dmitry Kasatkin <dmitry.kasatkin@gmail.com>
Cc: <stable@vger.kernel.org> # v3.10+
Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
parent f43fe814
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment