hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9HXKB
--------------------------------
This reverts commit 67169ec8450469753992a9132f3f1a8627ccbfd5.
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 43a5c4754a66..0810175a895b 100644 --- a/security/integrity/ima/ima_policy.c +++ b/security/integrity/ima/ima_policy.c @@ -407,7 +407,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 09412253e08f..23f441b09c70 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c @@ -3584,7 +3584,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;