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:	Thu, 13 Nov 2008 00:23:12 +0100
From:	Nick Piggin <npiggin@...e.de>
To:	Venkatesh Pallipadi <venkatesh.pallipadi@...el.com>
Cc:	Ingo Molnar <mingo@...e.hu>, Thomas Gleixner <tglx@...utronix.de>,
	"H.Peter Anvin" <hpa@...or.com>, Hugh Dickins <hugh@...itas.com>,
	Roland Dreier <rdreier@...co.com>,
	Jesse Barnes <jbarnes@...tuousgeek.org>,
	Jeremy Fitzhardinge <jeremy@...p.org>,
	Arjan van de Ven <arjan@...radead.com>,
	linux-kernel@...r.kernel.org,
	Suresh Siddha <suresh.b.siddha@...el.com>
Subject: Re: [patch 2/8] x86 PAT: set VM_PFNMAP flag in vm_insert_pfn

You have to be careful of this, because it can be called with mmap_sem
held for read only. Hmm, I guess vm_insert_page is doing the same thing.
Probably mostly works because all other modifiers of vm_flags are holding
mmap_sem.

However, in some cases, code can do vm_insert_pfn and vm_insert_page
(actually hmm, no vm_insert_mixed actually should cover most of those
cases).

Still, I'd be much happier if we could make these into BUG_ON, and then
teach callers to set it in their .mmap routines.

 
On Wed, Nov 12, 2008 at 01:26:49PM -0800, Venkatesh Pallipadi wrote:
> vm_insert_pfn() is not setting the VM_PFNMAP flag in vma. Fix that.
> 
> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@...el.com>
> Signed-off-by: Suresh Siddha <suresh.b.siddha@...el.com>
> 
> ---
>  mm/memory.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> Index: tip/mm/memory.c
> ===================================================================
> --- tip.orig/mm/memory.c	2008-11-06 09:44:56.000000000 -0800
> +++ tip/mm/memory.c	2008-11-10 09:44:47.000000000 -0800
> @@ -1444,6 +1444,8 @@ int vm_insert_pfn(struct vm_area_struct 
>  
>  	if (addr < vma->vm_start || addr >= vma->vm_end)
>  		return -EFAULT;
> +
> +	vma->vm_flags |= VM_PFNMAP;
>  	return insert_pfn(vma, addr, pfn, vma->vm_page_prot);
>  }
>  EXPORT_SYMBOL(vm_insert_pfn);
> 
> -- 
--
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