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:	Sat, 8 Nov 2008 13:59:52 +0100
From:	Pavel Machek <pavel@...e.cz>
To:	"Rafael J. Wysocki" <rjw@...k.pl>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>,
	pm list <linux-pm@...ts.linux-foundation.org>
Subject: Re: [PATCH] Fix __pfn_to_page(pfn) for CONFIG_DISCONTIGMEM=y

Hi!

> This would be good to have in .28 IMO.

Actually, this makes sense even for .27-stable, AFAICT.

> From: Rafael J. Wysocki <rjw@...k.pl>
> Subject: Fix __pfn_to_page(pfn) for CONFIG_DISCONTIGMEM=y
> 
> Fix macro __pfn_to_page(pfn) so that it doesn't evaluate its
> argument twice in the CONFIG_DISCONTIGMEM=y case, because 'pfn' may
> be a result of a funtion call having side effects.

function call?

> For example, the hibernation code applies pfn_to_page(pfn) to the
> result of a function returning the pfn corresponding to the next set
> bit in a bitmap and the current bit position is modified on each
> call.  This leads to "interesting" failures for CONFIG_DISCONTIGMEM=y
> due to the current behavior of __pfn_to_page(pfn).
> 
> Signed-off-by: Rafael J. Wysocki <rjw@...k.pl>
> Cc: Pavel Machek <pavel@...e.cz>

Acked-by: Pavel Machek <pavel@...e.cz>


>  include/asm-generic/memory_model.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: linux-2.6/include/asm-generic/memory_model.h
> ===================================================================
> --- linux-2.6.orig/include/asm-generic/memory_model.h
> +++ linux-2.6/include/asm-generic/memory_model.h
> @@ -34,7 +34,7 @@
>  
>  #define __pfn_to_page(pfn)			\
>  ({	unsigned long __pfn = (pfn);		\
> -	unsigned long __nid = arch_pfn_to_nid(pfn);  \
> +	unsigned long __nid = arch_pfn_to_nid(__pfn);  \
>  	NODE_DATA(__nid)->node_mem_map + arch_local_page_offset(__pfn, __nid);\
>  })
>  

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
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