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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 2 Mar 2016 10:03:50 -0300
From:	Arnaldo Carvalho de Melo <acme@...nel.org>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Colin King <colin.king@...onical.com>,
	Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf tests: initialize sa.sa_flags

Em Wed, Mar 02, 2016 at 01:59:01PM +0100, Peter Zijlstra escreveu:
> On Wed, Mar 02, 2016 at 12:55:22PM +0000, Colin King wrote:
> > From: Colin Ian King <colin.king@...onical.com>
> > 
> > The sa_flags field is not being initialized, so a garbage value is
> > being passed to sigaction.  Initialize it to zero.
> > 
> > Signed-off-by: Colin Ian King <colin.king@...onical.com>
> > ---
> >  tools/perf/arch/x86/tests/rdpmc.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/tools/perf/arch/x86/tests/rdpmc.c b/tools/perf/arch/x86/tests/rdpmc.c
> > index 7bb0d13..7945462 100644
> > --- a/tools/perf/arch/x86/tests/rdpmc.c
> > +++ b/tools/perf/arch/x86/tests/rdpmc.c
> > @@ -103,6 +103,7 @@ static int __test__rdpmc(void)
> >  
> >  	sigfillset(&sa.sa_mask);
> >  	sa.sa_sigaction = segfault_handler;
> > +	sa.sa_flags = 0;
> 
> Would not something like:
> 
> 	sa = (struct sigaction){
> 		.sa_sigaction = segfault_handler,
> 	};
> 	sigfillset(&sa.sa_mask);
> 
> Be better?

I thought about that, but isn't that set in stone? This would be a 4
liner, while his is a one' :-)

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ