Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2161115rdb; Tue, 3 Oct 2023 12:07:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEu461fQ4vxKZB7mOtPDsYmOJ4d/F7uA/wIhYAuZBcmwLUf1uMJqyi9vwnfILmwHVHqo1i1 X-Received: by 2002:a05:6a20:2583:b0:159:b4ba:a5bf with SMTP id k3-20020a056a20258300b00159b4baa5bfmr409032pzd.13.1696360035779; Tue, 03 Oct 2023 12:07:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696360035; cv=none; d=google.com; s=arc-20160816; b=QnbgqKflrR7wZsgwLX0ewbSV1u1JIQKbNzTfVQcKUQ768AeuuBCH5I2448YJSkLpc1 cpiB1WCtu/9hnQnW5DeBPvpUMRfnL7Ye2DykP07xv1pxb7M5R7AMVNAiDtGF8Q3U9sYR aNW6w6yLPhSVLewMXPuSHIuLHf/NF6GrzXSiOnF6Mzs4jQEeaEQDKZ/8prdu3BPlY9jb OvSHLsoswHsgYm6ZuLQOEydNnfKO4KYJPlhxnsTOo678iOjojRpc7TZxEThOBc8U4U/2 tc6mVA/oLwpA1sG98AledOYNbDxd7CYE8PbE3UyZkEgkD4XwZMbrt7yGksGgnrjZEWzG bWBA== 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:sender:dkim-signature; bh=3rh8Yz80jnPJhs1iYa7SyyuCUEYbcinIqWYdYuoixQk=; fh=0kOoeTcw0DospH1255n2PxpaERzU9WL7oD2eaE6maQo=; b=soFJ3WD2Yh01D2BuqJeEzjLa6O5UDaUGjNvFnOfNvmLF3CfozhvVbaVZvWbvYeas+U wg9v+2Llz5TzgR8R+YkLbVDgN5NbYRpfrCpUOSPSo2hz4WgWqqsbc4p+NMyiGSUXzxZT S+o7PY1ed4gYOqYEgT6kXM0tBE2Yv/0m4SwbFGDwRxlysLLATy42qP7EB8Y7GTViUc18 fgci6EdyZdXdsF74mQeTpNVLleG/UQRFiTpizC+BDlthBBZRCITBtKEebEgYU7AOpurL xBgyl99JcwWwAhYVIOXNyz5MnOKP3tjL0bVan+rvt1FxO8jkRAb2e9eBWUGLrpP0t4iV BdLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hLCkx7j4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id m1-20020a656a01000000b00578ca21773fsi2228917pgu.718.2023.10.03.12.07.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 12:07:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hLCkx7j4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id CB50580C92FB; Tue, 3 Oct 2023 12:07:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231976AbjJCTHA (ORCPT + 99 others); Tue, 3 Oct 2023 15:07:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231262AbjJCTG7 (ORCPT ); Tue, 3 Oct 2023 15:06:59 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AA5CAB for ; Tue, 3 Oct 2023 12:06:56 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-536071e79deso278417a12.1 for ; Tue, 03 Oct 2023 12:06:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696360014; x=1696964814; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=3rh8Yz80jnPJhs1iYa7SyyuCUEYbcinIqWYdYuoixQk=; b=hLCkx7j4O+/aJ+XOOjxDl2gYHI+IA3pblK1nvrZLnieVidpbso1XOaOMMMli/bBIsU Mb3HbSHQLZj3SD55OMJ20054pvDHcKf5RhbcEczGhs8njCvTWX8p9FNUU40ZYNfAhBTo 3qZ07fBfSX26M9KEu0VpOyDLVnLgFltUu8ys/7mPquCRT5DIhLqDSjhl7gZQJOcWJtZw AQSDzoUMeXq5ah0MkmEIjnPJmMJH7kwC0aQIaoBozBFhSqQaUu0wVhGvdvBeoV5aZCiM I+R14dg2WxvL3Z5Lwo6qSjRAEEvHEPShLFMMDRNLIEtNcBKzwXc0YeioAeesWOh2Njbj 1KmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696360014; x=1696964814; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3rh8Yz80jnPJhs1iYa7SyyuCUEYbcinIqWYdYuoixQk=; b=LPLD5Ie7tI69epbeh2jOO+TFUy8yJreaZMZbwUpdcydviEQTxIkVJun/0zZoo1onyk LGo0sDYP9kampkSaeHH8LvZtoABXnVu7N4SjAmQCNJcaW2eV0lIPhniLijLfIZtzsN8k 1fM8OGpgHZ9wn7WjsdGDQPTVCJsIB3ow7oCxRLfS5Oqw+fc26n2OnGawIei/F08j2YFA W3dkwDkzF/rCcqFM+PxYpyVY02RztQrbHxHTSdm49TMu/Pzr97ckoMb8zPBb+kw+S00H 5ghUj3u+lXYjJGXELBZNGUlopeIUaV8PAPGD/+woWv6URVx9xGFWAQlKwDS8iDgvH7Kx 2jIg== X-Gm-Message-State: AOJu0YzQjS6lhDp3ivPjFpB1KCTLwYBz35STO75EnH6+MYeLp9XrV2Rd czHcj5K8C/o+0dAab6hrTag= X-Received: by 2002:a05:6402:3552:b0:530:8b92:b69d with SMTP id f18-20020a056402355200b005308b92b69dmr2998719edd.10.1696360014446; Tue, 03 Oct 2023 12:06:54 -0700 (PDT) Received: from gmail.com (1F2EF530.nat.pool.telekom.hu. [31.46.245.48]) by smtp.gmail.com with ESMTPSA id g13-20020a50ee0d000000b0051e1660a34esm1265750eds.51.2023.10.03.12.06.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 12:06:53 -0700 (PDT) Sender: Ingo Molnar Date: Tue, 3 Oct 2023 21:06:51 +0200 From: Ingo Molnar To: Dave Hansen Cc: Alexey Dobriyan , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , linux-kernel@vger.kernel.org, "H. Peter Anvin" Subject: Re: [PATCH] x86_64: test that userspace stack is in fact NX Message-ID: References: <4b78a714-5ac3-4783-8256-1dda4673db01@p183> <1d5223b8-0275-619d-db1c-e2aaaddb173e@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 03 Oct 2023 12:07:12 -0700 (PDT) * Dave Hansen wrote: > On 10/3/23 06:00, Alexey Dobriyan wrote: > > On Mon, Oct 02, 2023 at 07:23:10AM -0700, Dave Hansen wrote: > >> Basically, could you spend a moment in the changelog to talk about: > >> > >> 1. 32-bit kernels on NX hardware > >> and > >> 2. 64-bit kernels on non-NX hardware > > > > Sure. My logic whas that i386 is dead arch, but this test is easy to > > port to i386, only 2 simple functions. > > I honestly don't feel strongly about it one way or the other. But > whatever we do, let's explain it, please. > > > I don't want to parse /proc/cpuinfo. If someone knows they're shipping > > NX-incapable hardware, just let them disable the test. > > Other than clearcpuid=nx, I don't _think_ we have any way to clear the > X86_FEATURE_NX bit right now. That should mean that you can use regular > old CPUID to see if the booted kernel supports NX. [...] I think that's probably overkill - the test should report a failure if NX is not available for whatever reason. Because not having NX in 2023 on any system that is threatened is a big security vulnerability in itself, and whether the vendor or owner intentionally did that or not doesn't really matter, and a failing kernel testcase will be the least of their problems. In fact I'd argue that we should fail this testcase in that situation as a matter of principle: NX clearly doesn't work and there's very few situations where that's acceptable. Anyone who doesn't want or have NX can skip paying attention to this failing testcase just fine. Thanks, Ingo