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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100427144723.a8c3d997.akpm@linux-foundation.org>
Date:	Tue, 27 Apr 2010 14:47:23 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Huang Ying <ying.huang@...el.com>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Andi Kleen <andi@...stfloor.org>, Avi Kivity <avi@...hat.com>
Subject: Re: [PATCH 1/2] mm, Make __get_user_pages return -EHWPOISON for
 HWPOISON page

On Tue, 27 Apr 2010 15:04:18 +0800
Huang Ying <ying.huang@...el.com> wrote:

> With this patch, the caller of __get_user_pages can distinguish
> HWPOISON page from general FAULT page. This is needed by KVM, where
> UCR MCE should be relayed to guest for HWPOISON page, while
> instruction emulation and MMIO will be tried for general FAULT page.
> 
> Signed-off-by: Huang Ying <ying.huang@...el.com>
> ---
>  include/asm-generic/errno.h |    2 ++
>  mm/memory.c                 |    5 +++--
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> --- a/include/asm-generic/errno.h
> +++ b/include/asm-generic/errno.h
> @@ -108,4 +108,6 @@
>  
>  #define ERFKILL		132	/* Operation not possible due to RF-kill */
>  
> +#define EHWPOISON	133	/* Memory page has hardware error */
> +
>  #endif
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -1432,9 +1432,10 @@ int __get_user_pages(struct task_struct
>  				if (ret & VM_FAULT_ERROR) {
>  					if (ret & VM_FAULT_OOM)
>  						return i ? i : -ENOMEM;
> -					if (ret &
> -					    (VM_FAULT_HWPOISON|VM_FAULT_SIGBUS))
> +					if (ret & VM_FAULT_SIGBUS)
>  						return i ? i : -EFAULT;
> +					if (ret & VM_FAULT_HWPOISON)
> +						return i ? i : -EHWPOISON;
>  					BUG();
>  				}
>  				if (ret & VM_FAULT_MAJOR)
> 

This will cause various code paths (eg: fs/direct-io.c) to return
-EHWPOISON to userspace, will it not?

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