From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E25D3C433EF for ; Fri, 26 Nov 2021 18:08:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237404AbhKZSMC (ORCPT ); Fri, 26 Nov 2021 13:12:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239010AbhKZSKC (ORCPT ); Fri, 26 Nov 2021 13:10:02 -0500 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3424CC06175A; Fri, 26 Nov 2021 09:49:05 -0800 (PST) Received: by mail-pj1-x1031.google.com with SMTP id gt5so7628434pjb.1; Fri, 26 Nov 2021 09:49:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=83Ooe8dPRyWeyhXmj6GcJq82Gt4gb3ZK5M8zZoiOi6Q=; b=ochLAJ3Tebzo4peAZr1LDip7BLAMFnWXVx8lGWP33dzdz1kWUtWraUbZ4yea+hXub6 gEp1JcVQeKKGGC8fl503t+xIZjfPDx5v0dInww3tJsBHcfgFKuv8+MfUZEnWWB3emNHV 6ju6ae0IWKqbz2hmHU3WzJEukxblaIzjWTGHTfeMeKBBRkaHVLGO79L4NcGTClpWhf+7 pN7VERZShQl1p3VUGiS3t25l1wQZJtFHqDHghMd1idDx4wz9uV1/axtfrzsEbsQpAHCM UGqhdY4PVX1ypkcamBXzVkeutbHd8gx5Sq1Q2ztLTeLXr+s4Yo585ug8GMoCR+MA59WY vr1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=83Ooe8dPRyWeyhXmj6GcJq82Gt4gb3ZK5M8zZoiOi6Q=; b=XbnF44QT5mPfN8GkNomVeqT+xPjOIvxs7KAo94cBnCm7UZO9qJx6oE2bRgDDfMexGT LXQ1Uqgq2S9YHQO6Ie3ok+nL8SU6frGQOUB1W44NNmx8dQg5SMI+EciSaRGnuFHwxSmi KMjAIdPysMngCjGw0l7mI7lWiVD05XFR/yGhc2ZENjypNTBkzTZlObDcTRw1I/Kpdtns syGNAGBWHWV7X7+RCbmxrJ2+pTB5UE3EuOWQWeEffEEyyjQlfY7oqnzZ2jzInvYe0Frd xJJd3jrgaCtcX8EvGR3vm29S0/N7jFR+NnVFqxA7i9MHCefoocZ7loHIwgMqMdKSdlMt 29hQ== X-Gm-Message-State: AOAM532h63OuaAcxrYVB2j5Ia7ZJUJlgab4u88KSdhYeBLRw6QJjDufE n091+lHHGJk8qu7ZyFwrZuc= X-Google-Smtp-Source: ABdhPJwcXwkyAd2pP43UXtFP8PkXixg5BhcHiUdfmXY3aw+C6FVmnnrhz5xOhxUMVxip/s6pkbFtQA== X-Received: by 2002:a17:902:da85:b0:142:11b4:b5c0 with SMTP id j5-20020a170902da8500b0014211b4b5c0mr39890004plx.53.1637948944384; Fri, 26 Nov 2021 09:49:04 -0800 (PST) Received: from smtpclient.apple (c-24-6-216-183.hsd1.ca.comcast.net. [24.6.216.183]) by smtp.gmail.com with ESMTPSA id d7sm8340781pfj.91.2021.11.26.09.49.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Nov 2021 09:49:03 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: [PATCH 4.9] hugetlbfs: flush TLBs correctly after huge_pmd_unshare From: Nadav Amit In-Reply-To: <7a2feed4-7c73-c7ad-881e-c980235c8293@cambridgegreys.com> Date: Fri, 26 Nov 2021 09:49:01 -0800 Cc: Nick Piggin , Peter Zijlstra , Will Deacon , "Aneesh Kumar K.V" , LKML , Linux-MM , linux-s390 , linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, linux-um@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-arch , Mike Kravetz Content-Transfer-Encoding: quoted-printable Message-Id: References: <3BD89231-2CB9-4CE5-B0FA-5B58419D7CB8@gmail.com> <7a2feed4-7c73-c7ad-881e-c980235c8293@cambridgegreys.com> To: Anton Ivanov X-Mailer: Apple Mail (2.3654.120.0.1.13) Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org > On Nov 26, 2021, at 2:21 AM, Anton Ivanov = wrote: >=20 >=20 >=20 > On 26/11/2021 06:08, Nadav Amit wrote: >> Below is a patch to address CVE-2021-4002 [1] that I created to = backport >> to 4.9. The stable kernels of 4.14 and prior ones do not have unified >> TLB flushing code, and I managed to mess up the arch code a couple of >> times. >> Now that the CVE is public, I would appreciate your review of this >> patch. I send 4.9 for review - the other ones (4.14 and prior) are >> pretty similar. >> [1] https://www.openwall.com/lists/oss-security/2021/11/25/1 >> Thanks, >> Nadav >=20 > I do not quite see the rationale for patching um >=20 > It supports only standard size pages. You should not be able to map a = huge page there (and hugetlbfs). >=20 > I have "non-standard page size" somewhere towards the end of my queue, = but it keeps falling through - not enough spare time to work on it. Thanks for your review. I did not look at the dependencies, so I did not even look if hugetlbfs depends on !um. Do you prefer that for um, I will just do a BUG()? I prefer to have a stub just to avoid potential build issues. From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B8385C433EF for ; Fri, 26 Nov 2021 17:50:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:References:Message-Id:Cc:Date: In-Reply-To:From:Subject:Mime-Version:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CEQ9JKrX8FMKci4hCmVg7U40+sVVwGXFTCWHLaXc3aA=; b=uc0UDKxTftON9F M9SdfpE/9qk44NkzeukMTMfHWstiV6lKapxe0V7b3r5M0DecCYWN2cPjaRU+cpdF/NWnXWJWacsUS IVP2d2XTvEO8OKOR49QK3mVsrEzOoODphhO3pvLeJKuaQ1ghdhDXawv07MRpJpgZFXrnXwxz0iwDF lE5SmrvPmLhVuUhjqo7V8TNtNJXK/KwKAPxz6YrAlKu4zWc+gUrzf4zEK5zDt4dys+YIjGf5N7lYS ztwyeJLoOm4qlj2dxg5YBSmUGSELnIp6xlXwUKBOCDeYg1vCgz/PmD7BzZZ9hK5/BWZFlksLNR3CQ 6icyzVxIP52LQpYB+WRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqfLR-00BLCd-Sa; Fri, 26 Nov 2021 17:49:10 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqfLO-00BLBr-4C; Fri, 26 Nov 2021 17:49:07 +0000 Received: by mail-pj1-x1032.google.com with SMTP id o6-20020a17090a0a0600b001a64b9a11aeso8517049pjo.3; Fri, 26 Nov 2021 09:49:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=83Ooe8dPRyWeyhXmj6GcJq82Gt4gb3ZK5M8zZoiOi6Q=; b=ochLAJ3Tebzo4peAZr1LDip7BLAMFnWXVx8lGWP33dzdz1kWUtWraUbZ4yea+hXub6 gEp1JcVQeKKGGC8fl503t+xIZjfPDx5v0dInww3tJsBHcfgFKuv8+MfUZEnWWB3emNHV 6ju6ae0IWKqbz2hmHU3WzJEukxblaIzjWTGHTfeMeKBBRkaHVLGO79L4NcGTClpWhf+7 pN7VERZShQl1p3VUGiS3t25l1wQZJtFHqDHghMd1idDx4wz9uV1/axtfrzsEbsQpAHCM UGqhdY4PVX1ypkcamBXzVkeutbHd8gx5Sq1Q2ztLTeLXr+s4Yo585ug8GMoCR+MA59WY vr1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=83Ooe8dPRyWeyhXmj6GcJq82Gt4gb3ZK5M8zZoiOi6Q=; b=n/NqBwbm3qj+ncmELo+5Krx5k6gT4XWFRfP4ZCGjE2HInLGM3UNSoIRDhCfdtWhgyd EbkJZT/aHX/nnSA9QqK2CyOVmZbkWcYwWW2wiVCVbCKjauNJsl+myszeKZARQz1YzHpw GcvFHrMD5mdZwu1hsPoJPeUzTEFlQ/7v7x92LXqemEyKwoXsOZxqfbL2eMFgA0gpC69+ j2d6RjQxHqBmaJ13kuEKxM6KfpmP+HwDVU8LFKSrD7QZ/PHnheCds+Eenen0OOVRctqB j44iNkG/NUz1nZIDrf+uyPaz7li0Q67weT2mO17mukfR5gmWZxvcFg+WABf3d0IWn4pV AB4A== X-Gm-Message-State: AOAM533gFRdQQZ5SdE1E/XXnolDb38C92T/pLZSLjy3L/v3RtRTf3Wjd SCRUumvhThrb0y0olYMCSTc= X-Google-Smtp-Source: ABdhPJwcXwkyAd2pP43UXtFP8PkXixg5BhcHiUdfmXY3aw+C6FVmnnrhz5xOhxUMVxip/s6pkbFtQA== X-Received: by 2002:a17:902:da85:b0:142:11b4:b5c0 with SMTP id j5-20020a170902da8500b0014211b4b5c0mr39890004plx.53.1637948944384; Fri, 26 Nov 2021 09:49:04 -0800 (PST) Received: from smtpclient.apple (c-24-6-216-183.hsd1.ca.comcast.net. [24.6.216.183]) by smtp.gmail.com with ESMTPSA id d7sm8340781pfj.91.2021.11.26.09.49.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Nov 2021 09:49:03 -0800 (PST) Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: [PATCH 4.9] hugetlbfs: flush TLBs correctly after huge_pmd_unshare From: Nadav Amit In-Reply-To: <7a2feed4-7c73-c7ad-881e-c980235c8293@cambridgegreys.com> Date: Fri, 26 Nov 2021 09:49:01 -0800 Cc: Nick Piggin , Peter Zijlstra , Will Deacon , "Aneesh Kumar K.V" , LKML , Linux-MM , linux-s390 , linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, linux-um@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-arch , Mike Kravetz Message-Id: References: <3BD89231-2CB9-4CE5-B0FA-5B58419D7CB8@gmail.com> <7a2feed4-7c73-c7ad-881e-c980235c8293@cambridgegreys.com> To: Anton Ivanov X-Mailer: Apple Mail (2.3654.120.0.1.13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211126_094906_226210_0D913AE0 X-CRM114-Status: GOOD ( 14.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org > On Nov 26, 2021, at 2:21 AM, Anton Ivanov wrote: > > > > On 26/11/2021 06:08, Nadav Amit wrote: >> Below is a patch to address CVE-2021-4002 [1] that I created to backport >> to 4.9. The stable kernels of 4.14 and prior ones do not have unified >> TLB flushing code, and I managed to mess up the arch code a couple of >> times. >> Now that the CVE is public, I would appreciate your review of this >> patch. I send 4.9 for review - the other ones (4.14 and prior) are >> pretty similar. >> [1] https://www.openwall.com/lists/oss-security/2021/11/25/1 >> Thanks, >> Nadav > > I do not quite see the rationale for patching um > > It supports only standard size pages. You should not be able to map a huge page there (and hugetlbfs). > > I have "non-standard page size" somewhere towards the end of my queue, but it keeps falling through - not enough spare time to work on it. Thanks for your review. I did not look at the dependencies, so I did not even look if hugetlbfs depends on !um. Do you prefer that for um, I will just do a BUG()? I prefer to have a stub just to avoid potential build issues. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: [PATCH 4.9] hugetlbfs: flush TLBs correctly after huge_pmd_unshare From: Nadav Amit In-Reply-To: <7a2feed4-7c73-c7ad-881e-c980235c8293@cambridgegreys.com> Date: Fri, 26 Nov 2021 09:49:01 -0800 Message-Id: References: <3BD89231-2CB9-4CE5-B0FA-5B58419D7CB8@gmail.com> <7a2feed4-7c73-c7ad-881e-c980235c8293@cambridgegreys.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-um" Errors-To: linux-um-bounces+geert=linux-m68k.org@lists.infradead.org To: Anton Ivanov Cc: Nick Piggin , Peter Zijlstra , Will Deacon , "Aneesh Kumar K.V" , LKML , Linux-MM , linux-s390 , linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, linux-um@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-arch , Mike Kravetz > On Nov 26, 2021, at 2:21 AM, Anton Ivanov wrote: > > > > On 26/11/2021 06:08, Nadav Amit wrote: >> Below is a patch to address CVE-2021-4002 [1] that I created to backport >> to 4.9. The stable kernels of 4.14 and prior ones do not have unified >> TLB flushing code, and I managed to mess up the arch code a couple of >> times. >> Now that the CVE is public, I would appreciate your review of this >> patch. I send 4.9 for review - the other ones (4.14 and prior) are >> pretty similar. >> [1] https://www.openwall.com/lists/oss-security/2021/11/25/1 >> Thanks, >> Nadav > > I do not quite see the rationale for patching um > > It supports only standard size pages. You should not be able to map a huge page there (and hugetlbfs). > > I have "non-standard page size" somewhere towards the end of my queue, but it keeps falling through - not enough spare time to work on it. Thanks for your review. I did not look at the dependencies, so I did not even look if hugetlbfs depends on !um. Do you prefer that for um, I will just do a BUG()? I prefer to have a stub just to avoid potential build issues. _______________________________________________ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nadav Amit Date: Fri, 26 Nov 2021 17:49:01 +0000 Subject: Re: [PATCH 4.9] hugetlbfs: flush TLBs correctly after huge_pmd_unshare Message-Id: List-Id: References: <3BD89231-2CB9-4CE5-B0FA-5B58419D7CB8@gmail.com> <7a2feed4-7c73-c7ad-881e-c980235c8293@cambridgegreys.com> In-Reply-To: <7a2feed4-7c73-c7ad-881e-c980235c8293@cambridgegreys.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Anton Ivanov Cc: Nick Piggin , Peter Zijlstra , Will Deacon , "Aneesh Kumar K.V" , LKML , Linux-MM , linux-s390 , linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, linux-um@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-arch , Mike Kravetz > On Nov 26, 2021, at 2:21 AM, Anton Ivanov wrote: > > > > On 26/11/2021 06:08, Nadav Amit wrote: >> Below is a patch to address CVE-2021-4002 [1] that I created to backport >> to 4.9. The stable kernels of 4.14 and prior ones do not have unified >> TLB flushing code, and I managed to mess up the arch code a couple of >> times. >> Now that the CVE is public, I would appreciate your review of this >> patch. I send 4.9 for review - the other ones (4.14 and prior) are >> pretty similar. >> [1] https://www.openwall.com/lists/oss-security/2021/11/25/1 >> Thanks, >> Nadav > > I do not quite see the rationale for patching um > > It supports only standard size pages. You should not be able to map a huge page there (and hugetlbfs). > > I have "non-standard page size" somewhere towards the end of my queue, but it keeps falling through - not enough spare time to work on it. Thanks for your review. I did not look at the dependencies, so I did not even look if hugetlbfs depends on !um. Do you prefer that for um, I will just do a BUG()? I prefer to have a stub just to avoid potential build issues.