aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoy Latten <latten@austin.ibm.com>2006-11-30 16:50:43 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-06 23:14:23 -0500
commitc9204d9ca79baac564b49d36d0228a69d7ded084 (patch)
tree190698c8b1198eda24fa63c8bf562436e6b6fb6f
parent161a09e737f0761ca064ee6a907313402f7a54b6 (diff)
audit: disable ipsec auditing when CONFIG_AUDITSYSCALL=n
Disables auditing in ipsec when CONFIG_AUDITSYSCALL is disabled in the kernel. Also includes a bug fix for xfrm_state.c as a result of original ipsec audit patch. Signed-off-by: Joy Latten <latten@austin.ibm.com> Signed-off-by: James Morris <jmorris@namei.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/xfrm.h7
-rw-r--r--net/xfrm/xfrm_policy.c2
-rw-r--r--net/xfrm/xfrm_state.c1
3 files changed, 8 insertions, 2 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index f699cdcab406..e4765413cf80 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -398,8 +398,13 @@ struct xfrm_audit
398 uid_t loginuid; 398 uid_t loginuid;
399 u32 secid; 399 u32 secid;
400}; 400};
401void xfrm_audit_log(uid_t auid, u32 secid, int type, int result, 401
402#ifdef CONFIG_AUDITSYSCALL
403extern void xfrm_audit_log(uid_t auid, u32 secid, int type, int result,
402 struct xfrm_policy *xp, struct xfrm_state *x); 404 struct xfrm_policy *xp, struct xfrm_state *x);
405#else
406#define xfrm_audit_log(a,s,t,r,p,x) do { ; } while (0)
407#endif /* CONFIG_AUDITSYSCALL */
403 408
404static inline void xfrm_pol_hold(struct xfrm_policy *policy) 409static inline void xfrm_pol_hold(struct xfrm_policy *policy)
405{ 410{
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 47c13649bac1..140bb9b384ac 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -1986,6 +1986,7 @@ int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *first,
1986 1986
1987EXPORT_SYMBOL(xfrm_bundle_ok); 1987EXPORT_SYMBOL(xfrm_bundle_ok);
1988 1988
1989#ifdef CONFIG_AUDITSYSCALL
1989/* Audit addition and deletion of SAs and ipsec policy */ 1990/* Audit addition and deletion of SAs and ipsec policy */
1990 1991
1991void xfrm_audit_log(uid_t auid, u32 sid, int type, int result, 1992void xfrm_audit_log(uid_t auid, u32 sid, int type, int result,
@@ -2094,6 +2095,7 @@ void xfrm_audit_log(uid_t auid, u32 sid, int type, int result,
2094} 2095}
2095 2096
2096EXPORT_SYMBOL(xfrm_audit_log); 2097EXPORT_SYMBOL(xfrm_audit_log);
2098#endif /* CONFIG_AUDITSYSCALL */
2097 2099
2098int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo) 2100int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo)
2099{ 2101{
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index d5d3a6f1f609..fdb08d9f34aa 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -407,7 +407,6 @@ restart:
407 xfrm_state_hold(x); 407 xfrm_state_hold(x);
408 spin_unlock_bh(&xfrm_state_lock); 408 spin_unlock_bh(&xfrm_state_lock);
409 409
410 xfrm_state_delete(x);
411 err = xfrm_state_delete(x); 410 err = xfrm_state_delete(x);
412 xfrm_audit_log(audit_info->loginuid, 411 xfrm_audit_log(audit_info->loginuid,
413 audit_info->secid, 412 audit_info->secid,