Skip to content
Commit 4e310fda authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds
Browse files

vsprintf: Change struct printf_spec.precision from s8 to s16

Commit ef0658f3

 changed precision
from int to s8.

There is existing kernel code that uses a larger precision.

An example from the audit code:
	vsnprintf(...,..., " msg='%.1024s'", (char *)data);
which overflows precision and truncates to nothing.

Extending precision size fixes the audit system issue.

Other changes:

Change the size of the struct printf_spec.type from u16 to u8 so
sizeof(struct printf_spec) stays as small as possible.
Reorder the struct members so sizeof(struct printf_spec) remains 64 bits
without alignment holes.
Document the struct members a bit more.

Original-patch-by: default avatarEric Paris <eparis@redhat.com>
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Tested-by: default avatarJustin P. Mattock <justinmattock@gmail.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2ba3abd8
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