mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Paris <eparis@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: joe@perches.com, fweisbec@gmail.com
Subject: [REGRESSION PATCH] vsprintf: increase sizeof precision in printf_spec
Date: Tue, 13 Apr 2010 21:13:36 -0400	[thread overview]
Message-ID: <20100414011336.16139.68030.stgit@paris.rdu.redhat.com> (raw)

Patch ef0658f3de484bf9b173639cd47544584e01efa5 changed the precision field
from and int to an s8.  Problem is that we have code which uses a much larger
precision in the kernel.  An example would in the audit code where we have:

vsnprintf(...,..., " msg='%.1024s'", (char *)data);

which causes precision to be too large and end up truncating to nothing.
Raising the size of the precision fixes the audit system issue.  It also does
not affect the alignment of the struct according to pahole and is still
approprietely packed.

Signed-off-by: Eric Paris <eparis@redhat.com>
---

 lib/vsprintf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 24112e5..a957d3f 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -412,7 +412,7 @@ struct printf_spec {
 	s16	field_width;	/* width of output field */
 	u8	flags;		/* flags to number() */
 	u8	base;
-	s8	precision;	/* # of digits/chars */
+	s16	precision;	/* # of digits/chars */
 	u8	qualifier;
 };
 


             reply	other threads:[~2010-04-14  1:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-14  1:13 Eric Paris [this message]
2010-04-14  1:33 ` Joe Perches
2010-04-14  2:44   ` Eric Paris
2010-04-14  3:01     ` Joe Perches
2010-04-14 14:40       ` Justin P. mattock
2010-04-14 15:00       ` Frederic Weisbecker
2010-04-14 16:27 ` [REGRESSION PATCH V2] vsprintf: Change struct printf_spec.precision from s8 to s16 Joe Perches
2010-04-14 16:47   ` Justin P. mattock
2010-04-14 18:50   ` Eric Paris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100414011336.16139.68030.stgit@paris.rdu.redhat.com \
    --to=eparis@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®