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, 27 May 2015 14:09:31 -0700
From:	Joe Perches <joe@...ches.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RFC patch] vsprintf: Add %pav extension for print_vma_addr

On Wed, 2015-05-27 at 14:04 -0700, Andrew Morton wrote:
> On Tue, 26 May 2015 16:05:04 -0700 Joe Perches <joe@...ches.com> wrote:
> > print_vma_addr is another function to emit useful
> > data similar to print_symbol.  The print_symbol
> > functionality has been added via %p[fFsS] vsprintf
> > extensions.
> > 
> > Perhaps it's appropriate to add vma_addr address
> > decoding to vsprintf too.
[]
> >  static noinline_for_stack
> > +char *vma_addr(char *buf, char *end, const void *addr,
> > +	       struct printf_spec spec, const char *fmt)
> > +{
> > +	struct mm_struct *mm = current->mm;
> > +	struct vm_area_struct *vma;
> > +	unsigned long ip = *(unsigned long *)addr;
> > +	char *rtn;
> > +
> > +	/* if we are in atomic contexts (in exception stacks, etc.) */
> > +	if (preempt_count())
> > +		return string(buf, end, "(atomic context)", spec);
> 
> Problems when CONFIG_PREEMPT=n.
> 
> > +	down_read(&mm->mmap_sem);
> > +	vma = find_vma(mm, ip);
> > +	if (vma && vma->vm_file) {
> > +		struct file *f = vma->vm_file;
> > +		char *gfp_buf = (char *)__get_free_page(GFP_KERNEL);
> 
> We shouldn't assume we can use GFP_KERNEL here.  Even if the
> preempt_count() worked, we might be in a context which requires
> GFP_NOFS or GFP_NOIO.

This code is basically a copy of the existing print_vma_addr()
so is that true for all the existing uses too?


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