* [PATCH] XFRM: Display the audited SPI value in host byte order
@ 2007-12-12 19:05 Paul Moore
2007-12-12 19:10 ` David Miller
2007-12-12 21:14 ` Steve Grubb
0 siblings, 2 replies; 3+ messages in thread
From: Paul Moore @ 2007-12-12 19:05 UTC (permalink / raw)
To: netdev; +Cc: linux-audit
Currently the IPsec protocol SPI values are written to the audit log in
network byte order which is different from almost all other values which
are recorded in host byte order. This patch corrects this inconsistency
by writing the SPI values to the audit record in host byte order.
Signed-off-by: Paul Moore <paul.moore@hp.com>
---
net/xfrm/xfrm_state.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index cf43c49..1af522b 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -2028,6 +2028,7 @@ void
xfrm_audit_state_add(struct xfrm_state *x, int result, u32 auid, u32 sid)
{
struct audit_buffer *audit_buf;
+ u32 spi;
extern int audit_enabled;
if (audit_enabled == 0)
@@ -2037,8 +2038,8 @@ xfrm_audit_state_add(struct xfrm_state *x, int result, u32 auid, u32 sid)
return;
audit_log_format(audit_buf, " op=SAD-add res=%u",result);
xfrm_audit_common_stateinfo(x, audit_buf);
- audit_log_format(audit_buf, " spi=%lu(0x%lx)",
- (unsigned long)x->id.spi, (unsigned long)x->id.spi);
+ spi = ntohl(x->id.spi);
+ audit_log_format(audit_buf, " spi=%u(0x%x)", spi, spi);
audit_log_end(audit_buf);
}
EXPORT_SYMBOL_GPL(xfrm_audit_state_add);
@@ -2047,6 +2048,7 @@ void
xfrm_audit_state_delete(struct xfrm_state *x, int result, u32 auid, u32 sid)
{
struct audit_buffer *audit_buf;
+ u32 spi;
extern int audit_enabled;
if (audit_enabled == 0)
@@ -2056,8 +2058,8 @@ xfrm_audit_state_delete(struct xfrm_state *x, int result, u32 auid, u32 sid)
return;
audit_log_format(audit_buf, " op=SAD-delete res=%u",result);
xfrm_audit_common_stateinfo(x, audit_buf);
- audit_log_format(audit_buf, " spi=%lu(0x%lx)",
- (unsigned long)x->id.spi, (unsigned long)x->id.spi);
+ spi = ntohl(x->id.spi);
+ audit_log_format(audit_buf, " spi=%u(0x%x)", spi, spi);
audit_log_end(audit_buf);
}
EXPORT_SYMBOL_GPL(xfrm_audit_state_delete);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] XFRM: Display the audited SPI value in host byte order
2007-12-12 19:05 [PATCH] XFRM: Display the audited SPI value in host byte order Paul Moore
@ 2007-12-12 19:10 ` David Miller
2007-12-12 21:14 ` Steve Grubb
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2007-12-12 19:10 UTC (permalink / raw)
To: paul.moore; +Cc: netdev, linux-audit
From: Paul Moore <paul.moore@hp.com>
Date: Wed, 12 Dec 2007 14:05:42 -0500
> Currently the IPsec protocol SPI values are written to the audit log in
> network byte order which is different from almost all other values which
> are recorded in host byte order. This patch corrects this inconsistency
> by writing the SPI values to the audit record in host byte order.
>
> Signed-off-by: Paul Moore <paul.moore@hp.com>
Applied to net-2.6, thanks Paul.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] XFRM: Display the audited SPI value in host byte order
2007-12-12 19:05 [PATCH] XFRM: Display the audited SPI value in host byte order Paul Moore
2007-12-12 19:10 ` David Miller
@ 2007-12-12 21:14 ` Steve Grubb
1 sibling, 0 replies; 3+ messages in thread
From: Steve Grubb @ 2007-12-12 21:14 UTC (permalink / raw)
To: linux-audit; +Cc: netdev
On Wednesday 12 December 2007 14:05:42 Paul Moore wrote:
> This patch corrects this inconsistency by writing the SPI values to the
> audit record in host byte order.
Looks OK, to me, too.
-Steve
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-12-12 21:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-12 19:05 [PATCH] XFRM: Display the audited SPI value in host byte order Paul Moore
2007-12-12 19:10 ` David Miller
2007-12-12 21:14 ` Steve Grubb
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).