Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2485449rdb; Thu, 21 Sep 2023 23:00:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGrh1zRGTvfKzInTsYyTiXFwH3nUWwCRNoxoAq5ARhJEv9a2gOHtdsFiOiaDbnVlVMopRfo X-Received: by 2002:a05:6358:700f:b0:143:995b:6c27 with SMTP id 15-20020a056358700f00b00143995b6c27mr269898rwo.0.1695362440808; Thu, 21 Sep 2023 23:00:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695362440; cv=none; d=google.com; s=arc-20160816; b=o8ATUwcJ25Yokp524am83+GzH86w6wEcGrieMIasvGMTv0DaFuQRBhZEpFcpCveFbf cd5D7X8wdJvpsVZNhyndcWzqcSmbuHtsbTrNxQTjdCyOMPoosL9BFf+2xceo6NswGorJ cQQeBebqIgTgRYxZRLCldu/Qf0DfL0vnwJcVooQOScIsr+HX4ON8dIlQ+GfkztcXJT2N j4012/otIcQ61mlIVvEufG1f+LjNpIUQE6bK0khAc4r1bHGVDxzmFGrEHM6vlIeha9Nc 9NxIYXoola/mhTfjM5swj6RUl/8u2dfaC3BzZ9QisvPKgJb+OHWQ/MaiFzS7/Bk+Rcic qT5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=ELVvPtLpBggjwwjsyHS/fdpj7bItbiduJJDg7MR2fc8=; fh=cz7Kiv7uBUbxD+CyseTLQSz/SWLsN3GeBJvnIM+faC4=; b=NL1tFaV4DHToWt3bkqEzabut3HWBRc/SxUvZ+u3xsLEnVZ0TYCiCLk+ltMNoWVEjLz +4Ku2w4UwcjOv41JpX+HVUouNMp4hFJxlPqOZAVXxQNB4eKcIFsPmuZnycQme4ccYdYm nvdeGaiW1NP7SBGOMWWdqkQtcO6vzdQAMOElbhpW+5zYcZbroYx/0rcSpbM7RRRh2TBx rPwjtV+xLJAPo9N/rDay5OLYRJxdpyvNLgWG1Hzn+MSecn/1lgu6Trg4CH4BggvrW7V3 louuiDBG9Mq62MAOGGUNhb1qC6WgCAwu6wCbN9LPthpZ/UxEZE6OpcPNUBoWHiu89CWh gb/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=Sy+EhpEK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id w4-20020a634744000000b0057763d820d7si3047849pgk.835.2023.09.21.23.00.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 23:00:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=Sy+EhpEK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 244CB83470DC; Thu, 21 Sep 2023 14:14:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232041AbjIUVNQ (ORCPT + 99 others); Thu, 21 Sep 2023 17:13:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231191AbjIUVMv (ORCPT ); Thu, 21 Sep 2023 17:12:51 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 631B1A9E8; Thu, 21 Sep 2023 10:07:28 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DD95C611AA; Thu, 21 Sep 2023 16:30:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1695313828; bh=Snl0TDHOoq+PcJkslOz6yzyz3jV/ILGMNVGDPT3ALVI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Sy+EhpEKmklRoXizWavrDSv+mOOfZ2nUh7nbNkMhlDLbnh4hSgBtM2DfmKEv4UzUL Pv6q7E7wnTnnSz2jaiJSSK97ktzV1tSKKpfyQ3VEqmLQ/I+fVqkhoc6rt2Al+4iGM9 C9VSqdRkP4rrRuEL9YXgvk8jJTKJGqA4Ygoc1IFE= Date: Thu, 21 Sep 2023 09:30:26 -0700 From: Andrew Morton To: Ryan Roberts Cc: Catalin Marinas , Will Deacon , "James E.J. Bottomley" , Helge Deller , Nicholas Piggin , Christophe Leroy , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Gerald Schaefer , "David S. Miller" , Arnd Bergmann , Mike Kravetz , Muchun Song , SeongJae Park , Uladzislau Rezki , Christoph Hellwig , Lorenzo Stoakes , Anshuman Khandual , Peter Xu , Axel Rasmussen , Qi Zheng , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, linux-mm@kvack.org, stable@vger.kernel.org, Greg Kroah-Hartman Subject: Re: [PATCH v1 0/8] Fix set_huge_pte_at() panic on arm64 Message-Id: <20230921093026.230b2991be551093e397f462@linux-foundation.org> In-Reply-To: <20230921162007.1630149-1-ryan.roberts@arm.com> References: <20230921162007.1630149-1-ryan.roberts@arm.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 21 Sep 2023 14:14:07 -0700 (PDT) On Thu, 21 Sep 2023 17:19:59 +0100 Ryan Roberts wrote: > Hi All, > > This series fixes a bug in arm64's implementation of set_huge_pte_at(), which > can result in an unprivileged user causing a kernel panic. The problem was > triggered when running the new uffd poison mm selftest for HUGETLB memory. This > test (and the uffd poison feature) was merged for v6.6-rc1. However, upon > inspection there are multiple other pre-existing paths that can trigger this > bug. > > Ideally, I'd like to get this fix in for v6.6 if possible? And I guess it should > be backported too, given there are call sites where this can theoretically > happen that pre-date v6.6-rc1 (I've cc'ed stable@vger.kernel.org). This gets you a naggygram from Greg. The way to request a backport is to add cc:stable to all the changelogs. I'll make that change to my copy. > Ryan Roberts (8): > parisc: hugetlb: Convert set_huge_pte_at() to take vma > powerpc: hugetlb: Convert set_huge_pte_at() to take vma > riscv: hugetlb: Convert set_huge_pte_at() to take vma > s390: hugetlb: Convert set_huge_pte_at() to take vma > sparc: hugetlb: Convert set_huge_pte_at() to take vma > mm: hugetlb: Convert set_huge_pte_at() to take vma > arm64: hugetlb: Convert set_huge_pte_at() to take vma > arm64: hugetlb: Fix set_huge_pte_at() to work with all swap entries > > arch/arm64/include/asm/hugetlb.h | 2 +- > arch/arm64/mm/hugetlbpage.c | 22 ++++---------- > arch/parisc/include/asm/hugetlb.h | 2 +- > arch/parisc/mm/hugetlbpage.c | 4 +-- > .../include/asm/nohash/32/hugetlb-8xx.h | 3 +- > arch/powerpc/mm/book3s64/hugetlbpage.c | 2 +- > arch/powerpc/mm/book3s64/radix_hugetlbpage.c | 2 +- > arch/powerpc/mm/nohash/8xx.c | 2 +- > arch/powerpc/mm/pgtable.c | 7 ++++- > arch/riscv/include/asm/hugetlb.h | 2 +- > arch/riscv/mm/hugetlbpage.c | 3 +- > arch/s390/include/asm/hugetlb.h | 8 +++-- > arch/s390/mm/hugetlbpage.c | 8 ++++- > arch/sparc/include/asm/hugetlb.h | 8 +++-- > arch/sparc/mm/hugetlbpage.c | 8 ++++- > include/asm-generic/hugetlb.h | 6 ++-- > include/linux/hugetlb.h | 6 ++-- > mm/damon/vaddr.c | 2 +- > mm/hugetlb.c | 30 +++++++++---------- > mm/migrate.c | 2 +- > mm/rmap.c | 10 +++---- > mm/vmalloc.c | 5 +++- > 22 files changed, 80 insertions(+), 64 deletions(-) Looks scary but it's actually a fairly modest patchset. It could easily be all rolled into a single patch for ease of backporting. Maybe Greg has an opinion?