Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1574760rwb; Fri, 23 Sep 2022 15:04:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6knAFMqjY+9BaorzflUKf6om2wZzNLsQldv6IoOJLWvQtqp7mC7PWizKlXJKydBgH8xV5j X-Received: by 2002:a17:907:7610:b0:77c:b7a:9fb2 with SMTP id jx16-20020a170907761000b0077c0b7a9fb2mr8579324ejc.468.1663970689777; Fri, 23 Sep 2022 15:04:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663970689; cv=none; d=google.com; s=arc-20160816; b=NNZ6EfSMXqu7dlTNgIMOV4KEPKEXpNJw6TKiPEHDiIABsopoD2rOjgcM2p+E9rRAMN TRbXlBgbrVvkOF3Ra8IukcNP+s38AdLd0n+712p9RVBoC/bMBjmM4JOt3CtkpnUJAJu3 Kq89CiGcp2aFJtqAqpefK5ycwpPrO1NXBxdvp1OB0Rk3glGq+nG+8MnZjTnXTr5mc2R2 UTGeOmbk611PccHKolxWxo+MsIGZsNmIPUIr6ABUyQpDBh8g1/JCADVmKGl/5TolL8Ry xsxl1LPhNxCdcOYE8YlgQNqgc+x64Qew4vXYhiBlKZ/R8YmBY13QsBJOm/43yD/x8Ro4 gm5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ZnB23LLp/vlB+ryCWR3RfzNeLIOvdyceafUVjogXEh8=; b=lXQHlcf2Qi68bWOrwyHO4+WAqmiTl2/d/bkt+yB4/AKUH5pxZXFLOXTPAMcFdaQj1b mVnz1Gp+1gntBc4CtcPpw6lhEE/4pE4JUJ++s4+8GcFPCTqQcUDgdL7WNtUw0z0gBm75 1F1F6usYlZX1705R3a/7fWC1GaUq2rnJpo02IN+Ggpw78ycezhTOu3X5yNtWu/ozmE+u s2mKaarXznKeUcMSOWNT+t8H7e98adwYnofC+ExqGoD00zGW4A8AEYUzw8XXodLXptnJ 7HvbQkdBZ6iBdW9KwdVZZ+q7qqdYCuaiZf3x4Fyk8Ki99lOyiBKNs6um3TK7znypMRrC YpoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Y0ehwZOs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bm7-20020a0564020b0700b00456e3092e6dsi1088280edb.319.2022.09.23.15.04.24; Fri, 23 Sep 2022 15:04:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Y0ehwZOs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229495AbiIWVTu (ORCPT + 99 others); Fri, 23 Sep 2022 17:19:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232578AbiIWVTr (ORCPT ); Fri, 23 Sep 2022 17:19:47 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BF8C27FDA for ; Fri, 23 Sep 2022 14:19:45 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id d11so1257093pll.8 for ; Fri, 23 Sep 2022 14:19:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=ZnB23LLp/vlB+ryCWR3RfzNeLIOvdyceafUVjogXEh8=; b=Y0ehwZOs+7K7MVGIhod7Oz82juhcilJsd4wl7E7yhwCNzs0m2pNmp9XEEfoPUh6mNC rOHJpV9AYYiNrGQgNITm72gcxDBIDDUvag8cZ/PJV24RhHG7n7IWH65/OiySYH0R6YLB LMZVh3V1mGG6AIVleW4VIPVY6lhqB3r4vbsz8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=ZnB23LLp/vlB+ryCWR3RfzNeLIOvdyceafUVjogXEh8=; b=IuiVfNUr7PoLHp8HQ4Qmj+wz6b1ar6Fg1q8yMzNLUVEcrzy5y3l+qGd6/tHIbkmOT8 4PjQMFXCTXn+hpYNpWTOZwQQo/gaKKlGdUc5Z2kEjGk699948xrvcDcl8xdzbu2Io4yD aZ7L+ApzQr7UUZ9YtiFto+GzqSMyp4DhPNRdGk0KWwmPrQezc3Dnp/3bcVhmdvZ6mq5v ZvI/XcTPSrmknLrjWCiVmv6JQaYHG302MU9Teg6KZrYo818P6Ocba/W6IFLX5oB/iCiv LEFDgqyOWLgpjtxHwLlO6F93EDmBQ2PMmZKj60h/2DsnFLOEmG4N1rm0ygRCYv3kG8pk semw== X-Gm-Message-State: ACrzQf18zWStAyiqfBQ3+aukwKpoZwnZD9pRpzG0G0w13nMf3PTRyTvH yTznCrNspnCBRCcdcyzg6Rj1Uw== X-Received: by 2002:a17:90b:1bc3:b0:203:84d:59b1 with SMTP id oa3-20020a17090b1bc300b00203084d59b1mr23683457pjb.37.1663967984643; Fri, 23 Sep 2022 14:19:44 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id q12-20020a170902eb8c00b0016dbe37cebdsm6230493plg.246.2022.09.23.14.19.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Sep 2022 14:19:43 -0700 (PDT) Date: Fri, 23 Sep 2022 14:19:43 -0700 From: Kees Cook To: Ard Biesheuvel Cc: Guenter Roeck , Peter Zijlstra , Dave Hansen , linux-kernel@vger.kernel.org, Darren Hart , Andy Shevchenko , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, linux-efi@vger.kernel.org, "H. Peter Anvin" Subject: Re: [PATCH] x86/mm+efi: Avoid creating W+X mappings Message-ID: <202209231417.F73F40060@keescook> References: <08906193-246b-c874-8bac-1d98d2313ac4@roeck-us.net> <20220922193157.1673623-1-dave.hansen@linux.intel.com> <5f443915-b38a-c78d-cccd-876501434cef@roeck-us.net> <202209231126.6855D54@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 23, 2022 at 09:53:02PM +0200, Ard Biesheuvel wrote: > On Fri, 23 Sept 2022 at 20:31, Kees Cook wrote: > > > > On Fri, Sep 23, 2022 at 04:26:58PM +0200, Ard Biesheuvel wrote: > > > I was basically making the point that we still support i386 without > > > PAE (which is a prerequisite for supporting non-executable mappings), > > > and if we are going to be pedantic about security on this > > > architecture, we should probably make PAE mandatory as well. > > > > My expectation would be that if someone is running modern kernels on i386, > > they're not using PAE. If they care about PAE, I'd expect them to have > > long since moved to x86_64. > > > > Not sure I follow. If they care about PAE, they turn it on. Or do you > mean 'if they care about being able to address lots of physical > memory'? Because the *other* reason you might care about PAE is > because it gives you NX support. Right, I meant if they care about NX (and the topic of this thread) they want PAE, and if they want PAE, they likely moved to x86_64 long long ago for new kernels. > But currently, PAE is not even enabled in the i386_defconfig, and > defaults to off. This means people that are unaware of this won't > enable it, and will be running without NX support. And they all make me cry. ;) > > > If we are ok with the current state, enabling this permission check on > > > i386 makes no sense. > > > > I'd agree. If it's a choice between "spend a lot of time making sure > > this works correctly on i386" and "don't do this at all on i386", I > > would pick the latter. If someone steps up to do the former, then by > > all means take the patches. > > > > OK, so it seems we're all in violent agreement here. And if there is > ever a push for enabling security features on 32-bit, we can add this > to the laundry list of things that need to be looked at. Yup. -- Kees Cook