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: <20140619210031.GN4904@linux.vnet.ibm.com>
Date:	Thu, 19 Jun 2014 14:00:31 -0700
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Joe Perches <joe@...ches.com>
Cc:	Julia Lawall <julia.lawall@...6.fr>,
	Dan Carpenter <dan.carpenter@...cle.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Andy Whitcroft <apw@...dowen.org>,
	LKML <linux-kernel@...r.kernel.org>, benoit.taine@...6.fr,
	romanov.arya@...il.com, bobby.prani@...il.com
Subject: Re: [RFC PATCH] checkpatch: Attempt to find unnecessary 'out of
 memory' messages

On Wed, Jun 18, 2014 at 12:49:42PM -0700, Joe Perches wrote:
> On Wed, 2014-06-18 at 12:33 -0700, Paul E. McKenney wrote:
> > On Sat, Jun 14, 2014 at 11:51:41AM +0200, Julia Lawall wrote:
> > > On Sat, 14 Jun 2014, Julia Lawall wrote:
> > > > With a semantic patch that searches for the various calls and then a 
> > > > string containing the letters "emory", I get removals of the messages 
> > > > below.  Do any of these messages look useful?  For example, some are 
> > > > generated with specific functions, such as IRDA_ERROR or BT_ERR.  If none 
> > > > of the messages look useful, should just one big patch go to trivial, or 
> > > > should the patches go to the individual maintainers?
> > > 
> > > Sorry, I left out all the strings...
> > 
> > I would like the rcu-torture message to stay:
> > 
> > > -		pr_err("rcu-torture: Out of memory, need: %d", size);
> > 
> > This is in a module that is not loaded into any reasonable production
> > kernel, and has helped me to catch typos.
> 
> I believe the function doesn't work well.
> 
> static void
> rcu_torture_stats_print(void)
> {
> 	int size = nr_cpu_ids * 200 + 8192;
> 	char *buf;
> 
> 	buf = kmalloc(size, GFP_KERNEL);
> 	if (!buf) {
> 		pr_err("rcu-torture: Out of memory, need: %d\n", size);
> 		return;
> 	}
> 	rcu_torture_printk(buf);
> 	pr_alert("%s", buf);
> 	kfree(buf);
> }
> 
> rcu_torture_printk simply fills buf
> 
> btw: I believe the arguments should pass size and
>      rcu_torture_printk should use snprintf/size
> 
> but all printks are limited to a maximum of 1024
> bytes so the large allocation is senseless and
> would even if it worked, would likely need to be
> vmalloc/vfree

Fair point!

Pranith, Romanov, if you would like part of RCU that is less touchy
about random hacking, this would be a good place to start.  Scripts in
tools/testing/selftests/rcutorture/bin do care about some of the format,
but the variable-length portion generated by cur_ops->stats() is as far
as I know only parsed by human eyes.

							Thanx, Paul

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