Commit 9ea74f06 authored by David Woodhouse's avatar David Woodhouse

AUDIT: Round up audit skb expansion to AUDIT_BUFSIZ.

Otherwise, we will be repeatedly reallocating, even if we're only
adding a few bytes at a time. Pointed out by Steve Grubb.
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
parent add67141
...@@ -670,7 +670,7 @@ static void audit_log_vformat(struct audit_buffer *ab, const char *fmt, ...@@ -670,7 +670,7 @@ static void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
/* The printk buffer is 1024 bytes long, so if we get /* The printk buffer is 1024 bytes long, so if we get
* here and AUDIT_BUFSIZ is at least 1024, then we can * here and AUDIT_BUFSIZ is at least 1024, then we can
* log everything that printk could have logged. */ * log everything that printk could have logged. */
avail = audit_expand(ab, 1+len-avail); avail = audit_expand(ab, max_t(AUDIT_BUFSIZ, 1+len-avail));
if (!avail) if (!avail)
goto out; goto out;
len = vsnprintf(skb->tail, avail, fmt, args2); len = vsnprintf(skb->tail, avail, fmt, args2);
......
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