Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2208270rdb; Tue, 3 Oct 2023 13:46:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEiPjhlSaPb469vXM6/hxdBBfX9zORQ5H1JIjlxxbW/AuNn8YtfQnnyA5obhx5WK6Mrq4uA X-Received: by 2002:a05:6808:24c:b0:3ae:4d0:7f06 with SMTP id m12-20020a056808024c00b003ae04d07f06mr623770oie.16.1696365998260; Tue, 03 Oct 2023 13:46:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696365998; cv=none; d=google.com; s=arc-20160816; b=o+CokkPmgCc4YRDyEqKkx4/oZxW5P5M9YdTgXclLY/oswd+QroZl3huyYUpBvNmcJX 9gtubm6O8/KwGrJjUOPKlTZhl5ykiSxEK/RLlaL7SAXdj0BNHv//8Nq4L5hFJVHqUXIx P55JyO/vPRlPpIa2QKQGlCa/EI3EKeqLDu87RJNAlN4m9gOsIg708iM4AWCnn6JTdpuT 2EZg+8lc/clTmPyn6LgPZlm15BKkzlulATY8NLhEScLjAHXrQ6XDkoMBOQmqwd2WROqA 6GpBjYW9qqO0p8ZMvEcle4Pm7VjsSFOV8hYj8+j7Q0Eu4e7afsH+3OGCtnUoj1K1k20b Oqcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=vCEpjB9D9DQY6AoMJKtsWOScpx6zpTgwX3wwmUc1okQ=; fh=QAdlK+kxOIYw0jMEN+yaqE2tyRNPpsjuCZxkclveW0I=; b=WLctTd2MrZZQX++kYRJ6wmOYnApTa5yxZqLp4i+MVlG0CGCn+ujSZ570ragddyrsNN 41svR9Y8LOrHPHDZr/1AzErqdK6TasSb1Qhg4fPCzIDg3Lpnm6joEekWzGbcain96ys9 XmRVEJpTzGBYtLGnOUVpmpnQwvxL3zWmm3KI3vynL/cWzSaIVOVylvZMVTt5K5aAO5JZ Tf7J4/RsPnIytwQsTc1alwSVJji1WyL2N4Ue4v3rpWsSAj+9lgQ63ExxKk8WzGpzGWUm G1+2sap17RDBaEgL5P0vmVSoNy7dQ/cPGp2R7VcPENfcHyV7u/Ak9GmcGzYOyR+I8s+f Kpgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fdP81Xkp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id p15-20020a17090a74cf00b00278f524d83dsi16566pjl.95.2023.10.03.13.46.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 13:46:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fdP81Xkp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id A446E81A9A67; Tue, 3 Oct 2023 13:46:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232259AbjJCUqa (ORCPT + 99 others); Tue, 3 Oct 2023 16:46:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232210AbjJCUq0 (ORCPT ); Tue, 3 Oct 2023 16:46:26 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBD3BAB for ; Tue, 3 Oct 2023 13:46:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696365981; x=1727901981; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=ocFdCaQn0YtyQXJZyENMtrHQHH5+3WfkzDHWrFzYugc=; b=fdP81XkphsdNi26kPEyeAYBCoasT9JdSd58DUH1aquCmt81rLgmRyJki 0J0vHL4c4+WKe0lFma5wvgp+vTB3ZHI1J5cFlgl730dqaVu/l5JqMfuSu VaD4XDvYjK3uv6a0jKJED5B52EWybpSzsK5CS7K7/9NSFOyGOfcLz8+n1 xr/7N8xRoLofiiAnevAYsh4c5Yt99IlPn4Pzu5d+ig1kuvObH+w9nV4K4 YE/s7wbXm8fVbFpvYtuGEZB+Tna4K+TQZyr2lndx4c9PPO0OCaeJzE8G3 ArPgrXjxtH+57nc3e05QxSoCbKAi/m6uMFHmx+LqfJroqnLQu7KQ2tb6h A==; X-IronPort-AV: E=McAfee;i="6600,9927,10852"; a="382883760" X-IronPort-AV: E=Sophos;i="6.03,198,1694761200"; d="scan'208";a="382883760" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2023 13:46:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10852"; a="700854257" X-IronPort-AV: E=Sophos;i="6.03,198,1694761200"; d="scan'208";a="700854257" Received: from ddiaz-mobl4.amr.corp.intel.com (HELO [10.209.57.36]) ([10.209.57.36]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2023 13:46:20 -0700 Message-ID: <1dad6a33-1cd0-0d0f-29c5-97fd2807f07a@intel.com> Date: Tue, 3 Oct 2023 13:46:20 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH] x86_64: test that userspace stack is in fact NX To: Ingo Molnar Cc: Alexey Dobriyan , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , linux-kernel@vger.kernel.org, "H. Peter Anvin" References: <4b78a714-5ac3-4783-8256-1dda4673db01@p183> <1d5223b8-0275-619d-db1c-e2aaaddb173e@intel.com> Content-Language: en-US From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 03 Oct 2023 13:46:35 -0700 (PDT) On 10/3/23 12:30, Ingo Molnar wrote: > * Ingo Molnar wrote: >> 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. > BTW., it's also questionable whether the owner is *aware* of the fact that > NX is not available: what if some kernel debug option cleared the NX flag, > unintended, or there's some serious firmware bug? > > However unlikely those situations might be, I think unconditionally warning > about NX not available is a very 2023 thing to do. 100% agree for x86_64. Any sane x86_64 system has NX and the rest are noise that can live with the error message, unless someone shows up with a compelling reason why not. For 32-bit, the situation is reversed. The majority of 32-bit-only CPUs never had NX. The only reason to even *do* this check on 32-bit is that we think folks are running i386 kernels on x86_64 hardware _or_ we just don't care about 32-bit in the first place. In the end, I think if we're going to do this test on i386, we should _also_ do the 5-lines-of-code CPUID check. But I honestly don't care that much. I wouldn't NAK (or not merge) this patch over it.