hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IB0WVE
--------------------------------
This reverts commit 2d200edd58e430d620d3f5c3a2099ea985410ae3.
This reverts commit is a self-developed solution, different from the mainline solution. In order to align with the upstream, now backport the mainline one.
Fixes: 67169ec84504 ("ima: Avoid blocking in RCU read-side critical section") Signed-off-by: Gu Bowen gubowen5@huawei.com --- security/integrity/ima/ima_policy.c | 2 +- security/selinux/ss/services.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c index 7757e28581fa..374ef1f89432 100644 --- a/security/integrity/ima/ima_policy.c +++ b/security/integrity/ima/ima_policy.c @@ -462,7 +462,7 @@ static struct ima_rule_entry *ima_lsm_copy_rule(struct ima_rule_entry *entry) * Immutable elements are copied over as pointers and data; only * lsm rules can change */ - nentry = kmemdup(entry, sizeof(*nentry), GFP_ATOMIC); + nentry = kmemdup(entry, sizeof(*nentry), GFP_KERNEL); if (!nentry) return NULL;
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index 93e011d5d684..1eeffc66ea7d 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c @@ -3538,7 +3538,7 @@ int selinux_audit_rule_init(u32 field, u32 op, char *rulestr, void **vrule) return -EINVAL; }
- tmprule = kzalloc(sizeof(struct selinux_audit_rule), GFP_ATOMIC); + tmprule = kzalloc(sizeof(struct selinux_audit_rule), GFP_KERNEL); if (!tmprule) return -ENOMEM; context_init(&tmprule->au_ctxt);