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]
Date:	Wed, 12 Dec 2012 22:48:58 +0100
From:	Borislav Petkov <bp@...en8.de>
To:	Joe Perches <joe@...ches.com>
Cc:	Jiri Kosina <trivial@...nel.org>, Tony Luck <tony.luck@...el.com>,
	Jeff Dike <jdike@...toit.com>,
	Richard Weinberger <richard@....at>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
	linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org,
	user-mode-linux-devel@...ts.sourceforge.net,
	user-mode-linux-user@...ts.sourceforge.net
Subject: Re: [TRIVIAL PATCH 16/26] x86: Convert print_symbol to %pSR

On Wed, Dec 12, 2012 at 01:30:03PM -0800, Joe Perches wrote:
> > I think I'd go ahead and ACK this unless Tony has some comments. I'm
> > not happy about the two pr_emerg calls based on the conditional.
>
> It was done to avoid interleaving.

Right.

> > Or, Tony, what do you think, could we get away if we printed empty
> > string for when m->cs != __KERNEL_CS? I'm thinking of not breaking any
> > userspace which is parsing that output and seeing "... {}" in that case.
> > 
> > This assumes that vsprintf can print (void *)0 when passed as an
> > argument through %pSR. Joe?
> 
> Definitely yes when not #defined CONFIG_KALLSYMS
> 
> I believe no object exists at address 0 for all
> arches so I believe yes for CONFIG_KALLSYMS too,

Ok, here's what I'm thinking more specifically. Have single call like this:

	pr_emerg(HW_ERR "RIP%s %02x:<%016Lx> {%pSR}\n",
			!(m->mcgstatus & MCG_STATUS_EIPV) ? " !INEXACT!" : "",
			m->cs, m->ip,
			(m->cs == __KERNEL_CS) ? (void *)m->ip : (void *)0);

and when vsprintf gets to it, it recognizes the special case of
(void *)0 and dumps the empty string "" for that argument.

Hmm.

> My preference is to eventually do away with all the
> 	"[%0(size)lx] %pSR", addr, (void *)addr
> uses and create another %pSx that emits the pointer
> address and the function/offset in one go in a
> standardized style without caring about the pointer
> size.
> 
> Something like:
> 
> 	"%pSp", (void *)addr
> 
> would emit
> 
> 	[<7def0123>] function_name+offset/size

Right, this is another way of looking it. And in order to make it more
robust, it should be able to handle the (void *)0 case so that callers
don't have to check the arg.

Thanks.

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
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