lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1271208801.1555.12.camel@Joe-Laptop.home>
Date:	Tue, 13 Apr 2010 18:33:21 -0700
From:	Joe Perches <joe@...ches.com>
To:	Eric Paris <eparis@...hat.com>
Cc:	linux-kernel@...r.kernel.org, fweisbec@...il.com
Subject: Re: [REGRESSION PATCH] vsprintf: increase sizeof precision in
 printf_spec

On Tue, 2010-04-13 at 21:13 -0400, Eric Paris wrote:
> 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.

I don't see how it could be appropriately packed.

This is the structure now:

struct printf_spec {
	u16	type;
	s16	field_width;	/* width of output field */
	u8	flags;		/* flags to number() */
	u8	base;
	s8	precision;	/* # of digits/chars */
	u8	qualifier;
};

Adding another char should make the structure larger than 64 bits.

type isn't currently required to be u16.
It could be u8.

Perhaps this is better.

struct printf_spec {
	u8 type;
	u8 flags;		/* flags to number() */
	u8 base;
	u8 qualifier;
	s16 field_width;	/* width of output field */
	s16 precision;		/* # of digits/chars */
} __attribute__((packed));

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ