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:   Wed, 8 Apr 2020 11:24:35 -0400
From:   Peter Xu <peterx@...hat.com>
To:     Michal Hocko <mhocko@...nel.org>
Cc:     linux-kernel@...r.kernel.org,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
        syzbot+693dc11fcb53120b5559@...kaller.appspotmail.com
Subject: Re: [PATCH 1/2] mm/mempolicy: Allow lookup_node() to handle fatal
 signal

On Wed, Apr 08, 2020 at 04:30:24PM +0200, Michal Hocko wrote:
> On Wed 08-04-20 10:20:39, Peter Xu wrote:
> > On Wed, Apr 08, 2020 at 12:21:28PM +0200, Michal Hocko wrote:
> > > On Tue 07-04-20 21:40:09, Peter Xu wrote:
> > > > lookup_node() uses gup to pin the page and get node information.  It
> > > > checks against ret>=0 assuming the page will be filled in.  However
> > > > it's also possible that gup will return zero, for example, when the
> > > > thread is quickly killed with a fatal signal.  Teach lookup_node() to
> > > > gracefully return an error -EFAULT if it happens.
> > > > 
> > > > Meanwhile, initialize "page" to NULL to avoid potential risk of
> > > > exploiting the pointer.
> > > > 
> > > > Reported-by: syzbot+693dc11fcb53120b5559@...kaller.appspotmail.com
> > > > Fixes: 4426e945df58 ("mm/gup: allow VM_FAULT_RETRY for multiple times")
> > > 
> > > I am not familiar with thic commit but shouldn't gup return ERESTARTSYS
> > > on a fatal signal?
> > 
> > Hi, Michal,
> > 
> > I do see quite a few usages on -ERESTARTSYS, but also some others,
> > majorly -EINTR, or even -EFAULT.  I think it could be a more general
> > question rather than a specific question to this patch only.
> 
> I am sorry but I was probably not clear enough. I was mostly worried
> that gup doesn't return ERESTARTSYS or EINTR when it backed off because
> of fatal signal pending. Your patch is checking for 0 an indicating that
> this is that condition.

Yeah I just noticed the fact, sorry!

Hillf just posted a fix there for recovering the behavior:

https://lore.kernel.org/lkml/20200408151213.GE66033@xz-x1/

Thanks,

-- 
Peter Xu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ