Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp14224585pxu; Mon, 4 Jan 2021 16:59:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJxfVHlcjh+dBRy+5i56CFXWwtq78jz3XegRVYt8YdsM+xQkvJnQ+MZ2HoDaUAI0ktzE9zW2 X-Received: by 2002:a17:906:3111:: with SMTP id 17mr37716648ejx.152.1609808361955; Mon, 04 Jan 2021 16:59:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609808361; cv=none; d=google.com; s=arc-20160816; b=0Dg0ZKg5x2ne/Owovvno0cOLgFUsA/lTULCaefskmE8GFo0l6xpg2/E609FCXexGiO LjiIqtP8/gLQuWPO0YS3Kz/A5UyHDvJKXXk1g36wn9QUARVXFnjkU0VqzIyTf1+Y0DCm J4xgfra6BkDGMvbaaBQYltc1ZLcSYlAuu5TLO1RYkesDMqn4CdWtaKei638iLHZcxGcL 9zv/xmD9gHmU1x6vZhiGf3u5w7m6vab9pdtphwHqgEEC0qB6tYIUAEH45ZENouNM3CdX 2XuK3ZTNsQtWna/U/srrmeD3yXovQCbDN06H2mofl/OW7I6o3fFyhsv0ADQfkMxIQEcu BS6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=5vr35qnap9PIRox56+0yrv5IKvm7N+NS94RXmJ2r9Uk=; b=jQ0WVUY1AGZFTppjgMPnVwqgJE01Q2LqL4mdgFPLP6o70dXbdGLSucxFbpUrHg0cK+ FiMI2vq0Ga5C0+RCKElUFcZ+NphsdWJJMl3slbr9eLziaajVOGvaoMjDkGNYpWRnH6wn uXiRQv4ZEKLPZV03+o7cCoatIyzadXwzklr3lhw6flanw5Wn8gEc11FB9QFnFJZmw5Zc rMwJETnegvqu9hIVIRdnPyx5+OM+WwfQKdnoJ4tROcXM7zye0lvysTvA7B+mlaQomuO6 F9MSYTuztF/SeTDcNBzhuE4Yea1sbf8oVRUA9ifhaBNiAcs0WXlXBd5Mrq6i4LljBhsp f+Pg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s2si32142716edw.5.2021.01.04.16.58.59; Mon, 04 Jan 2021 16:59:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727850AbhAEA5t (ORCPT + 99 others); Mon, 4 Jan 2021 19:57:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727649AbhAEA5s (ORCPT ); Mon, 4 Jan 2021 19:57:48 -0500 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00592C061793 for ; Mon, 4 Jan 2021 16:57:07 -0800 (PST) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwaei-006vbx-1c; Tue, 05 Jan 2021 00:57:00 +0000 Date: Tue, 5 Jan 2021 00:57:00 +0000 From: Al Viro To: "Eric W. Biederman" Cc: Andy Lutomirski , David Laight , Christoph Hellwig , linux-kernel@vger.kernel.org, X86 ML Subject: Re: in_compat_syscall() on x86 Message-ID: <20210105005700.GR3579531@ZenIV.linux.org.uk> References: <091174F9-F6E4-468E-83F5-93706D83F9D2@amacapital.net> <87mtxodxat.fsf@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87mtxodxat.fsf@x220.int.ebiederm.org> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 04, 2021 at 06:47:38PM -0600, Eric W. Biederman wrote: > >> It is defined in the Ubuntu kernel configs I've got lurking: > >> Both 3.8.0-19_generic (Ubuntu 13.04) and 5.4.0-56_generic (probably 20.04). > >> Which is probably why it is in my test builds (I've just cut out > >> a lot of modules). > > Interesting. That sounds like something a gentle prod to the Ubuntu > kernel team might get them to disable. Especially if there are not any > x32 binaries in sight. What for? > The core dump code is currently tied to what binary you exec. > The code in exec sets mm->binfmt, and the coredump code uses mm->binfmt > to pick the coredump handler. > > An x32 binary will make all kinds of 64bit calls where it doesn't need > the compat handling. And of course x32 binaries run in 64bit mode with > 32bit pointers so looking at the current execution mode doesn't help. > > Further fun compat_binfmt_elf is shared between x32 and ia32, because > except for a few stray places they do exactly the same thing. FWIW, there's a series cleaning that crap up nicely; as a side benefit, it converts both compats on mips (o32 and n32) to regular compat_binfmt_elf.c Yes, the current mainline is bloody awful in that area (PRSTATUS_SIZE and SET_PR_FPVALID are not for weak stomach), but that's really not hard to get into sane shape - -next had that done in last cycle and I'm currently testing (well, building the test kernel) of port of that to 5.11-rc1. I really don't see the point of getting rid of x32 - mips n32 is *not* going away, and that's an exact parallel. PS: if anything, I wonder if we would better off with binfmt_elf{64,32}.o, built from fs/binfmt_elf.c; it's not that hard to do. With arseloads of weirdness going away if we do that...