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] [day] [month] [year] [list]
Date:	Tue, 27 Apr 2010 18:56:53 -0400
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 Wed, 28 Apr 2010 09:50:12 +0800 Huang Ying <ying.huang@...el.com> wrote:

> On Wed, 2010-04-28 at 05:47 +0800, Andrew Morton wrote:
> > On Tue, 27 Apr 2010 15:04:18 +0800
> > Huang Ying <ying.huang@...el.com> wrote:
> > 
>
> ...
> 
> > >  				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?
> 
> Yes. I think it may be returned to userspace. Do we need to keep the
> userspace errno interface like this?

I don't think we should extend the kernel interface in a non-posix
fashion without good reason and some thought.  manpages and glibc will
need to be updated, etc..

> If it is, we can check whether the virtual page is hwpoisoned via going
> through the page table because the hwpoisoned virtual page has a special
> swap entry in page table.

Spose so.  Or you could perhaps extend __get_user_pages() by adding a
new FOLL_HWPOISON and make it return -EHWPOISON only if FOLL_HWPOISON
was set, and require that the __get_user_pages(FOLL_HWPOISON) caller
rewrite -EHWPOISON to something else.  But I didn't think about that
very hard.

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