From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A7B6FCDB465 for ; Thu, 19 Oct 2023 10:53:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3LTvpERy6whasTEZqMrq/aVm+el5jyGpCxmLTTz1etg=; b=cnEhhTwAQIo/Ke pW8GDsyncDjXIv7302F75PtOcoA44P+ORupPexXmaCzQQx78FMz9mmuBah3FwGD/qR3EBgi6ILUvh Y3B52xiSBD4RJhzI9yxBgBnWz3oaFm+HtSJBk9nqru24uDLz2qsHldIsG8U3HZz3mueIzmbwkT2Bb DNp66t1EKMBpEXBml+JmYhk5icZjNAGlMnunl+iZIy9k96YbPy8Wa9GFyVt5N8y7IhnjIyNWx9l26 a+jAbAeslpeL+YmUNs+S5Q8M+a5Ru4ZZiL786zaCEucjdJ14B+7N5gThlcQ25PQUInfOLVQk6O5F0 OlP+UokEsHdluF57XIqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qtQdk-00H6VJ-1Y; Thu, 19 Oct 2023 10:52:32 +0000 Received: from smtp-out2.suse.de ([195.135.220.29]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qtQdh-00H6UC-2E for linux-arm-kernel@lists.infradead.org; Thu, 19 Oct 2023 10:52:31 +0000 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 4626A1F88B; Thu, 19 Oct 2023 10:52:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1697712746; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QpIy/RTUlzS5m0v5JYCmLVvG8ZLB5o2VoYwjMduXzG8=; b=UFTds98fre9xAAk4LYP0ojQT9dICphovGKc+CtcYLSaPKrQWQx5MVLsqEaagjGk0GeKi00 vdUAEna7ahED15Xses+xsjBCpC3JooTZALeQ3iiDlnc31VjyzHkGJuM9r7p6wtVasUNSai iw9IQFJEayUA9jNkU0tif1akSC36cw4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1697712746; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QpIy/RTUlzS5m0v5JYCmLVvG8ZLB5o2VoYwjMduXzG8=; b=pDTHfyhClmgvWfXOlaipVUP2nou1GgWvffDtvm5whgXnY4xz7LBiiUEPiO1vEAguVovjM0 5u4Qa6vL6DhNnNAQ== 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 28F411357F; Thu, 19 Oct 2023 10:52:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id H3zyB2oKMWVlCAAAMHmgww (envelope-from ); Thu, 19 Oct 2023 10:52:26 +0000 Date: Thu, 19 Oct 2023 12:52:25 +0200 From: Andrea della Porta To: Arnd Bergmann Cc: Will Deacon , Andrea della Porta , Catalin Marinas , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, nik.borisov@suse.com, Kees Cook Subject: Re: [PATCH 0/4] arm64: Make Aarch32 compatibility enablement optional at boot Message-ID: Mail-Followup-To: Arnd Bergmann , Will Deacon , Andrea della Porta , Catalin Marinas , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, nik.borisov@suse.com, Kees Cook References: <20231018122729.GA18556@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Authentication-Results: smtp-out2.suse.de; none X-Spamd-Result: default: False [-10.60 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-3.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; REPLY(-4.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_SEVEN(0.00)[8]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231019_035229_875073_82DEBA28 X-CRM114-Status: GOOD ( 30.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 14:44 Wed 18 Oct , Arnd Bergmann wrote: > On Wed, Oct 18, 2023, at 14:27, Will Deacon wrote: > > Hi, > > > > On Wed, Oct 18, 2023 at 01:13:18PM +0200, Andrea della Porta wrote: > >> Aarch32 compatibility mode is enabled at compile time through > >> CONFIG_COMPAT Kconfig option. This patchset lets 32-bit support > >> (for both processes and syscalls) be enabled at boot time using > >> a kernel parameter. Also, it provides a mean for distributions > >> to set their own default without sacrificing compatibility support, > >> that is users can override default behaviour through the kernel > >> parameter. > > > > I proposed something similar in the past: > > > > https://lkml.kernel.org/linux-fsdevel/20210916131816.8841-1-will@kernel.org/ > > > > bu the conclusion there (see the reply from Kees) was that it was better > > to either use existing seccomp mechanisms or add something to control > > which binfmts can be loaded. > > Right, I was going to reply along the same lines here: x86 is > a bit of a special case that needs this, but I believe all the > other architectures already guard the compat syscall execution > on test_thread_flag(TIF_32BIT) that is only set by the compat > binfmt loader. Are you referring to the fact that x86 can switch at will between 32- and 64- bit code? Regarding the TIF_32BIT flag, thanks for the head-up. I still believe though that this mechanism can somehow break down in the future, since prohibiting 32 bit executable loading *and* blocking 32 bit compat syscall are two separate path of execution, held together by the architecture prohibiting to switch to A32 instructions by design. Breaking the first rule and embedding wisely crafted A32 instruction in an executable is easy, while the difficult part is finding some 'reentrancy' to be able to do the execution state switch, as pinted out in https://lore.kernel.org/lkml/ZTD0DAes-J-YQ2eu@apocalypse/. I agree it's highly speculative and not something to be concerned right now, it's just a head up, should the need arise in the future. > Doing the reverse is something that has however come up in the > past several times and that could be interesting: In order to > run userspace emulation (qemu-user, fex, ...) we may want to > allow calling syscalls and ioctls for foreign ABIs in a native > task, and at that point having a mechanism to control this > capability globally or per task would be useful as well. > > The compat mode (arm32 on arm64) is the easiest case here, but the > same thing could be done for emulating the very subtle architecture > differences (x86-64 on arm64, arm64 on x86_64, arm32 on x86-compat, > or any of the above on riscv or loongarch). > > Arnd Really interesting, Since it's more related to emulation needs (my patch has another focus due to the fact that A64 can execute A32 natively), I'll take a look at this separately. Andrea _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel