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:   Fri, 3 Mar 2017 08:42:08 +0100
From:   Dmitry Vyukov <dvyukov@...gle.com>
To:     Andrea Arcangeli <aarcange@...hat.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
        Jan Kara <jack@...e.cz>, ross.zwisler@...ux.intel.com,
        Michal Hocko <mhocko@...e.com>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Mike Kravetz <mike.kravetz@...cle.com>,
        syzkaller <syzkaller@...glegroups.com>
Subject: Re: mm: fault in __do_fault

On Tue, Feb 28, 2017 at 4:42 PM, Andrea Arcangeli <aarcange@...hat.com> wrote:
> Hello Dmitry,
>
> On Tue, Feb 28, 2017 at 03:04:53PM +0100, Dmitry Vyukov wrote:
>> Hello,
>>
>> The following program triggers GPF in __do_fault:
>> https://gist.githubusercontent.com/dvyukov/27345737fca18d92ef761e7fa08aec9b/raw/d99d02511d0bf9a8d6f6bd9c79d373a26924e974/gistfile1.txt
>
> Can you verify this fix:


Applied the patch on bots.


> From a65381bc86d2963713b6a9c4a73cded7dd184282 Mon Sep 17 00:00:00 2001
> From: Andrea Arcangeli <aarcange@...hat.com>
> Date: Tue, 28 Feb 2017 16:36:59 +0100
> Subject: [PATCH 1/1] userfaultfd: shmem: __do_fault requires VM_FAULT_NOPAGE
>
> __do_fault assumes vmf->page has been initialized and is valid if
> VM_FAULT_NOPAGE is not returned by vma->vm_ops->fault(vma, vmf).
>
> handle_userfault() in turn should return VM_FAULT_NOPAGE if it doesn't
> return VM_FAULT_SIGBUS or VM_FAULT_RETRY (the other two
> possibilities).
>
> This VM_FAULT_NOPAGE case is only invoked when signal are pending and
> it didn't matter for anonymous memory before. It only started to
> matter since shmem was introduced. hugetlbfs also takes a different
> path and doesn't exercise __do_fault.
>
> Signed-off-by: Andrea Arcangeli <aarcange@...hat.com>
> ---
>  fs/userfaultfd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
> index fb6d02b..de28f43 100644
> --- a/fs/userfaultfd.c
> +++ b/fs/userfaultfd.c
> @@ -500,7 +500,7 @@ int handle_userfault(struct vm_fault *vmf, unsigned long reason)
>                          * in such case.
>                          */
>                         down_read(&mm->mmap_sem);
> -                       ret = 0;
> +                       ret = VM_FAULT_NOPAGE;
>                 }
>         }
>
>
> --
> You received this message because you are subscribed to the Google Groups "syzkaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller+unsubscribe@...glegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ