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:   Mon, 29 Jan 2018 18:39:01 -0500
From:   "Zi Yan" <zi.yan@...rutgers.edu>
To:     "Andrew Morton" <akpm@...ux-foundation.org>
Cc:     "Michal Hocko" <mhocko@...nel.org>,
        "Naoya Horiguchi" <n-horiguchi@...jp.nec.com>,
        "Kirill A. Shutemov" <kirill@...temov.name>,
        "Vlastimil Babka" <vbabka@...e.cz>,
        "Andrea Reale" <ar@...ux.vnet.ibm.com>,
        "Anshuman Khandual" <khandual@...ux.vnet.ibm.com>,
        linux-mm@...ck.org, LKML <linux-kernel@...r.kernel.org>,
        "Michal Hocko" <mhocko@...e.com>
Subject: Re: [PATCH 1/3] mm, numa: rework do_pages_move

On 29 Jan 2018, at 17:35, Andrew Morton wrote:

> On Mon, 29 Jan 2018 17:06:14 -0500 "Zi Yan" <zi.yan@...rutgers.edu> wrote:
>
>> I discover that this patch does not hold mmap_sem while migrating pages in
>> do_move_pages_to_node().
>>
>> A simple fix below moves mmap_sem from add_page_for_migration()
>> to the outmost do_pages_move():
>
> I'm not surprised.  Why does do_move_pages_to_node() need mmap_sem
> and how is a reader to discover that fact???

do_move_pages_to_node() calls migrate_pages(), which requires down_read(&mmap_sem).

In the outmost do_pages_move(), both add_page_for_migration() and
do_move_pages_to_node() inside it need to hold read lock of mmap_sem.

Do we need to add comments for both functions?

--
Best Regards
Yan Zi

Download attachment "signature.asc" of type "application/pgp-signature" (497 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ