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>] [day] [month] [year] [list]
Date:	Fri, 7 Feb 2014 13:43:29 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Naoya Horiguchi <n-horiguchi@...jp.nec.com>
Cc:	linux-kernel@...r.kernel.org, Andi Kleen <andi@...stfloor.org>,
	Wanpeng Li <liwanp@...ux.vnet.ibm.com>,
	gong.chen@...ux.intel.com, linux-mm@...ck.org,
	Naoya Horiguchi <nao.horiguchi@...il.com>
Subject: Re: [PATCH] mm/memory-failure.c: move refcount only in
 !MF_COUNT_INCREASED

On Fri, 07 Feb 2014 16:16:04 -0500 Naoya Horiguchi <n-horiguchi@...jp.nec.com> wrote:

> # Resending due to sending failure. Sorry if you received twice.
> ---
> mce-test detected a test failure when injecting error to a thp tail page.
> This is because we take page refcount of the tail page in madvise_hwpoison()
> while the fix in commit a3e0f9e47d5e ("mm/memory-failure.c: transfer page
> count from head page to tail page after split thp") assumes that we always
> take refcount on the head page.
> 
> When a real memory error happens we take refcount on the head page where
> memory_failure() is called without MF_COUNT_INCREASED set, so it seems to me
> that testing memory error on thp tail page using madvise makes little sense.
> 
> This patch cancels moving refcount in !MF_COUNT_INCREASED for valid testing.
> 
> ...
>
> --- v3.14-rc1.orig/mm/memory-failure.c
> +++ v3.14-rc1/mm/memory-failure.c
> @@ -1042,8 +1042,10 @@ static int hwpoison_user_mappings(struct page *p, unsigned long pfn,
>  			 * to it. Similarly, page lock is shifted.
>  			 */
>  			if (hpage != p) {
> -				put_page(hpage);
> -				get_page(p);
> +				if (!(flags && MF_COUNT_INCREASED)) {

s/&&/&/

Please carefully retest this, make sure that both cases are covered?

> +					put_page(hpage);
> +					get_page(p);
> +				}
>  				lock_page(p);
>  				unlock_page(hpage);
>  				*hpagep = p;


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