From patchwork Sat Feb 26 03:10:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12761182 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2ECEC433F5 for ; Sat, 26 Feb 2022 03:12:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7C2558D0002; Fri, 25 Feb 2022 22:12:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 771768D0001; Fri, 25 Feb 2022 22:12:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 689018D0002; Fri, 25 Feb 2022 22:12:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id 5D15C8D0001 for ; Fri, 25 Feb 2022 22:12:53 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 7FC6C120587 for ; Sat, 26 Feb 2022 03:12:52 +0000 (UTC) X-FDA: 79183458984.03.EE04AC4 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf24.hostedemail.com (Postfix) with ESMTP id DF989180002 for ; Sat, 26 Feb 2022 03:10:55 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E00F761E2C; Sat, 26 Feb 2022 03:10:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47DF8C340E7; Sat, 26 Feb 2022 03:10:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1645845054; bh=9w6nj+vfsclp2nD/Fbt10tUJnWck/t9iRVcxDsSPfMk=; h=Date:To:From:In-Reply-To:Subject:From; b=KPLzSg/OHZq1SXQ6oUZ1MvQqVYcLM/KMLnrxH1iZrSG8YUu1pVg0l9tJtlS6sPuDp nssA4mGNXvl04woSMBjqp7woE1nvhXyENMLPUPAd0iK5Lf8gwBGXWLMjovqXGfmxU1 csINX8wKFWnUWbJA1DEOqZryrJxzxXZluu8cJdCU= Date: Fri, 25 Feb 2022 19:10:53 -0800 To: yzaikin@google.com,sfr@canb.auug.org.au,keescook@chromium.org,mcgrof@kernel.org,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220225191021.f71538a3f43dc448110e88b6@linux-foundation.org> Subject: [patch 01/12] MAINTAINERS: add sysctl-next git tree Message-Id: <20220226031054.47DF8C340E7@smtp.kernel.org> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: DF989180002 X-Rspam-User: Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b="KPLzSg/O"; spf=pass (imf24.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Stat-Signature: z5h9bg5y15ojb3afzajjao5nzca7q87a X-HE-Tag: 1645845055-518422 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Luis Chamberlain Subject: MAINTAINERS: add sysctl-next git tree Add a git tree for sysctls as there's been quite a bit of work lately to remove all the syctls out of kernel/sysctl.c and move to their respective places, so coordination has been needed to avoid conflicts. This tree will also help soak these changes on linux-next prior to getting to Linus. Link: https://lkml.kernel.org/r/20220218182736.3694508-1-mcgrof@kernel.org Signed-off-by: Luis Chamberlain Cc: Kees Cook Cc: Iurii Zaikin Cc: Stephen Rothwell Signed-off-by: Andrew Morton --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) --- a/MAINTAINERS~maintainers-add-sysctl-next-git-tree +++ a/MAINTAINERS @@ -15567,6 +15567,7 @@ M: Iurii Zaikin L: linux-kernel@vger.kernel.org L: linux-fsdevel@vger.kernel.org S: Maintained +T: git git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git sysctl-next F: fs/proc/proc_sysctl.c F: include/linux/sysctl.h F: kernel/sysctl-test.c From patchwork Sat Feb 26 03:10:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12761171 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15DB1C433EF for ; Sat, 26 Feb 2022 03:10:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7EC158D0003; Fri, 25 Feb 2022 22:10:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 79B188D0001; Fri, 25 Feb 2022 22:10:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6B1C28D0003; Fri, 25 Feb 2022 22:10:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0111.hostedemail.com [216.40.44.111]) by kanga.kvack.org (Postfix) with ESMTP id 5D57F8D0001 for ; Fri, 25 Feb 2022 22:10:59 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 19910824C44E for ; Sat, 26 Feb 2022 03:10:59 +0000 (UTC) X-FDA: 79183454238.19.87C0CD6 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf14.hostedemail.com (Postfix) with ESMTP id 952A8100005 for ; Sat, 26 Feb 2022 03:10:58 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EC7BF61E15; Sat, 26 Feb 2022 03:10:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50216C340EF; Sat, 26 Feb 2022 03:10:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1645845057; bh=7LBXFx6hZpq7/9Vwph8v64Zd+qaOv7VE0EtyNFx1bNM=; h=Date:To:From:In-Reply-To:Subject:From; b=TCYtI1hsWqNWQUBifA45nFauFSM/MEuRStP9IYq9LK4iOpv84MGD3B0+3oQz86I0y XrovhGBz5PlYvmE+0mvLtZLGvf3WoSTTgUuTqZjR069u1LXLw5daabojL+feJG0qPG hZI/4JQc+RE41cSPsfoaT9KRNYUdYlrL8/48av0o= Date: Fri, 25 Feb 2022 19:10:56 -0800 To: stable@vger.kernel.org,mike.kravetz@oracle.com,almasrymina@google.com,aneesh.kumar@linux.ibm.com,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220225191021.f71538a3f43dc448110e88b6@linux-foundation.org> Subject: [patch 02/12] mm/hugetlb: fix kernel crash with hugetlb mremap Message-Id: <20220226031057.50216C340EF@smtp.kernel.org> X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 952A8100005 X-Stat-Signature: 38aeps8y9xi3yznkt3q67hiue5ej38re Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=TCYtI1hs; spf=pass (imf14.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-HE-Tag: 1645845058-629380 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: "Aneesh Kumar K.V" Subject: mm/hugetlb: fix kernel crash with hugetlb mremap This fixes the below crash: kernel BUG at include/linux/mm.h:2373! cpu 0x5d: Vector: 700 (Program Check) at [c00000003c6e76e0] pc: c000000000581a54: pmd_to_page+0x54/0x80 lr: c00000000058d184: move_hugetlb_page_tables+0x4e4/0x5b0 sp: c00000003c6e7980 msr: 9000000000029033 current = 0xc00000003bd8d980 paca = 0xc000200fff610100 irqmask: 0x03 irq_happened: 0x01 pid = 9349, comm = hugepage-mremap kernel BUG at include/linux/mm.h:2373! [link register ] c00000000058d184 move_hugetlb_page_tables+0x4e4/0x5b0 [c00000003c6e7980] c00000000058cecc move_hugetlb_page_tables+0x22c/0x5b0 (unreliable) [c00000003c6e7a90] c00000000053b78c move_page_tables+0xdbc/0x1010 [c00000003c6e7bd0] c00000000053bc34 move_vma+0x254/0x5f0 [c00000003c6e7c90] c00000000053c790 sys_mremap+0x7c0/0x900 [c00000003c6e7db0] c00000000002c450 system_call_exception+0x160/0x2c0 the kernel can't use huge_pte_offset before it set the pte entry because a page table lookup check for huge PTE bit in the page table to differentiate between a huge pte entry and a pointer to pte page. A huge_pte_alloc won't mark the page table entry huge and hence kernel should not use huge_pte_offset after a huge_pte_alloc. Link: https://lkml.kernel.org/r/20220211063221.99293-1-aneesh.kumar@linux.ibm.com Fixes: 550a7d60bd5e ("mm, hugepages: add mremap() support for hugepage backed vma") Signed-off-by: Aneesh Kumar K.V Reviewed-by: Mike Kravetz Reviewed-by: Mina Almasry Cc: Signed-off-by: Andrew Morton --- mm/hugetlb.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- a/mm/hugetlb.c~mm-hugetlb-fix-kernel-crash-with-hugetlb-mremap +++ a/mm/hugetlb.c @@ -4851,14 +4851,13 @@ again: } static void move_huge_pte(struct vm_area_struct *vma, unsigned long old_addr, - unsigned long new_addr, pte_t *src_pte) + unsigned long new_addr, pte_t *src_pte, pte_t *dst_pte) { struct hstate *h = hstate_vma(vma); struct mm_struct *mm = vma->vm_mm; - pte_t *dst_pte, pte; spinlock_t *src_ptl, *dst_ptl; + pte_t pte; - dst_pte = huge_pte_offset(mm, new_addr, huge_page_size(h)); dst_ptl = huge_pte_lock(h, mm, dst_pte); src_ptl = huge_pte_lockptr(h, mm, src_pte); @@ -4917,7 +4916,7 @@ int move_hugetlb_page_tables(struct vm_a if (!dst_pte) break; - move_huge_pte(vma, old_addr, new_addr, src_pte); + move_huge_pte(vma, old_addr, new_addr, src_pte, dst_pte); } flush_tlb_range(vma, old_end - len, old_end); mmu_notifier_invalidate_range_end(&range); From patchwork Sat Feb 26 03:10:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12761172 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3748C4332F for ; Sat, 26 Feb 2022 03:11:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 469668D0005; Fri, 25 Feb 2022 22:11:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 418948D0001; Fri, 25 Feb 2022 22:11:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 307E98D0005; Fri, 25 Feb 2022 22:11:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 230178D0001 for ; Fri, 25 Feb 2022 22:11:02 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id DEE3612029B for ; Sat, 26 Feb 2022 03:11:01 +0000 (UTC) X-FDA: 79183454322.09.6DA02C7 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf31.hostedemail.com (Postfix) with ESMTP id 7CF6120003 for ; Sat, 26 Feb 2022 03:11:01 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E1C1761E46; Sat, 26 Feb 2022 03:11:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41776C340EF; Sat, 26 Feb 2022 03:11:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1645845060; bh=bJ4TU+7a6wBfNVLcB0AHPPwgYQneQs7SYC2VFKMeTWk=; h=Date:To:From:In-Reply-To:Subject:From; b=TumeJtX4GZllAAlaadgVkdbIE7NsVTdSoUIXcwnX0Q+5PCKvzDHQ5jnpRIi6NILrO aGavvggMtTa1yrFvsicGodIfdcoASQ90d+Pv+IOqBZz7OMmTtuxK2ZaxoaLKvffOYV btcrKeYP04wVf504jVK9XvfZHCvQRx1MTgjM3zNY= Date: Fri, 25 Feb 2022 19:10:59 -0800 To: ryabinin.a.a@gmail.com,glider@google.com,elver@google.com,dvyukov@google.com,andreyknvl@google.com,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220225191021.f71538a3f43dc448110e88b6@linux-foundation.org> Subject: [patch 03/12] kasan: test: prevent cache merging in kmem_cache_double_destroy Message-Id: <20220226031100.41776C340EF@smtp.kernel.org> X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 7CF6120003 X-Stat-Signature: dx4w6n6wj1dfk4fc3swkmzzkzqheqz4x Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=TumeJtX4; spf=pass (imf31.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-HE-Tag: 1645845061-1720 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Andrey Konovalov Subject: kasan: test: prevent cache merging in kmem_cache_double_destroy With HW_TAGS KASAN and kasan.stacktrace=off, the cache created in the kmem_cache_double_destroy() test might get merged with an existing one. Thus, the first kmem_cache_destroy() call won't actually destroy it but will only decrease the refcount. This causes the test to fail. Provide an empty constructor for the created cache to prevent the cache from getting merged. Link: https://lkml.kernel.org/r/b597bd434c49591d8af00ee3993a42c609dc9a59.1644346040.git.andreyknvl@google.com Fixes: f98f966cd750 ("kasan: test: add test case for double-kmem_cache_destroy()") Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Andrey Ryabinin Signed-off-by: Andrew Morton --- lib/test_kasan.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/lib/test_kasan.c~kasan-test-prevent-cache-merging-in-kmem_cache_double_destroy +++ a/lib/test_kasan.c @@ -869,11 +869,14 @@ static void kmem_cache_invalid_free(stru kmem_cache_destroy(cache); } +static void empty_cache_ctor(void *object) { } + static void kmem_cache_double_destroy(struct kunit *test) { struct kmem_cache *cache; - cache = kmem_cache_create("test_cache", 200, 0, 0, NULL); + /* Provide a constructor to prevent cache merging. */ + cache = kmem_cache_create("test_cache", 200, 0, 0, empty_cache_ctor); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, cache); kmem_cache_destroy(cache); KUNIT_EXPECT_KASAN_FAIL(test, kmem_cache_destroy(cache)); From patchwork Sat Feb 26 03:11:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12761173 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA7A2C433EF for ; Sat, 26 Feb 2022 03:11:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 505A38D0006; Fri, 25 Feb 2022 22:11:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4B4BD8D0001; Fri, 25 Feb 2022 22:11:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3A4118D0006; Fri, 25 Feb 2022 22:11:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 2DE378D0001 for ; Fri, 25 Feb 2022 22:11:05 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 054FC80709 for ; Sat, 26 Feb 2022 03:11:05 +0000 (UTC) X-FDA: 79183454490.14.67DA6BF Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf15.hostedemail.com (Postfix) with ESMTP id 0CC1BA0002 for ; Sat, 26 Feb 2022 03:11:03 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 75E1961E49; Sat, 26 Feb 2022 03:11:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37D84C340E7; Sat, 26 Feb 2022 03:11:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1645845063; bh=NwpuICpm0V8qEMhlsHOVt+1UzXIwqQEEcQj42gz4J88=; h=Date:To:From:In-Reply-To:Subject:From; b=PTb3Pke/oRR+dKf07zJhVHtdD+aLBFWBwReJUQUG4ZcNlaZ9spdEMo2j2asgO1P31 BNAUH4HnQUQ12CL+ur5x/4VhXTnbORDsOzpCdxPd7DJo/mknRrRsSyRj/XKtnLFE52 jdF3DR8uLyAGBYB14okzqazSU0iCibet+SaHladw= Date: Fri, 25 Feb 2022 19:11:02 -0800 To: stable@vger.kernel.org,mike.kravetz@oracle.com,liuyuntao10@huawei.com,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220225191021.f71538a3f43dc448110e88b6@linux-foundation.org> Subject: [patch 04/12] hugetlbfs: fix a truncation issue in hugepages parameter Message-Id: <20220226031103.37D84C340E7@smtp.kernel.org> X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 0CC1BA0002 X-Stat-Signature: jdz6wkjt9omkgxo9ko53m15kosu7z4wn Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b="PTb3Pke/"; spf=pass (imf15.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-HE-Tag: 1645845063-538827 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Liu Yuntao Subject: hugetlbfs: fix a truncation issue in hugepages parameter When we specify a large number for node in hugepages parameter, it may be parsed to another number due to truncation in this statement: node = tmp; For example, add following parameter in command line: hugepagesz=1G hugepages=4294967297:5 and kernel will allocate 5 hugepages for node 1 instead of ignoring it. I move the validation check earlier to fix this issue, and slightly simplifies the condition here. Link: https://lkml.kernel.org/r/20220209134018.8242-1-liuyuntao10@huawei.com Fixes: b5389086ad7be0 ("hugetlbfs: extend the definition of hugepages parameter to support node allocation") Signed-off-by: Liu Yuntao Reviewed-by: Mike Kravetz Cc: Signed-off-by: Andrew Morton --- mm/hugetlb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/mm/hugetlb.c~hugetlbfs-fix-a-truncation-issue-in-hugepages-parameter +++ a/mm/hugetlb.c @@ -4159,10 +4159,10 @@ static int __init hugepages_setup(char * pr_warn("HugeTLB: architecture can't support node specific alloc, ignoring!\n"); return 0; } + if (tmp >= nr_online_nodes) + goto invalid; node = tmp; p += count + 1; - if (node < 0 || node >= nr_online_nodes) - goto invalid; /* Parse hugepages */ if (sscanf(p, "%lu%n", &tmp, &count) != 1) goto invalid; From patchwork Sat Feb 26 03:11:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12761174 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61F15C433FE for ; Sat, 26 Feb 2022 03:11:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 04A758D0007; Fri, 25 Feb 2022 22:11:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F3D2E8D0001; Fri, 25 Feb 2022 22:11:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E2B7F8D0007; Fri, 25 Feb 2022 22:11:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0172.hostedemail.com [216.40.44.172]) by kanga.kvack.org (Postfix) with ESMTP id D56B08D0001 for ; Fri, 25 Feb 2022 22:11:09 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 9E325181D02B0 for ; Sat, 26 Feb 2022 03:11:09 +0000 (UTC) X-FDA: 79183454658.16.7792599 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf31.hostedemail.com (Postfix) with ESMTP id 162B020003 for ; Sat, 26 Feb 2022 03:11:08 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E4303B8340B; Sat, 26 Feb 2022 03:11:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7583FC340EF; Sat, 26 Feb 2022 03:11:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1645845066; bh=vfJjeD6UaeMWHVng8jjExvaUWg885puAEYUfr8nUkAw=; h=Date:To:From:In-Reply-To:Subject:From; b=EJII1OXapn7RuHvP6jdzLMqnTq9Uyh+fZ4x+upCZqM/t0IZ1BskkZKcTOLeDCTJQt uLnVVxkIVmz1T9DYBZtdUjXahnxdkjEYSeRb5VJ33BnMI7TFFB/4l7R26wIbl2uP7V 94DMbhuYtZrJMnUC+M7LyxpdespMYcbwutmJgdrw= Date: Fri, 25 Feb 2022 19:11:05 -0800 To: willy@infradead.org,timmurray@google.com,shy828301@gmail.com,shakeelb@google.com,roman.gushchin@linux.dev,rientjes@google.com,riel@surriel.com,oleg@redhat.com,minchan@kernel.org,mhocko@suse.com,luto@kernel.org,kirill@shutemov.name,jengelh@inai.de,jannh@google.com,hch@infradead.org,hannes@cmpxchg.org,fweimer@redhat.com,david@redhat.com,christian.brauner@ubuntu.com,brauner@kernel.org,aarcange@redhat.com,surenb@google.com,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220225191021.f71538a3f43dc448110e88b6@linux-foundation.org> Subject: [patch 05/12] mm: fix use-after-free bug when mm->mmap is reused after being freed Message-Id: <20220226031106.7583FC340EF@smtp.kernel.org> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 162B020003 X-Rspam-User: Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=EJII1OXa; spf=pass (imf31.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Stat-Signature: 6d5453s8i48cqka95844bz9pf4ywpumy X-HE-Tag: 1645845068-42653 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Suren Baghdasaryan Subject: mm: fix use-after-free bug when mm->mmap is reused after being freed oom reaping (__oom_reap_task_mm) relies on a 2 way synchronization with exit_mmap. First it relies on the mmap_lock to exclude from unlock path[1], page tables tear down (free_pgtables) and vma destruction. This alone is not sufficient because mm->mmap is never reset. For historical reasons[2] the lock is taken there is also MMF_OOM_SKIP set for oom victims before. The oom reaper only ever looks at oom victims so the whole scheme works properly but process_mrelease can opearate on any task (with fatal signals pending) which doesn't really imply oom victims. That means that the MMF_OOM_SKIP part of the synchronization doesn't work and it can see a task after the whole address space has been demolished and traverse an already released mm->mmap list. This leads to use after free as properly caught up by KASAN report. Fix the issue by reseting mm->mmap so that MMF_OOM_SKIP synchronization is not needed anymore. The MMF_OOM_SKIP is not removed from exit_mmap yet but it acts mostly as an optimization now. [1] 27ae357fa82b ("mm, oom: fix concurrent munlock and oom reaper unmap, v3") [2] 212925802454 ("mm: oom: let oom_reap_task and exit_mmap run concurrently") [mhocko@suse.com: changelog rewrite] Link: https://lore.kernel.org/all/00000000000072ef2c05d7f81950@google.com/ Link: https://lkml.kernel.org/r/20220215201922.1908156-1-surenb@google.com Fixes: 64591e8605d6 ("mm: protect free_pgtables with mmap_lock write lock in exit_mmap") Signed-off-by: Suren Baghdasaryan Reported-by: syzbot+2ccf63a4bd07cf39cab0@syzkaller.appspotmail.com Suggested-by: Michal Hocko Reviewed-by: Rik van Riel Reviewed-by: Yang Shi Acked-by: Michal Hocko Cc: David Rientjes Cc: Matthew Wilcox Cc: Johannes Weiner Cc: Roman Gushchin Cc: Rik van Riel Cc: Minchan Kim Cc: Kirill A. Shutemov Cc: Andrea Arcangeli Cc: Christian Brauner Cc: Christoph Hellwig Cc: Oleg Nesterov Cc: David Hildenbrand Cc: Jann Horn Cc: Shakeel Butt Cc: Andy Lutomirski Cc: Christian Brauner Cc: Florian Weimer Cc: Jan Engelhardt Cc: Tim Murray Signed-off-by: Andrew Morton --- mm/mmap.c | 1 + 1 file changed, 1 insertion(+) --- a/mm/mmap.c~mm-fix-use-after-free-bug-when-mm-mmap-is-reused-after-being-freed +++ a/mm/mmap.c @@ -3186,6 +3186,7 @@ void exit_mmap(struct mm_struct *mm) vma = remove_vma(vma); cond_resched(); } + mm->mmap = NULL; mmap_write_unlock(mm); vm_unacct_memory(nr_accounted); } From patchwork Sat Feb 26 03:11:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12761175 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5034EC4332F for ; Sat, 26 Feb 2022 03:11:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E06C88D0008; Fri, 25 Feb 2022 22:11:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DB5568D0001; Fri, 25 Feb 2022 22:11:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CA6DC8D0008; Fri, 25 Feb 2022 22:11:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id BD0A48D0001 for ; Fri, 25 Feb 2022 22:11:11 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 87F6622714 for ; Sat, 26 Feb 2022 03:11:11 +0000 (UTC) X-FDA: 79183454742.12.EE5E1C1 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf03.hostedemail.com (Postfix) with ESMTP id D4C2520002 for ; Sat, 26 Feb 2022 03:11:10 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2BC5161E15; Sat, 26 Feb 2022 03:11:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 863D5C340E7; Sat, 26 Feb 2022 03:11:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1645845069; bh=BguF5wN58fZvbj6eFGEYZh37Exf1NNjtUjhA/8z8YCk=; h=Date:To:From:In-Reply-To:Subject:From; b=UwB47Z5y+qBKb76lQiuRGZ1bILUz4UfgLqdSsJWP0UG42pemuweMx3UM8nUGIJ3Pw xmPiVAqLbLibsNlgllOXcsQe776Lzk3M5B9GznbjppV5oT9Uf6IweNjcEtvTdWyzgO CDD1fOFD7fxN+h3edTfZRKvruPkjPPj/34kSpKgg= Date: Fri, 25 Feb 2022 19:11:08 -0800 To: shuah@kernel.org,mpe@ellerman.id.au,jannh@google.com,aneesh.kumar@linux.ibm.com,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220225191021.f71538a3f43dc448110e88b6@linux-foundation.org> Subject: [patch 06/12] selftest/vm: fix map_fixed_noreplace test failure Message-Id: <20220226031109.863D5C340E7@smtp.kernel.org> X-Rspamd-Queue-Id: D4C2520002 X-Stat-Signature: eericjhrkirzofxsfdjimz6aba3iio6k X-Rspam-User: Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=UwB47Z5y; spf=pass (imf03.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam07 X-HE-Tag: 1645845070-55372 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: "Aneesh Kumar K.V" Subject: selftest/vm: fix map_fixed_noreplace test failure On the latest RHEL the test fails due to executable mapped at 256MB address # ./map_fixed_noreplace mmap() @ 0x10000000-0x10050000 p=0xffffffffffffffff result=File exists 10000000-10010000 r-xp 00000000 fd:04 34905657 /root/rpmbuild/BUILD/kernel-5.14.0-56.el9/linux-5.14.0-56.el9.ppc64le/tools/testing/selftests/vm/map_fixed_noreplace 10010000-10020000 r--p 00000000 fd:04 34905657 /root/rpmbuild/BUILD/kernel-5.14.0-56.el9/linux-5.14.0-56.el9.ppc64le/tools/testing/selftests/vm/map_fixed_noreplace 10020000-10030000 rw-p 00010000 fd:04 34905657 /root/rpmbuild/BUILD/kernel-5.14.0-56.el9/linux-5.14.0-56.el9.ppc64le/tools/testing/selftests/vm/map_fixed_noreplace 10029b90000-10029bc0000 rw-p 00000000 00:00 0 [heap] 7fffbb510000-7fffbb750000 r-xp 00000000 fd:04 24534 /usr/lib64/libc.so.6 7fffbb750000-7fffbb760000 r--p 00230000 fd:04 24534 /usr/lib64/libc.so.6 7fffbb760000-7fffbb770000 rw-p 00240000 fd:04 24534 /usr/lib64/libc.so.6 7fffbb780000-7fffbb7a0000 r--p 00000000 00:00 0 [vvar] 7fffbb7a0000-7fffbb7b0000 r-xp 00000000 00:00 0 [vdso] 7fffbb7b0000-7fffbb800000 r-xp 00000000 fd:04 24514 /usr/lib64/ld64.so.2 7fffbb800000-7fffbb810000 r--p 00040000 fd:04 24514 /usr/lib64/ld64.so.2 7fffbb810000-7fffbb820000 rw-p 00050000 fd:04 24514 /usr/lib64/ld64.so.2 7fffd93f0000-7fffd9420000 rw-p 00000000 00:00 0 [stack] Error: couldn't map the space we need for the test Fix this by finding a free address using mmap instead of hardcoding BASE_ADDRESS. Link: https://lkml.kernel.org/r/20220217083417.373823-1-aneesh.kumar@linux.ibm.com Signed-off-by: Aneesh Kumar K.V Cc: Michael Ellerman Cc: Jann Horn Cc: Shuah Khan Signed-off-by: Andrew Morton --- tools/testing/selftests/vm/map_fixed_noreplace.c | 49 +++++++++---- 1 file changed, 37 insertions(+), 12 deletions(-) --- a/tools/testing/selftests/vm/map_fixed_noreplace.c~selftest-vm-fix-map_fixed_noreplace-test-failure +++ a/tools/testing/selftests/vm/map_fixed_noreplace.c @@ -17,9 +17,6 @@ #define MAP_FIXED_NOREPLACE 0x100000 #endif -#define BASE_ADDRESS (256ul * 1024 * 1024) - - static void dump_maps(void) { char cmd[32]; @@ -28,18 +25,46 @@ static void dump_maps(void) system(cmd); } +static unsigned long find_base_addr(unsigned long size) +{ + void *addr; + unsigned long flags; + + flags = MAP_PRIVATE | MAP_ANONYMOUS; + addr = mmap(NULL, size, PROT_NONE, flags, -1, 0); + if (addr == MAP_FAILED) { + printf("Error: couldn't map the space we need for the test\n"); + return 0; + } + + if (munmap(addr, size) != 0) { + printf("Error: couldn't map the space we need for the test\n"); + return 0; + } + return (unsigned long)addr; +} + int main(void) { + unsigned long base_addr; unsigned long flags, addr, size, page_size; char *p; page_size = sysconf(_SC_PAGE_SIZE); + //let's find a base addr that is free before we start the tests + size = 5 * page_size; + base_addr = find_base_addr(size); + if (!base_addr) { + printf("Error: couldn't map the space we need for the test\n"); + return 1; + } + flags = MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED_NOREPLACE; // Check we can map all the areas we need below errno = 0; - addr = BASE_ADDRESS; + addr = base_addr; size = 5 * page_size; p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0); @@ -60,7 +85,7 @@ int main(void) printf("unmap() successful\n"); errno = 0; - addr = BASE_ADDRESS + page_size; + addr = base_addr + page_size; size = 3 * page_size; p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0); printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); @@ -80,7 +105,7 @@ int main(void) * +4 | free | new */ errno = 0; - addr = BASE_ADDRESS; + addr = base_addr; size = 5 * page_size; p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0); printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); @@ -101,7 +126,7 @@ int main(void) * +4 | free | */ errno = 0; - addr = BASE_ADDRESS + (2 * page_size); + addr = base_addr + (2 * page_size); size = page_size; p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0); printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); @@ -121,7 +146,7 @@ int main(void) * +4 | free | new */ errno = 0; - addr = BASE_ADDRESS + (3 * page_size); + addr = base_addr + (3 * page_size); size = 2 * page_size; p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0); printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); @@ -141,7 +166,7 @@ int main(void) * +4 | free | */ errno = 0; - addr = BASE_ADDRESS; + addr = base_addr; size = 2 * page_size; p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0); printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); @@ -161,7 +186,7 @@ int main(void) * +4 | free | */ errno = 0; - addr = BASE_ADDRESS; + addr = base_addr; size = page_size; p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0); printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); @@ -181,7 +206,7 @@ int main(void) * +4 | free | new */ errno = 0; - addr = BASE_ADDRESS + (4 * page_size); + addr = base_addr + (4 * page_size); size = page_size; p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0); printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); @@ -192,7 +217,7 @@ int main(void) return 1; } - addr = BASE_ADDRESS; + addr = base_addr; size = 5 * page_size; if (munmap((void *)addr, size) != 0) { dump_maps(); From patchwork Sat Feb 26 03:11:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12761176 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F2A3C433F5 for ; Sat, 26 Feb 2022 03:11:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 294D98D0009; Fri, 25 Feb 2022 22:11:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 243328D0001; Fri, 25 Feb 2022 22:11:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 132978D0009; Fri, 25 Feb 2022 22:11:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0212.hostedemail.com [216.40.44.212]) by kanga.kvack.org (Postfix) with ESMTP id 049098D0001 for ; Fri, 25 Feb 2022 22:11:16 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id B1FA9181D02B0 for ; Sat, 26 Feb 2022 03:11:15 +0000 (UTC) X-FDA: 79183454910.20.2452F69 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf17.hostedemail.com (Postfix) with ESMTP id 3CF9C40004 for ; Sat, 26 Feb 2022 03:11:15 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D89E4B833C6; Sat, 26 Feb 2022 03:11:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CEF1C340EF; Sat, 26 Feb 2022 03:11:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1645845072; bh=qT1gFEKHfDvEQPef2tMFv7/sOYoIBCgAaeddDX7B284=; h=Date:To:From:In-Reply-To:Subject:From; b=ZCu8u2M6IubbLXmwHt/8t2rNtWL8/Mu9STOknx1pjDE0o9uDXOA7TRY5oAJWpgEoC unfdjAOX/2S7aQIeobIHJ68tefDnZyVDSo7X5JArrKWMoIl9+4sBDL2oOFQmdavhZg HGGIUVtp7bhMUhBqLdT7h1M0gG3VcRXc8KIyyh1k= Date: Fri, 25 Feb 2022 19:11:11 -0800 To: vdavydov.dev@gmail.com,vbabka@suse.cz,mhocko@suse.com,hannes@cmpxchg.org,roman.gushchin@linux.dev,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220225191021.f71538a3f43dc448110e88b6@linux-foundation.org> Subject: [patch 07/12] MAINTAINERS: add Roman as a memcg co-maintainer Message-Id: <20220226031112.6CEF1C340EF@smtp.kernel.org> X-Rspamd-Server: rspam10 X-Rspam-User: X-Stat-Signature: jft835yaqqj6sh4amfkucmbhekywacni Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=ZCu8u2M6; spf=pass (imf17.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Queue-Id: 3CF9C40004 X-HE-Tag: 1645845075-96790 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Roman Gushchin Subject: MAINTAINERS: add Roman as a memcg co-maintainer Add myself as a memcg co-maintainer. My primary focus over last few years was the kernel memory accounting stack, but I do work on some other parts of the memory controller as well. Link: https://lkml.kernel.org/r/20220221233951.659048-1-roman.gushchin@linux.dev Signed-off-by: Roman Gushchin Acked-by: Michal Hocko Acked-by: Johannes Weiner Acked-by: Vlastimil Babka Cc: Vladimir Davydov Signed-off-by: Andrew Morton --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) --- a/MAINTAINERS~maintainers-add-myself-as-a-memcg-co-maintainer +++ a/MAINTAINERS @@ -4914,6 +4914,7 @@ CONTROL GROUP - MEMORY RESOURCE CONTROLL M: Johannes Weiner M: Michal Hocko M: Vladimir Davydov +M: Roman Gushchin L: cgroups@vger.kernel.org L: linux-mm@kvack.org S: Maintained From patchwork Sat Feb 26 03:11:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12761177 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C45B1C433EF for ; Sat, 26 Feb 2022 03:11:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1D3138D000A; Fri, 25 Feb 2022 22:11:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1805F8D0001; Fri, 25 Feb 2022 22:11:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0478E8D000A; Fri, 25 Feb 2022 22:11:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0065.hostedemail.com [216.40.44.65]) by kanga.kvack.org (Postfix) with ESMTP id EBDE48D0001 for ; Fri, 25 Feb 2022 22:11:16 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 9A732181D3042 for ; Sat, 26 Feb 2022 03:11:16 +0000 (UTC) X-FDA: 79183454952.16.9345A29 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf14.hostedemail.com (Postfix) with ESMTP id 3B65B100003 for ; Sat, 26 Feb 2022 03:11:16 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9A36861E3F; Sat, 26 Feb 2022 03:11:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5EF43C340E7; Sat, 26 Feb 2022 03:11:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1645845075; bh=xUi79h8rf32yrZB0YMagwcrqpugxUeAoZLxduOk3zjA=; h=Date:To:From:In-Reply-To:Subject:From; b=VCSHjWnuHN0mGQQgzOBQct7HXk1gfKOaBEI6Yx6U7Vv36yDvjrAvkJEelBaSPX0B9 GYW4WdOKNIJpiWhqrB988oSnWwV5gavsvhA3U79NJB8agRuvTRf2XOpWTWr2DzMPpI ZVtDfb5VTVm52wEIto8r6bwM5fWPS1WJtHIykQi8= Date: Fri, 25 Feb 2022 19:11:14 -0800 To: roman.gushchin@linux.dev,mhocko@suse.com,hannes@cmpxchg.org,vdavydov.dev@gmail.com,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220225191021.f71538a3f43dc448110e88b6@linux-foundation.org> Subject: [patch 08/12] MAINTAINERS: remove Vladimir from memcg maintainers Message-Id: <20220226031115.5EF43C340E7@smtp.kernel.org> X-Rspamd-Queue-Id: 3B65B100003 X-Stat-Signature: rumdjp3dgok3x9pfwc1pk6eu9wf4hkhx X-Rspam-User: Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=VCSHjWnu; spf=pass (imf14.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam07 X-HE-Tag: 1645845076-660973 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Vladimir Davydov Subject: MAINTAINERS: remove Vladimir from memcg maintainers Link: https://lkml.kernel.org/r/4ad1f8da49d7b71c84a0c15bd5347f5ce704e730.1645608825.git.vdavydov.dev@gmail.com Signed-off-by: Vladimir Davydov Acked-by: Johannes Weiner Acked-by: Michal Hocko Cc: Roman Gushchin Signed-off-by: Andrew Morton --- MAINTAINERS | 1 - 1 file changed, 1 deletion(-) --- a/MAINTAINERS~maintainers-remove-myself-from-memcg-maintainers +++ a/MAINTAINERS @@ -4913,7 +4913,6 @@ F: kernel/cgroup/cpuset.c CONTROL GROUP - MEMORY RESOURCE CONTROLLER (MEMCG) M: Johannes Weiner M: Michal Hocko -M: Vladimir Davydov M: Roman Gushchin L: cgroups@vger.kernel.org L: linux-mm@kvack.org From patchwork Sat Feb 26 03:11:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12761178 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D392C433F5 for ; Sat, 26 Feb 2022 03:11:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3CE118D000B; Fri, 25 Feb 2022 22:11:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 37B7A8D0001; Fri, 25 Feb 2022 22:11:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 295628D000B; Fri, 25 Feb 2022 22:11:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id 190DA8D0001 for ; Fri, 25 Feb 2022 22:11:20 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id EB1B5204DC for ; Sat, 26 Feb 2022 03:11:19 +0000 (UTC) X-FDA: 79183455078.10.7C1D2CB Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf17.hostedemail.com (Postfix) with ESMTP id 877A340002 for ; Sat, 26 Feb 2022 03:11:19 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EDE6A61E3F; Sat, 26 Feb 2022 03:11:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50D1BC36AE7; Sat, 26 Feb 2022 03:11:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1645845078; bh=37yVslau23+pEANbG7vpT44TEzPPTAW+HLL06jOs60w=; h=Date:To:From:In-Reply-To:Subject:From; b=eWKMy4k9rsCx2zf+ywlgsJRFOAaMYtt24fcbozY+kZTy0UXDpJcGx2U5u+yDiqJMm FW+6IRzzu6L283Ep02weLsiCRqJEi21A+Th9ouQRkhhqQnSd5Bst+dfXHn2oWiVOYG ZahK4OC0JQZpUxlXMShceAJl0USODHyoiqxmJulM= Date: Fri, 25 Feb 2022 19:11:17 -0800 To: roman.gushchin@linux.dev,mhocko@suse.com,hannes@cmpxchg.org,shakeelb@google.com,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220225191021.f71538a3f43dc448110e88b6@linux-foundation.org> Subject: [patch 09/12] MAINTAINERS: add Shakeel as a memcg co-maintainer Message-Id: <20220226031118.50D1BC36AE7@smtp.kernel.org> X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 877A340002 X-Rspam-User: Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=eWKMy4k9; dmarc=none; spf=pass (imf17.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Stat-Signature: ck9dn4jztc698t1b95qm1b87yfcbdh5n X-HE-Tag: 1645845079-78730 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Shakeel Butt Subject: MAINTAINERS: add Shakeel as a memcg co-maintainer I have been contributing and reviewing to the memcg codebase for last couple of years. So, making it official. Link: https://lkml.kernel.org/r/20220224060148.4092228-1-shakeelb@google.com Signed-off-by: Shakeel Butt Acked-by: Roman Gushchin Acked-by: Michal Hocko Cc: Johannes Weiner Signed-off-by: Andrew Morton --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) --- a/MAINTAINERS~maintainers-add-myself-as-a-memcg-co-maintainer-as-well +++ a/MAINTAINERS @@ -4914,6 +4914,7 @@ CONTROL GROUP - MEMORY RESOURCE CONTROLL M: Johannes Weiner M: Michal Hocko M: Roman Gushchin +M: Shakeel Butt L: cgroups@vger.kernel.org L: linux-mm@kvack.org S: Maintained From patchwork Sat Feb 26 03:11:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12761179 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 306F8C433F5 for ; Sat, 26 Feb 2022 03:11:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C585E8D000C; Fri, 25 Feb 2022 22:11:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C07628D0001; Fri, 25 Feb 2022 22:11:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B459E8D000C; Fri, 25 Feb 2022 22:11:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id A74D68D0001 for ; Fri, 25 Feb 2022 22:11:24 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 86134204DC for ; Sat, 26 Feb 2022 03:11:24 +0000 (UTC) X-FDA: 79183455288.08.0B3978A Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf10.hostedemail.com (Postfix) with ESMTP id 0772EC0003 for ; Sat, 26 Feb 2022 03:11:23 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C3EAEB8340B; Sat, 26 Feb 2022 03:11:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50752C340F1; Sat, 26 Feb 2022 03:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1645845081; bh=TpqGmpDe388CnUnPRivcHgWWsh5Jjhc4XanNCmHWYso=; h=Date:To:From:In-Reply-To:Subject:From; b=jg/7R5ZdNnfP52BcrIsBfcUm0xNAj+AW06YF4qV/x/m69qmEfwJHuagJJ6sXMi901 pS5k0etZfGqz1ug7iBO6ttYIgnA3dWsOlHBNEo7T3aMFExHkynRPf+lCqyDkqhWBHH zhhgKm8LcOEcpVPdiepE/VmH9ljXxX10ZT5DDRJI= Date: Fri, 25 Feb 2022 19:11:20 -0800 To: roman.gushchin@linux.dev,rientjes@google.com,penberg@kernel.org,iamjoonsoo.kim@lge.com,cl@linux.com,vbabka@suse.cz,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220225191021.f71538a3f43dc448110e88b6@linux-foundation.org> Subject: [patch 10/12] MAINTAINERS, SLAB: add Roman as reviewer, git tree Message-Id: <20220226031121.50752C340F1@smtp.kernel.org> X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 0772EC0003 X-Rspam-User: Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b="jg/7R5Zd"; dmarc=none; spf=pass (imf10.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Stat-Signature: 5711uo9e4bxj4zwxduausgf3gbq87rhp X-HE-Tag: 1645845083-495068 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Vlastimil Babka Subject: MAINTAINERS, SLAB: add Roman as reviewer, git tree The slab code has an overlap with kmem accounting, where Roman has done a lot of work recently and it would be useful to make sure he's CC'd on patches that potentially affect it. Thus add him as a reviewer for the SLAB subsystem. Also while at it, add the link to slab git tree. Link: https://lkml.kernel.org/r/20220222103104.13241-1-vbabka@suse.cz Signed-off-by: Vlastimil Babka Acked-by: David Rientjes Acked-by: Roman Gushchin Cc: Christoph Lameter Cc: Pekka Enberg Cc: Joonsoo Kim Signed-off-by: Andrew Morton --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) --- a/MAINTAINERS~maintainers-slab-add-roman-as-reviewer-git-tree +++ a/MAINTAINERS @@ -17762,8 +17762,10 @@ M: David Rientjes M: Joonsoo Kim M: Andrew Morton M: Vlastimil Babka +R: Roman Gushchin L: linux-mm@kvack.org S: Maintained +T: git git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab.git F: include/linux/sl?b*.h F: mm/sl?b* From patchwork Sat Feb 26 03:11:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12761181 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 544DAC4332F for ; Sat, 26 Feb 2022 03:11:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E54538D000E; Fri, 25 Feb 2022 22:11:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E03B28D0001; Fri, 25 Feb 2022 22:11:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CCB758D000E; Fri, 25 Feb 2022 22:11:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0033.hostedemail.com [216.40.44.33]) by kanga.kvack.org (Postfix) with ESMTP id BE37E8D0001 for ; Fri, 25 Feb 2022 22:11:30 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 878B018206D37 for ; Sat, 26 Feb 2022 03:11:30 +0000 (UTC) X-FDA: 79183455540.17.A0FB10C Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf12.hostedemail.com (Postfix) with ESMTP id E1AC940004 for ; Sat, 26 Feb 2022 03:11:29 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id CD7F5CE2810; Sat, 26 Feb 2022 03:11:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 344C9C340EF; Sat, 26 Feb 2022 03:11:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1645845084; bh=s6iAYLcuzM2MgwUihUzs7tOHjdYXM3CRLZ/K6F63AdE=; h=Date:To:From:In-Reply-To:Subject:From; b=2JGJC24L5NlTvYKKGHS5nxiKFj4ojfQdLSjvz/iUggqrhQFwpYZJGzKbVo42SMGoo t1PfInZvq9bv+qD15LQvnL38uG4ckA13alruxtJrAWNou5FPMI2wqTZy88EJDcqR+A b4IRmXonPDG59sJMO5+LzB3DHHdhjeX4ASfpJjBU= Date: Fri, 25 Feb 2022 19:11:23 -0800 To: roman.gushchin@linux.dev,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220225191021.f71538a3f43dc448110e88b6@linux-foundation.org> Subject: [patch 11/12] mailmap: update Roman Gushchin's email Message-Id: <20220226031124.344C9C340EF@smtp.kernel.org> X-Rspamd-Server: rspam10 X-Rspam-User: X-Stat-Signature: ch5isdirappg7cub5aaud7ph6zc3dyeu Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=2JGJC24L; spf=pass (imf12.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Queue-Id: E1AC940004 X-HE-Tag: 1645845089-522968 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Roman Gushchin Subject: mailmap: update Roman Gushchin's email I'm moving to a @linux.dev account. Map my old addresses. Link: https://lkml.kernel.org/r/20220221200006.416377-1-roman.gushchin@linux.dev Signed-off-by: Roman Gushchin Signed-off-by: Andrew Morton --- .mailmap | 3 +++ 1 file changed, 3 insertions(+) --- a/.mailmap~mailmap-update-roman-gushchins-email +++ a/.mailmap @@ -333,6 +333,9 @@ RĂ©mi Denis-Courmont Ricardo Ribalda Ricardo Ribalda Delgado Ricardo Ribalda +Roman Gushchin +Roman Gushchin +Roman Gushchin Ross Zwisler Rudolf Marek Rui Saraiva From patchwork Sat Feb 26 03:11:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12761180 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE497C433EF for ; Sat, 26 Feb 2022 03:11:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4DE278D000D; Fri, 25 Feb 2022 22:11:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 48D3F8D0001; Fri, 25 Feb 2022 22:11:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 37C528D000D; Fri, 25 Feb 2022 22:11:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 2976E8D0001 for ; Fri, 25 Feb 2022 22:11:29 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id E41B89CD43 for ; Sat, 26 Feb 2022 03:11:28 +0000 (UTC) X-FDA: 79183455456.17.A3682E8 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf12.hostedemail.com (Postfix) with ESMTP id 78B1A40004 for ; Sat, 26 Feb 2022 03:11:28 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D8E3F61E15; Sat, 26 Feb 2022 03:11:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 424C0C340EF; Sat, 26 Feb 2022 03:11:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1645845087; bh=W3P5l/SyI4KFIXMVfsva+hVRh5NGYVo7KLQvUoPp0mM=; h=Date:To:From:In-Reply-To:Subject:From; b=d9WWMCqNnphPiA9rdvBZ5V9522Pbost2zJYUnApl7gESmG/CkTpJ2JTlht8zN8+Hg eiYIjPqdQZrmXZl1oRE3tjI2xqdoxgnJiWFEU+7Ts+CyzJ1TWpk2Xq1twNrA1qgl7v 33pBXQSo2ZJ6NVinBzDRii2U9Tk9Z7yAvfCQ0Z/A= Date: Fri, 25 Feb 2022 19:11:26 -0800 To: shuah@kernel.org,joel@joelfernandes.org,mike.kravetz@oracle.com,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220225191021.f71538a3f43dc448110e88b6@linux-foundation.org> Subject: [patch 12/12] selftests/memfd: clean up mapping in mfd_fail_write Message-Id: <20220226031127.424C0C340EF@smtp.kernel.org> X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 78B1A40004 X-Stat-Signature: rw9mqkycmn9r6tooxnz9ent1kzusb6aw Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=d9WWMCqN; spf=pass (imf12.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-HE-Tag: 1645845088-300226 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Mike Kravetz Subject: selftests/memfd: clean up mapping in mfd_fail_write Running the memfd script ./run_hugetlbfs_test.sh will often end in error as follows: memfd-hugetlb: CREATE memfd-hugetlb: BASIC memfd-hugetlb: SEAL-WRITE memfd-hugetlb: SEAL-FUTURE-WRITE memfd-hugetlb: SEAL-SHRINK fallocate(ALLOC) failed: No space left on device ./run_hugetlbfs_test.sh: line 60: 166855 Aborted (core dumped) ./memfd_test hugetlbfs opening: ./mnt/memfd fuse: DONE If no hugetlb pages have been preallocated, run_hugetlbfs_test.sh will allocate 'just enough' pages to run the test. In the SEAL-FUTURE-WRITE test the mfd_fail_write routine maps the file, but does not unmap. As a result, two hugetlb pages remain reserved for the mapping. When the fallocate call in the SEAL-SHRINK test attempts allocate all hugetlb pages, it is short by the two reserved pages. Fix by making sure to unmap in mfd_fail_write. Link: https://lkml.kernel.org/r/20220219004340.56478-1-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Cc: Joel Fernandes Cc: Shuah Khan Signed-off-by: Andrew Morton --- tools/testing/selftests/memfd/memfd_test.c | 1 + 1 file changed, 1 insertion(+) --- a/tools/testing/selftests/memfd/memfd_test.c~selftests-memfd-clean-up-mapping-in-mfd_fail_write +++ a/tools/testing/selftests/memfd/memfd_test.c @@ -455,6 +455,7 @@ static void mfd_fail_write(int fd) printf("mmap()+mprotect() didn't fail as expected\n"); abort(); } + munmap(p, mfd_def_size); } /* verify PUNCH_HOLE fails */