aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@shinybook.infradead.org>2005-05-10 13:58:51 -0400
committerDavid Woodhouse <dwmw2@shinybook.infradead.org>2005-05-10 13:58:51 -0400
commiteecb0a7338ef6504aa49def4dde6429853025801 (patch)
tree078561cbf3e1fb3d8f837a96f2a6d49d85c6819a /kernel
parente3b926b4c1499ba7b1b9513aa6113944d572aba5 (diff)
AUDIT: Fix abuse of va_args.
We're not allowed to use args twice; we need to use va_copy. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/audit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index 1dd456c90ae5..ddb69a458203 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -708,6 +708,7 @@ static void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
708{ 708{
709 int len, avail; 709 int len, avail;
710 struct sk_buff *skb; 710 struct sk_buff *skb;
711 va_list args2;
711 712
712 if (!ab) 713 if (!ab)
713 return; 714 return;
@@ -720,6 +721,7 @@ static void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
720 if (!avail) 721 if (!avail)
721 goto out; 722 goto out;
722 } 723 }
724 va_copy(args2, args);
723 len = vsnprintf(skb->tail, avail, fmt, args); 725 len = vsnprintf(skb->tail, avail, fmt, args);
724 if (len >= avail) { 726 if (len >= avail) {
725 /* The printk buffer is 1024 bytes long, so if we get 727 /* The printk buffer is 1024 bytes long, so if we get
@@ -728,7 +730,7 @@ static void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
728 avail = audit_expand(ab, 1+len-avail); 730 avail = audit_expand(ab, 1+len-avail);
729 if (!avail) 731 if (!avail)
730 goto out; 732 goto out;
731 len = vsnprintf(skb->tail, avail, fmt, args); 733 len = vsnprintf(skb->tail, avail, fmt, args2);
732 } 734 }
733 skb_put(skb, (len < avail) ? len : avail); 735 skb_put(skb, (len < avail) ? len : avail);
734out: 736out: