diff options
author | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-05-13 11:35:19 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-05-13 11:35:19 -0400 |
commit | 9ea74f0655412d0fbd12bf9adb6c14c8fe707a42 (patch) | |
tree | 8c04a9c6ed0144ff217b227fbf354f41dbceb023 /kernel | |
parent | add671412021b68c3b4f2882b0d10a56e2dcdabe (diff) |
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: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/audit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index 060b554f481e..187164572bd0 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
@@ -670,7 +670,7 @@ static void audit_log_vformat(struct audit_buffer *ab, const char *fmt, | |||
670 | /* The printk buffer is 1024 bytes long, so if we get | 670 | /* The printk buffer is 1024 bytes long, so if we get |
671 | * here and AUDIT_BUFSIZ is at least 1024, then we can | 671 | * here and AUDIT_BUFSIZ is at least 1024, then we can |
672 | * log everything that printk could have logged. */ | 672 | * log everything that printk could have logged. */ |
673 | avail = audit_expand(ab, 1+len-avail); | 673 | avail = audit_expand(ab, max_t(AUDIT_BUFSIZ, 1+len-avail)); |
674 | if (!avail) | 674 | if (!avail) |
675 | goto out; | 675 | goto out; |
676 | len = vsnprintf(skb->tail, avail, fmt, args2); | 676 | len = vsnprintf(skb->tail, avail, fmt, args2); |