[PATCH 3/5] audit: use old_lock in audit_set_feature

Gao feng gaofeng at cn.fujitsu.com
Fri Nov 1 11:34:44 UTC 2013


we already have old_lock, no need to calculate it again.

Acked-by: Eric Paris <eparis at redhat.com>
Signed-off-by: Gao feng <gaofeng at cn.fujitsu.com>
---
 kernel/audit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/audit.c b/kernel/audit.c
index c307786..19f21ae 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -697,7 +697,7 @@ static int audit_set_feature(struct sk_buff *skb)
 		old_lock = af.lock & feature;
 
 		/* are we changing a locked feature? */
-		if ((af.lock & feature) && (new_feature != old_feature)) {
+		if (old_lock && (new_feature != old_feature)) {
 			audit_log_feature_change(i, old_feature, new_feature,
 						 old_lock, new_lock, 0);
 			return -EPERM;
-- 
1.8.3.1




More information about the Linux-audit mailing list