From patchwork Thu Sep 14 11:27:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 140374 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp974154vqi; Fri, 15 Sep 2023 04:34:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF02teR5CS759zHe1svj0SA75tPDICLyYjKU2ttyCfxjimDHz4J4dx5P6vV1aziJM0XEpTY X-Received: by 2002:a17:903:22c7:b0:1bc:edd:e891 with SMTP id y7-20020a17090322c700b001bc0edde891mr6641008plg.1.1694777655938; Fri, 15 Sep 2023 04:34:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694777655; cv=none; d=google.com; s=arc-20160816; b=Y+483CnE0YmlH53b5Ncj++qrtN2UdifhOexVqCBiOBJmGacsBJ8b2uQWsyi/Pv0TZG WFvs6IbPST8N0+8wlRnDf317ShIb26u90c5ZO392M/+Gv5R7xgKteNkDql9LTyaUHV/n 9Bdx6WIEEV3REDgaWupj27M023BePX6S0ZzexqQT21qRHZarR1cRuF2VWTqJqiWkjmc9 AmWs6IaTHUESqHI9y+31yUc6u5kc3fjnpooYzg3gX9IzwxnV95OTGZ/ckwNjccLbU4bH VQ8hQQPdsuyl8PHNncAw7tIcAaIDMOZPFkDQcfmUAm2zzryAR3m7HjJ3zoFlGdRu4kLr 1knQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=kf6VRRqhWvA8boUZqcpc/MRGoYGxVjM8NNnYnSRa7uE=; fh=n7fF7QC0RNRn6F3FQu0v+CrFD4hMTQOXYoV2ln8SMUQ=; b=u+0uTmAENUq2lBzrcuZ6O6LVkbzl+K7trzGiFpsjUqam9782I/73TX1nIam+K0sVD0 tgyKqgrRLjE5bDZCOLEym4k+TBUhnX22ekP6BZ2bbOt7cdONgZr6A6/vcmZfTKW1zy5s kuNDHESjMk2hbqkaJoNGs3YAAPdLXXP9+s40Igc8tstiG7mdwJ26PcWXlg1r0cA5Zy3o gF3U5BmHl84c43PtHr9DTB71YIlTQ7U7HCuPz7I0Qy9SIKRtXH0lEhYYrlfgj4KUs7tS tmGFvOV1JhyJc6feLGeA1utqPYsrUOBm8LtEmfin9u/qJuP52JR6ejbNhCCRn9FJ+cv2 ky5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=CFGjwNmp; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id b13-20020a170902d50d00b001b9c3498510si3444427plg.469.2023.09.15.04.34.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 04:34:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=CFGjwNmp; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 7F32782F27C1; Thu, 14 Sep 2023 04:27:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237634AbjINL1P (ORCPT + 35 others); Thu, 14 Sep 2023 07:27:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233393AbjINL1J (ORCPT ); Thu, 14 Sep 2023 07:27:09 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74BDCE3; Thu, 14 Sep 2023 04:27:05 -0700 (PDT) Date: Thu, 14 Sep 2023 11:27:03 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1694690823; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kf6VRRqhWvA8boUZqcpc/MRGoYGxVjM8NNnYnSRa7uE=; b=CFGjwNmpuAEgdme0vO3/8C5kjhVlOdBwx1SCCv3WN9GXKSRctzUa87ktHzkq2LnzkzBUqp RaEnxkzgT3zLzCstadjbBb/7YSq0M5fCpyxPyV0GBcnM1lMRkS5hfovlzyLrFuprA7Jtw8 xjEFw9KxtUwMt835UcKDwb21OAdY5hzweNlh0KJcN8OPqoOK2d3QmB4UvRsjQtOBN3zQ3u pm0ux8mUBaViQa1AiyiZIZuPDQzTOjNEmy3henLYyRtUetnQcxcXQwnIGSsFiXCv222aeK 6QOz19yia53lQLEnophDST1AZdqhLhagsvAuTv1wYGzcYsn0zbGl+m+KYvfPzQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1694690823; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kf6VRRqhWvA8boUZqcpc/MRGoYGxVjM8NNnYnSRa7uE=; b=0eR8CZANFYxxd4f1bwmyTDhWKgt7CqauMWpMQBgiO/tpvNHiTxqgfY0Z019FUkyUTd4rQk Xuf6jDCnc1h/aBBA== From: "tip-bot2 for Nikolay Borisov" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/entry] x86/elf: Make loading of 32bit processes depend on ia32_enabled() Cc: Nikolay Borisov , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230623111409.3047467-5-nik.borisov@suse.com> References: <20230623111409.3047467-5-nik.borisov@suse.com> MIME-Version: 1.0 Message-ID: <169469082322.27769.6028739507798340170.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails 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 (snail.vger.email [0.0.0.0]); Thu, 14 Sep 2023 04:27:15 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1769491917754868545 X-GMAIL-MSGID: 1777103175752213192 The following commit has been merged into the x86/entry branch of tip: Commit-ID: 5ae2702d7c482edbf002499e23a2e22ac4047af1 Gitweb: https://git.kernel.org/tip/5ae2702d7c482edbf002499e23a2e22ac4047af1 Author: Nikolay Borisov AuthorDate: Fri, 23 Jun 2023 14:14:07 +03:00 Committer: Thomas Gleixner CommitterDate: Thu, 14 Sep 2023 13:19:53 +02:00 x86/elf: Make loading of 32bit processes depend on ia32_enabled() Major aspect of ia32 emulation is the ability to load 32bit processes. That's currently decided (among others) by compat_elf_check_arch(). Make the macro use ia32_enabled() to decide if IA32 compat is enabled before loading a 32bit process. Signed-off-by: Nikolay Borisov Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230623111409.3047467-5-nik.borisov@suse.com --- arch/x86/include/asm/elf.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h index 18fd06f..a0234df 100644 --- a/arch/x86/include/asm/elf.h +++ b/arch/x86/include/asm/elf.h @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -149,7 +150,7 @@ do { \ ((x)->e_machine == EM_X86_64) #define compat_elf_check_arch(x) \ - (elf_check_arch_ia32(x) || \ + ((elf_check_arch_ia32(x) && ia32_enabled()) || \ (IS_ENABLED(CONFIG_X86_X32_ABI) && (x)->e_machine == EM_X86_64)) static inline void elf_common_init(struct thread_struct *t,