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]
Message-ID: <1403120982.3839.25.camel@joe-AO725>
Date:	Wed, 18 Jun 2014 12:49:42 -0700
From:	Joe Perches <joe@...ches.com>
To:	paulmck@...ux.vnet.ibm.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
Subject: Re: [RFC PATCH] checkpatch: Attempt to find unnecessary 'out of
 memory' messages

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



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