Commit 0dd8e06bdaa0a97e706ee1a489a1f6176c4ddc64

Authored by Chris Wright
Committed by David Woodhouse
1 parent 27b030d58c

[PATCH] add new audit data to last skb

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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -486,7 +486,7 @@
486 486 if (ab->len == 0)
487 487 return;
488 488  
489   - skb = skb_peek(&ab->sklist);
  489 + skb = skb_peek_tail(&ab->sklist);
490 490 if (!skb || skb_tailroom(skb) <= ab->len + extra) {
491 491 skb = alloc_skb(2 * ab->len + extra, GFP_ATOMIC);
492 492 if (!skb) {