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: <20151223163630.GA19488@mail.hallyn.com>
Date:	Wed, 23 Dec 2015 10:36:30 -0600
From:	"Serge E. Hallyn" <serge.hallyn@...ntu.com>
To:	Tejun Heo <tj@...nel.org>
Cc:	serge.hallyn@...ntu.com, linux-api@...r.kernel.org,
	containers@...ts.linux-foundation.org, hannes@...xchg.org,
	linux-kernel@...r.kernel.org, ebiederm@...ssion.com,
	lxc-devel@...ts.linuxcontainers.org, gregkh@...uxfoundation.org,
	cgroups@...r.kernel.org, akpm@...ux-foundation.org
Subject: Re: [PATCH 1/8] kernfs: Add API to generate relative kernfs path

On Wed, Dec 23, 2015 at 11:08:54AM -0500, Tejun Heo wrote:
> Hello, Serge.
> 
> On Tue, Dec 22, 2015 at 10:23:22PM -0600, serge.hallyn@...ntu.com wrote:
> > @@ -164,18 +286,39 @@ void pr_cont_kernfs_name(struct kernfs_node *kn)
> >  void pr_cont_kernfs_path(struct kernfs_node *kn)
> >  {
> >  	unsigned long flags;
> > -	char *p;
> > +	char *p = NULL;
> > +	int sz1, sz2;
> >  
> >  	spin_lock_irqsave(&kernfs_rename_lock, flags);
> >  
> > -	p = kernfs_path_locked(kn, kernfs_pr_cont_buf,
> > -			       sizeof(kernfs_pr_cont_buf));
> > -	if (p)
> > -		pr_cont("%s", p);
> > -	else
> > -		pr_cont("<name too long>");
> > +	sz1 = kernfs_path_from_node_locked(kn, NULL, kernfs_pr_cont_buf,
> > +					   sizeof(kernfs_pr_cont_buf));
> > +	if (sz1 < 0) {
> > +		pr_cont("(error)");
> > +		goto out;
> > +	}
> > +
> > +	if (sz1 < sizeof(kernfs_pr_cont_buf)) {
> > +		pr_cont("%s", kernfs_pr_cont_buf);
> > +		goto out;
> > +	}
> > +
> > +	p = kmalloc(sz1 + 1, GFP_NOFS);
> 
> We can't do GFP_NOFS allocation while holding a spinlock and we don't
> want to do atomic allocation here either.  I think it'd be best to
> keep using the static buffer.

D'oh, right.  Will update.
--
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