Commit 0dd8e06b authored by Chris Wright's avatar Chris Wright Committed by David Woodhouse

[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: default avatarChris Wright <chrisw@osdl.org>
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
parent 27b030d5
...@@ -486,7 +486,7 @@ static void audit_log_move(struct audit_buffer *ab) ...@@ -486,7 +486,7 @@ static void audit_log_move(struct audit_buffer *ab)
if (ab->len == 0) if (ab->len == 0)
return; return;
skb = skb_peek(&ab->sklist); skb = skb_peek_tail(&ab->sklist);
if (!skb || skb_tailroom(skb) <= ab->len + extra) { if (!skb || skb_tailroom(skb) <= ab->len + extra) {
skb = alloc_skb(2 * ab->len + extra, GFP_ATOMIC); skb = alloc_skb(2 * ab->len + extra, GFP_ATOMIC);
if (!skb) { if (!skb) {
......
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