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:	Tue, 25 Aug 2015 13:56:27 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Joe Perches <joe@...ches.com>
Cc:	David Howells <dhowells@...hat.com>,
	James Morris <jmorris@...ei.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Julia Lawall <julia.lawall@...6.fr>
Subject: Re: [PATCH] cred: Remove unnecessary kdebug atomic reads

On Tue, 25 Aug 2015 13:51:06 -0700 Joe Perches <joe@...ches.com> wrote:

> On Tue, 2015-08-25 at 13:39 -0700, Andrew Morton wrote:
> > On Tue, 25 Aug 2015 09:53:51 -0700 Joe Perches <joe@...ches.com> wrote:
> > > commit e0e817392b9a ("CRED: Add some configurable debugging [try #6]")
> > > added the kdebug mechanism to this file back in 2009.
> > > 
> > > The kdebug macro calls no_printk which always evaluates arguments.
> > > 
> > > Most of the kdebug uses have an unnecessary call of
> > > 	atomic_read(&cred->usage)
> > > 
> > > Make the kdebug macro do nothing by defining it with
> > > 	do { if (0) no_printk(...); } while (0)
> > > when not enabled.
> []
> > Did you consider doing this within no_printk()?
> 
> Yes.
> 
> > That would break code
> > which is relying on side-effects in the evaluation of a printk arg but
> > that's pretty weird and I bet there isn't (and won't be) such code.
> 
> I'll bet you there is more than a little and I don't want to
> experiment with it unconditionally.
> 
> All printks would need to be evaluated for that side-effect.
> 
> Safer would be to create a new no_eval_printk macro and convert
> the no_printk uses over to that as appropriate and possibly create
> a CONFIG_ option to use no_eval_printk instead of no_printk/printk
> and let the adventurous find the side-effects.
> 
> Maybe a coccinelle script can be written to find all the locations
> with evaluated non-constant expression arguments with side-effects.

wimp.


That duplicated printk in cred.c is nasty.  We could do this?

#if 0
#define __kdebug printk
#else
#define __kdebug if (0) no_printk
#endif

#define kdebug(FMT, ...) \
	__kdebug(...)


--
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