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:   Tue, 28 Jul 2020 10:40:22 +0800
From:   Muchun Song <songmuchun@...edance.com>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     mike.kravetz@...cle.com, Michal Hocko <mhocko@...nel.org>,
        David Rientjes <rientjes@...gle.com>, mgorman@...e.de,
        Michel Lespinasse <walken@...gle.com>,
        Linux Memory Management List <linux-mm@...ck.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Jianchao Guo <guojianchao@...edance.com>
Subject: Re: [External] Re: [PATCH v3] mm/hugetlb: add mempolicy check in the
 reservation routine

On Tue, Jul 28, 2020 at 8:19 AM Andrew Morton <akpm@...ux-foundation.org> wrote:
>
> On Sat, 25 Jul 2020 16:07:49 +0800 Muchun Song <songmuchun@...edance.com> wrote:
>
> > In the reservation routine, we only check whether the cpuset meets
> > the memory allocation requirements. But we ignore the mempolicy of
> > MPOL_BIND case. If someone mmap hugetlb succeeds, but the subsequent
> > memory allocation may fail due to mempolicy restrictions and receives
> > the SIGBUS signal. This can be reproduced by the follow steps.
> >
> >  1) Compile the test case.
> >     cd tools/testing/selftests/vm/
> >     gcc map_hugetlb.c -o map_hugetlb
> >
> >  2) Pre-allocate huge pages. Suppose there are 2 numa nodes in the
> >     system. Each node will pre-allocate one huge page.
> >     echo 2 > /proc/sys/vm/nr_hugepages
> >
> >  3) Run test case(mmap 4MB). We receive the SIGBUS signal.
> >     numactl --membind=0 ./map_hugetlb 4
> >
> > With this patch applied, the mmap will fail in the step 3) and throw
> > "mmap: Cannot allocate memory".
>
> This doesn't compile with CONFIG_NUMA=n - ther eis no implementation of
> get_task_policy().
>
> I think it needs more than a simple build fix - can we please rework
> the patch so that its impact (mainly code size) on non-NUMA machines is
> minimized?
>

OK. I will do that, thanks.


-- 
Yours,
Muchun

Powered by blists - more mailing lists