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] [day] [month] [year] [list]
Date:	Thu, 30 Jun 2016 11:48:30 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Jiri Olsa <jolsa@...hat.com>
Cc:	linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	Rasmus Villemoes <linux@...musvillemoes.dk>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
	Jiri Olsa <jolsa@...nel.org>
Subject: Re: [RFC][PATCH 3/3] vsprintf: Add support for %pb and friends to
 vbin_printf()

On Thu, 30 Jun 2016 16:56:34 +0200
Jiri Olsa <jolsa@...hat.com> wrote:

> On Wed, Jun 29, 2016 at 04:05:25PM -0400, Steven Rostedt wrote:
> 
> SNIP
> 
> >  			}
> > @@ -2552,11 +2561,18 @@ int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf)
> >  		}
> >  
> >  		case FORMAT_TYPE_PTR: {
> > +			unsigned long *tmp_ptr;
> > +			unsigned long *ptr;
> >  			const char *_fmt = fmt;
> >  			char tmp_fmt[2];
> >  
> >  			if (supported_bin_ptr(fmt)) {
> >  				switch (fmt[0]) {
> > +				case 'b': {
> > +					tmp_ptr = get_arg(void *);
> > +					ptr = (void *)&tmp_ptr;  
> 
> this seems wrong.. &tmp_ptr is address from the stack
> not from args which is what we want in here IIUC

Ah, your right. This only worked because the test I did was on a mask
of less than 64 cpus, where the above moved the bitmask into tmp_ptr.

I do want the address of the actual args array.

> 
> should we do something like in attached patch? untested..

I'll test it out.

Thanks,

-- Steve

> 
> thanks,
> jirka
> 
> 
> ---
> diff --git a/lib/vsprintf.c b/lib/vsprintf.c
> index 474d9ddaca6f..9aeb277ae533 100644
> --- a/lib/vsprintf.c
> +++ b/lib/vsprintf.c
> @@ -2561,7 +2561,6 @@ int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf)
>  		}
>  
>  		case FORMAT_TYPE_PTR: {
> -			unsigned long *tmp_ptr;
>  			unsigned long *ptr;
>  			const char *_fmt = fmt;
>  			char tmp_fmt[2];
> @@ -2569,8 +2568,8 @@ int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf)
>  			if (supported_bin_ptr(fmt)) {
>  				switch (fmt[0]) {
>  				case 'b': {
> -					tmp_ptr = get_arg(void *);
> -					ptr = (void *)&tmp_ptr;
> +					ptr = (unsigned long *) PTR_ALIGN(args, sizeof(u32));
> +					args += BITS_TO_LONGS(spec.field_width);
>  					break;
>  				}
>  				case 'F':

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ