Commit 88464d1b authored by Peter Martuccelli's avatar Peter Martuccelli Committed by Linus Torvalds

[PATCH] audit return code and log format fix

A couple of one liners to resolve two issues that have come up regarding
audit.

Roger reported a problem with audit.c:audit_receive_skb which improperly
negates the errno argument when netlink_ack is called.

The second issue was reported by Steve on the linux-audit list,
auditsc.s:audit_log_exit using %u instead of %d in the audit_log_format
call.

Please note, there is a mailing list available for audit discussion at
https://www.redhat.com/archives/linux-audit/Signed-off-by: default avatarPeter Martuccelli <peterm@redhat.com>
Signed-off-by: default avatarSteve Grubb <sgrubb@redhat.com>
Signed-off-by: default avatarRoger Luethi <rl@hellgate.ch>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 46ce12e0
......@@ -419,7 +419,7 @@ static int audit_receive_skb(struct sk_buff *skb)
if (rlen > skb->len)
rlen = skb->len;
if ((err = audit_receive_msg(skb, nlh))) {
netlink_ack(skb, nlh, -err);
netlink_ack(skb, nlh, err);
} else if (nlh->nlmsg_flags & NLM_F_ACK)
netlink_ack(skb, nlh, 0);
skb_pull(skb, rlen);
......
......@@ -591,7 +591,7 @@ static void audit_log_exit(struct audit_context *context)
if (context->personality != PER_LINUX)
audit_log_format(ab, " per=%lx", context->personality);
if (context->return_valid)
audit_log_format(ab, " exit=%u", context->return_code);
audit_log_format(ab, " exit=%d", context->return_code);
audit_log_format(ab,
" a0=%lx a1=%lx a2=%lx a3=%lx items=%d"
" pid=%d loginuid=%d uid=%d gid=%d"
......
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