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 86665C4167D for ; Fri, 26 Nov 2021 18:25:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241092AbhKZS2R (ORCPT ); Fri, 26 Nov 2021 13:28:17 -0500 Received: from ivanoab7.miniserver.com ([37.128.132.42]:59112 "EHLO www.kot-begemot.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231614AbhKZS0C (ORCPT ); Fri, 26 Nov 2021 13:26:02 -0500 Received: from [192.168.18.6] (helo=jain.kot-begemot.co.uk) by www.kot-begemot.co.uk with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mqfrn-0002RG-Qw; Fri, 26 Nov 2021 18:22:40 +0000 Received: from madding.kot-begemot.co.uk ([192.168.3.98]) by jain.kot-begemot.co.uk with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1mqfri-00637Z-Mx; Fri, 26 Nov 2021 18:22:33 +0000 Subject: Re: [PATCH 4.9] hugetlbfs: flush TLBs correctly after huge_pmd_unshare To: Nadav Amit 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 References: <3BD89231-2CB9-4CE5-B0FA-5B58419D7CB8@gmail.com> <7a2feed4-7c73-c7ad-881e-c980235c8293@cambridgegreys.com> From: Anton Ivanov Organization: Cambridge Greys Message-ID: <5e2db11a-46ac-9b15-7b76-f27b718606c5@cambridgegreys.com> Date: Fri, 26 Nov 2021 18:22:30 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Clacks-Overhead: GNU Terry Pratchett Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org On 26/11/2021 17:49, Nadav Amit wrote: > >> 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. > > Stub will be fine. I was just checking in case I missed something. Brgds, -- Anton R. Ivanov Cambridgegreys Limited. Registered in England. Company Number 10273661 https://www.cambridgegreys.com/ 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 4986CC433F5 for ; Fri, 26 Nov 2021 18:24:23 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qiixcVihRYL4mfKDIOsMPYAhIbGWo4prGnbJwL2zp80=; b=nUaugtQO5/PBOlmWNfM9JFbz8k LsG2gjfAbiGDtVWOl7N9vw3Gccjpq5srXTFpuNJ2u1AHzK6SBXRccUSb/9SBYQc/ETsZ2aEoydZFT ks55rovUYK0pHUGqD7t6toE+o9PxLZYzviWstJxoDzl+i5fHztbSlfcdPdiB3CvCwB/lErEUkA+ck m9YlX6o6Hk2sT9daCczDhLqRKl5VntL5oVccDCX9JpUr/e3phoQibUsV6/INnxYKrpUWwTaHBfkWu eWTlAYjSFBN1fNY1avU/Rla8scxGlJ2y+ZHJ133lkYJZN6PEYMXcGYBUHChAWeX7ApXQwjaMYxNXC lRhVh0lw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqfs1-00BU5m-Vy; Fri, 26 Nov 2021 18:22:50 +0000 Received: from ivanoab7.miniserver.com ([37.128.132.42] helo=www.kot-begemot.co.uk) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqfry-00BU3W-Da; Fri, 26 Nov 2021 18:22:48 +0000 Received: from [192.168.18.6] (helo=jain.kot-begemot.co.uk) by www.kot-begemot.co.uk with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mqfrn-0002RG-Qw; Fri, 26 Nov 2021 18:22:40 +0000 Received: from madding.kot-begemot.co.uk ([192.168.3.98]) by jain.kot-begemot.co.uk with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1mqfri-00637Z-Mx; Fri, 26 Nov 2021 18:22:33 +0000 Subject: Re: [PATCH 4.9] hugetlbfs: flush TLBs correctly after huge_pmd_unshare To: Nadav Amit 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 References: <3BD89231-2CB9-4CE5-B0FA-5B58419D7CB8@gmail.com> <7a2feed4-7c73-c7ad-881e-c980235c8293@cambridgegreys.com> From: Anton Ivanov Organization: Cambridge Greys Message-ID: <5e2db11a-46ac-9b15-7b76-f27b718606c5@cambridgegreys.com> Date: Fri, 26 Nov 2021 18:22:30 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Clacks-Overhead: GNU Terry Pratchett X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211126_102246_500738_8C718CAB X-CRM114-Status: GOOD ( 19.51 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 26/11/2021 17:49, Nadav Amit wrote: > >> 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. > > Stub will be fine. I was just checking in case I missed something. Brgds, -- Anton R. Ivanov Cambridgegreys Limited. Registered in England. Company Number 10273661 https://www.cambridgegreys.com/ _______________________________________________ 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: Subject: Re: [PATCH 4.9] hugetlbfs: flush TLBs correctly after huge_pmd_unshare References: <3BD89231-2CB9-4CE5-B0FA-5B58419D7CB8@gmail.com> <7a2feed4-7c73-c7ad-881e-c980235c8293@cambridgegreys.com> From: Anton Ivanov Message-ID: <5e2db11a-46ac-9b15-7b76-f27b718606c5@cambridgegreys.com> Date: Fri, 26 Nov 2021 18:22:30 +0000 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-um" Errors-To: linux-um-bounces+geert=linux-m68k.org@lists.infradead.org To: Nadav Amit 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 26/11/2021 17:49, Nadav Amit wrote: > >> 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. > > Stub will be fine. I was just checking in case I missed something. Brgds, -- Anton R. Ivanov Cambridgegreys Limited. Registered in England. Company Number 10273661 https://www.cambridgegreys.com/ _______________________________________________ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um