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, 23 Jan 2014 14:49:54 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	malc <av1474@...tv.ru>
Cc:	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	Jianyu Zhan <nasa4836@...il.com>
Subject: Re: [PATCH] Revert
 "mm/vmalloc: interchage the implementation of vmalloc_to_{pfn,page}"

On Thu, 23 Jan 2014 20:27:29 +0400 (MSK) malc <av1474@...tv.ru> wrote:

> Sep 17 00:00:00 2001
> From: Vladimir Murzin <murzin.v@...il.com>
> Date: Thu, 23 Jan 2014 14:54:20 +0400
> Subject: [PATCH] Revert "mm/vmalloc: interchage the implementation of
>  vmalloc_to_{pfn,page}"
> 
> This reverts commit ece86e222db48d04bda218a2be70e384518bb08c.
> 
> Despite being claimed that patch doesn't introduce any functional
> changes in fact it does.
> 
> The "no page" path behaves different now. Originally, vmalloc_to_page
> might return NULL under some conditions, with new implementation it returns
> pfn_to_page(0) which is not the same as NULL.
> 
> Simple test shows the difference.
> 
> test.c
> 
> #include <linux/kernel.h>
> #include <linux/module.h>
> #include <linux/vmalloc.h>
> #include <linux/mm.h>
> 
> int __init myi(void)
> {
> 	struct page *p;
> 	void *v;
> 
> 	v = vmalloc(PAGE_SIZE);
> 	/* trigger the "no page" path in vmalloc_to_page*/
> 	vfree(v);
> 
> 	p = vmalloc_to_page(v);
> 
> 	pr_err("expected val = NULL, returned val = %p", p);
> 
> 	return -EBUSY;
> }
> 
> void __exit mye(void)
> {
> 
> }
> module_init(myi)
> module_exit(mye)
> 
> Before interchange:
> expected val = NULL, returned val =   (null)
> 
> After interchange:
> expected val = NULL, returned val = c7ebe000
> 

hm, yes, I suppose that's bad.

Rather than reverting the patch we could fix up vmalloc_to_pfn() and/or
vmalloc_to_page() to handle this situation.  Did you try that?

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