Commit c9204d9c authored by Joy Latten's avatar Joy Latten Committed by David S. Miller

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: default avatarJoy Latten <latten@austin.ibm.com>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 161a09e7
...@@ -398,8 +398,13 @@ struct xfrm_audit ...@@ -398,8 +398,13 @@ struct xfrm_audit
uid_t loginuid; uid_t loginuid;
u32 secid; u32 secid;
}; };
void xfrm_audit_log(uid_t auid, u32 secid, int type, int result,
#ifdef CONFIG_AUDITSYSCALL
extern void xfrm_audit_log(uid_t auid, u32 secid, int type, int result,
struct xfrm_policy *xp, struct xfrm_state *x); struct xfrm_policy *xp, struct xfrm_state *x);
#else
#define xfrm_audit_log(a,s,t,r,p,x) do { ; } while (0)
#endif /* CONFIG_AUDITSYSCALL */
static inline void xfrm_pol_hold(struct xfrm_policy *policy) static inline void xfrm_pol_hold(struct xfrm_policy *policy)
{ {
......
...@@ -1986,6 +1986,7 @@ int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *first, ...@@ -1986,6 +1986,7 @@ int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *first,
EXPORT_SYMBOL(xfrm_bundle_ok); EXPORT_SYMBOL(xfrm_bundle_ok);
#ifdef CONFIG_AUDITSYSCALL
/* Audit addition and deletion of SAs and ipsec policy */ /* Audit addition and deletion of SAs and ipsec policy */
void xfrm_audit_log(uid_t auid, u32 sid, int type, int result, void 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,6 +2095,7 @@ void xfrm_audit_log(uid_t auid, u32 sid, int type, int result,
} }
EXPORT_SYMBOL(xfrm_audit_log); EXPORT_SYMBOL(xfrm_audit_log);
#endif /* CONFIG_AUDITSYSCALL */
int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo) int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo)
{ {
......
...@@ -407,7 +407,6 @@ restart: ...@@ -407,7 +407,6 @@ restart:
xfrm_state_hold(x); xfrm_state_hold(x);
spin_unlock_bh(&xfrm_state_lock); spin_unlock_bh(&xfrm_state_lock);
xfrm_state_delete(x);
err = xfrm_state_delete(x); err = xfrm_state_delete(x);
xfrm_audit_log(audit_info->loginuid, xfrm_audit_log(audit_info->loginuid,
audit_info->secid, audit_info->secid,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment