Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp12306848rwd; Fri, 23 Jun 2023 04:30:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4DhfWdiXz1qBRPDzU6xqgYr/4Xv+8QoJ9Z8fQK8+MnjVxA5dXq6BLa1yJlRbyqZxdXSOQ3 X-Received: by 2002:a05:620a:2955:b0:763:a83c:a9e4 with SMTP id n21-20020a05620a295500b00763a83ca9e4mr17339563qkp.31.1687519803955; Fri, 23 Jun 2023 04:30:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687519803; cv=none; d=google.com; s=arc-20160816; b=kh1kGSswSZAxBI0CeiUIHqwYmd37N54qk0HiGp9plJoIGceUEeTa2vz3NnPmS/6BiU RoMG0JESXT3M3gcAfbLSZsKA3K8wCVIe14zX48pqAiRFxSBp6BYnivBW2ze2G5A5olJt Y2Nj9Xfue91aV363x9SUTK/KCseT+mGGUVHFWLzMGFFsKHXryOYLif8yajmAb1UhcqQW CQZbjCRImAQ2ggPd9/Y8PErD5pSywzl3wm3xPgcK90YjPyQC53Q08+RrXiY00YCRYJiQ C2+GW7VXRQUED6Ha/kbcM2FBXFSq3xLLLzk7Ylv4HqDwsp86GUOhK/dkN+CELmTq8jDS Z3UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=f0VodzPEDQcX9JjZJBEDkNzZARXLsoiBYtSqjF6vfi8=; b=Pi+zB+S5uhMBo5nQNtbfZZXQUoWDx1rbrExly2ibLZu2IY9UM9f+PpPxXrBsMXJCy/ ebaAgO9cjx+ZEbquP/ewFXiyzI1XxomhxB/1LwIesfsM2Sa3NviApUW2F7yzGegdG3eK 7tRijG5P/3uI77UT2TNCJw+Kc696xVvvwiYDOcshoiy+mbQSmCzPde4k2oT7fWdOcgz3 Lb1QyE8Mc7LnXtJzyHRYwv99oxJIAPsJOGp5xdbtuiGibgAiIQUW3+8Nnic08aRmbpkf eKpCpP9t1IhSOEUDdC1+9992fhmgjHlXJ6Uxx7OM9kPB5BA6gNqhWi1EY+IAT4ODzXPq 3Zhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=TlbMDcQx; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u190-20020a6385c7000000b0052c8234a858si8625796pgd.168.2023.06.23.04.29.52; Fri, 23 Jun 2023 04:30:03 -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=@suse.com header.s=susede1 header.b=TlbMDcQx; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231922AbjFWLO3 (ORCPT + 99 others); Fri, 23 Jun 2023 07:14:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231767AbjFWLOR (ORCPT ); Fri, 23 Jun 2023 07:14:17 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C65E62101 for ; Fri, 23 Jun 2023 04:14:16 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 770E41F6E6; Fri, 23 Jun 2023 11:14:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1687518855; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=f0VodzPEDQcX9JjZJBEDkNzZARXLsoiBYtSqjF6vfi8=; b=TlbMDcQxYXlK/x5u7ubvCPwPsUHKpUfZI2GFCE+ITXT1GnMRj8C7W0StJCYva9t3+f64O/ Fc6BaA9+wdK3ikB7F0nzb7Lxkn3Fn/eymNPmyTu4Z51VD2wn5JZ63vwZKARBD6R1AOiX+T TdRl3S2TG4GGIFFOhbEqDYmOQs8iEmY= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 220221331F; Fri, 23 Jun 2023 11:14:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id mNOEBYd+lWTcFAAAMHmgww (envelope-from ); Fri, 23 Jun 2023 11:14:15 +0000 From: Nikolay Borisov To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, mohocko@suse.com, jslaby@suse.cz, Nikolay Borisov Subject: [PATCH v4 4/6] x86/elf: Make loading of 32bit processes depend on ia32_enabled() Date: Fri, 23 Jun 2023 14:14:07 +0300 Message-Id: <20230623111409.3047467-5-nik.borisov@suse.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230623111409.3047467-1-nik.borisov@suse.com> References: <20230623111409.3047467-1-nik.borisov@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 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 --- 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 18fd06f7936a..a0234dfd1031 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, -- 2.34.1