diff options
author | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-05-10 13:56:08 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-05-10 13:56:08 -0400 |
commit | e3b926b4c1499ba7b1b9513aa6113944d572aba5 (patch) | |
tree | 6d4a230f3c02ebfd5073517fe8eb36f9a61dad22 /kernel/audit.c | |
parent | 8c5aa40c94ef8bb7f7da95ecd5942e2d20fc3c9d (diff) |
AUDIT: pass size argument to audit_expand().
Let audit_expand() know how much it's expected to grow the buffer, in
the case that we have that information to hand.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'kernel/audit.c')
-rw-r--r-- | kernel/audit.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index 2ddd1a2b66d0..1dd456c90ae5 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
@@ -687,10 +687,10 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx) | |||
687 | * Returns 0 (no space) on failed expansion, or available space if | 687 | * Returns 0 (no space) on failed expansion, or available space if |
688 | * successful. | 688 | * successful. |
689 | */ | 689 | */ |
690 | static inline int audit_expand(struct audit_buffer *ab) | 690 | static inline int audit_expand(struct audit_buffer *ab, int extra) |
691 | { | 691 | { |
692 | struct sk_buff *skb = ab->skb; | 692 | struct sk_buff *skb = ab->skb; |
693 | int ret = pskb_expand_head(skb, skb_headroom(skb), AUDIT_BUFSIZ, | 693 | int ret = pskb_expand_head(skb, skb_headroom(skb), extra, |
694 | GFP_ATOMIC); | 694 | GFP_ATOMIC); |
695 | if (ret < 0) { | 695 | if (ret < 0) { |
696 | audit_log_lost("out of memory in audit_expand"); | 696 | audit_log_lost("out of memory in audit_expand"); |
@@ -716,7 +716,7 @@ static void audit_log_vformat(struct audit_buffer *ab, const char *fmt, | |||
716 | skb = ab->skb; | 716 | skb = ab->skb; |
717 | avail = skb_tailroom(skb); | 717 | avail = skb_tailroom(skb); |
718 | if (avail == 0) { | 718 | if (avail == 0) { |
719 | avail = audit_expand(ab); | 719 | avail = audit_expand(ab, AUDIT_BUFSIZ); |
720 | if (!avail) | 720 | if (!avail) |
721 | goto out; | 721 | goto out; |
722 | } | 722 | } |
@@ -725,7 +725,7 @@ static void audit_log_vformat(struct audit_buffer *ab, const char *fmt, | |||
725 | /* The printk buffer is 1024 bytes long, so if we get | 725 | /* The printk buffer is 1024 bytes long, so if we get |
726 | * here and AUDIT_BUFSIZ is at least 1024, then we can | 726 | * here and AUDIT_BUFSIZ is at least 1024, then we can |
727 | * log everything that printk could have logged. */ | 727 | * log everything that printk could have logged. */ |
728 | avail = audit_expand(ab); | 728 | avail = audit_expand(ab, 1+len-avail); |
729 | if (!avail) | 729 | if (!avail) |
730 | goto out; | 730 | goto out; |
731 | len = vsnprintf(skb->tail, avail, fmt, args); | 731 | len = vsnprintf(skb->tail, avail, fmt, args); |