aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 21:08:10 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 21:08:10 -0500
commit6dd9158ae8577372aa433e6b0eae3c3d4caa5439 (patch)
treeaa097a9f9ea6206d668ac924460ad1a5d64e751c /security
parent90804ed61f24712975fa12f8a1fc12cd46ef7d59 (diff)
parentf3411cb2b2e396a41ed3a439863f028db7140a34 (diff)
Merge git://git.infradead.org/users/eparis/audit
Pull audit update from Eric Paris: "Again we stayed pretty well contained inside the audit system. Venturing out was fixing a couple of function prototypes which were inconsistent (didn't hurt anything, but we used the same value as an int, uint, u32, and I think even a long in a couple of places). We also made a couple of minor changes to when a couple of LSMs called the audit system. We hoped to add aarch64 audit support this go round, but it wasn't ready. I'm disappearing on vacation on Thursday. I should have internet access, but it'll be spotty. If anything goes wrong please be sure to cc rgb@redhat.com. He'll make fixing things his top priority" * git://git.infradead.org/users/eparis/audit: (50 commits) audit: whitespace fix in kernel-parameters.txt audit: fix location of __net_initdata for audit_net_ops audit: remove pr_info for every network namespace audit: Modify a set of system calls in audit class definitions audit: Convert int limit uses to u32 audit: Use more current logging style audit: Use hex_byte_pack_upper audit: correct a type mismatch in audit_syscall_exit() audit: reorder AUDIT_TTY_SET arguments audit: rework AUDIT_TTY_SET to only grab spin_lock once audit: remove needless switch in AUDIT_SET audit: use define's for audit version audit: documentation of audit= kernel parameter audit: wait_for_auditd rework for readability audit: update MAINTAINERS audit: log task info on feature change audit: fix incorrect set of audit_sock audit: print error message when fail to create audit socket audit: fix dangling keywords in audit_log_set_loginuid() output audit: log on errors from filter user rules ...
Diffstat (limited to 'security')
-rw-r--r--security/selinux/ss/services.c12
-rw-r--r--security/smack/smack_lsm.c5
2 files changed, 6 insertions, 11 deletions
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index fc5a63a05a1c..c93c21127f0c 100644
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -2948,25 +2948,21 @@ int selinux_audit_rule_match(u32 sid, u32 field, u32 op, void *vrule,
2948 struct selinux_audit_rule *rule = vrule; 2948 struct selinux_audit_rule *rule = vrule;
2949 int match = 0; 2949 int match = 0;
2950 2950
2951 if (!rule) { 2951 if (unlikely(!rule)) {
2952 audit_log(actx, GFP_ATOMIC, AUDIT_SELINUX_ERR, 2952 WARN_ONCE(1, "selinux_audit_rule_match: missing rule\n");
2953 "selinux_audit_rule_match: missing rule\n");
2954 return -ENOENT; 2953 return -ENOENT;
2955 } 2954 }
2956 2955
2957 read_lock(&policy_rwlock); 2956 read_lock(&policy_rwlock);
2958 2957
2959 if (rule->au_seqno < latest_granting) { 2958 if (rule->au_seqno < latest_granting) {
2960 audit_log(actx, GFP_ATOMIC, AUDIT_SELINUX_ERR,
2961 "selinux_audit_rule_match: stale rule\n");
2962 match = -ESTALE; 2959 match = -ESTALE;
2963 goto out; 2960 goto out;
2964 } 2961 }
2965 2962
2966 ctxt = sidtab_search(&sidtab, sid); 2963 ctxt = sidtab_search(&sidtab, sid);
2967 if (!ctxt) { 2964 if (unlikely(!ctxt)) {
2968 audit_log(actx, GFP_ATOMIC, AUDIT_SELINUX_ERR, 2965 WARN_ONCE(1, "selinux_audit_rule_match: unrecognized SID %d\n",
2969 "selinux_audit_rule_match: unrecognized SID %d\n",
2970 sid); 2966 sid);
2971 match = -ENOENT; 2967 match = -ENOENT;
2972 goto out; 2968 goto out;
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
index d814e35987be..14f52be78c75 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -3616,9 +3616,8 @@ static int smack_audit_rule_match(u32 secid, u32 field, u32 op, void *vrule,
3616 struct smack_known *skp; 3616 struct smack_known *skp;
3617 char *rule = vrule; 3617 char *rule = vrule;
3618 3618
3619 if (!rule) { 3619 if (unlikely(!rule)) {
3620 audit_log(actx, GFP_ATOMIC, AUDIT_SELINUX_ERR, 3620 WARN_ONCE(1, "Smack: missing rule\n");
3621 "Smack: missing rule\n");
3622 return -ENOENT; 3621 return -ENOENT;
3623 } 3622 }
3624 3623