Skip to content

Commit

Permalink
[PATCH] add new audit data to last skb
Browse files Browse the repository at this point in the history
When adding more formatted audit data to an skb for delivery to userspace,
the kernel will attempt to reuse an skb that has spare room.  However, if
the audit message has already been fragmented to multiple skb's, the search
for spare room in the skb uses the head of the list.  This will corrupt the
audit message with trailing bytes being placed midway through the stream.
Fix is to look at the end of the list.

Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
  • Loading branch information
Chris Wright authored and David Woodhouse committed May 3, 2005
1 parent 27b030d commit 0dd8e06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/audit.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ static void audit_log_move(struct audit_buffer *ab)
if (ab->len == 0)
return;

skb = skb_peek(&ab->sklist);
skb = skb_peek_tail(&ab->sklist);
if (!skb || skb_tailroom(skb) <= ab->len + extra) {
skb = alloc_skb(2 * ab->len + extra, GFP_ATOMIC);
if (!skb) {
Expand Down

0 comments on commit 0dd8e06

Please sign in to comment.