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-next>] [day] [month] [year] [list]
Message-Id: <20220421190533.1601879-1-npache@redhat.com>
Date:   Thu, 21 Apr 2022 15:05:30 -0400
From:   Nico Pache <npache@...hat.com>
To:     linux-kernel@...r.kernel.org, linux-mm@...ck.org
Cc:     Michael Ellerman <mpe@...erman.id.au>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Paul Mackerras <paulus@...ba.org>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Nicholas Piggin <npiggin@...il.com>,
        Logan Gunthorpe <logang@...tatee.com>,
        Hari Bathini <hbathini@...ux.ibm.com>,
        "Aneesh Kumar K.V" <aneesh.kumar@...ux.ibm.com>,
        "Matthew Wilcox (Oracle)" <willy@...radead.org>,
        Yang Shi <shy828301@...il.com>,
        Miaohe Lin <linmiaohe@...wei.com>,
        William Kucharski <william.kucharski@...cle.com>,
        Hugh Dickins <hughd@...gle.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Darren Hart <dvhart@...radead.org>,
        Davidlohr Bueso <dave@...olabs.net>,
        André Almeida <andrealmeid@...labora.com>,
        Arjan van de Ven <arjan@...radead.org>,
        Ulrich Drepper <drepper@...hat.com>,
        Michal Hocko <mhocko@...e.com>
Subject: [RFC 0/3] Slight improvements for OOM/Futex

The following 3 patches were developed while working on the OOM/Futex
fix. 

Patch 1: This is a nonfunctional change. The vma_is_anonymous function
originally led to some confusion about what the oom reaper is checking
for in __oom_reap_task_mm. This patch makes that function name more 
verbose.

Patch 2: Futex cleanup was designed with silent failures. Printing this
failure would have led to more quickly finding the issue. This
introduces a pr_info if the exit path has any issues walking the
userspace list.

Patch 3: During the debug process I noticed that the oom_reap_task_mm
function was always running twice for the same mm_struct; Once in the
exit path and once in the oom_reaper. By checking the MMF_OOM_SKIP we
can prevent these unnecissary double calls. I'd like some input from
David Rientjes here with regards to CVE-2018-1000200, I want to make
sure we are not reintroducing that CVE.

Cc: Michael Ellerman <mpe@...erman.id.au>
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Alexander Viro <viro@...iv.linux.org.uk>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Nicholas Piggin <npiggin@...il.com>
Cc: Logan Gunthorpe <logang@...tatee.com>
Cc: Hari Bathini <hbathini@...ux.ibm.com>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@...ux.ibm.com>
Cc: "Matthew Wilcox (Oracle)" <willy@...radead.org>
Cc: Yang Shi <shy828301@...il.com>
Cc: Miaohe Lin <linmiaohe@...wei.com>
Cc: William Kucharski <william.kucharski@...cle.com>
Cc: Hugh Dickins <hughd@...gle.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Darren Hart <dvhart@...radead.org>
Cc: Davidlohr Bueso <dave@...olabs.net>
Cc: "André Almeida" <andrealmeid@...labora.com>
Cc: Arjan van de Ven <arjan@...radead.org>
Cc: Ulrich Drepper <drepper@...hat.com>
Cc: Michal Hocko <mhocko@...e.com>
Signed-off-by: Nico Pache <npache@...hat.com>

Nico Pache (3):
  mm: change vma_is_anonymous to vma_is_private_anon
  futex: exit: Print a warning when futex_cleanup fails
  exit: Check for MMF_OOM_SKIP in exit_mmap

 arch/powerpc/mm/book3s64/pgtable.c |  2 +-
 fs/userfaultfd.c                   |  2 +-
 include/linux/huge_mm.h            |  2 +-
 include/linux/mm.h                 |  2 +-
 kernel/futex/core.c                | 44 ++++++++++++++++++------------
 mm/gup.c                           |  4 +--
 mm/huge_memory.c                   | 10 +++----
 mm/madvise.c                       |  4 +--
 mm/memory.c                        | 10 +++----
 mm/migrate_device.c                |  6 ++--
 mm/mincore.c                       |  2 +-
 mm/mmap.c                          |  7 +++--
 mm/oom_kill.c                      |  2 +-
 mm/userfaultfd.c                   |  8 +++---
 14 files changed, 57 insertions(+), 48 deletions(-)

-- 
2.35.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ