Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp467332pxu; Tue, 5 Jan 2021 16:50:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJxmNyYlTDBUKYKhKirxzgxZcuam7ETWD7zlLHZRmJ0t77F3ecnvvdhhg2o/p37ssy2SkZmH X-Received: by 2002:a50:8a90:: with SMTP id j16mr2176778edj.334.1609894257706; Tue, 05 Jan 2021 16:50:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609894257; cv=none; d=google.com; s=arc-20160816; b=fCFaejR0XZi1082bbMTvgPtxtalhhstSZ8g+a1X+d9wdvdj7098VriH4p+OVZ1NQ06 AH4TxMEcokqD5KzTlj67G3p6o69mRtW9AXL9Qe09R2uSKJSVHnqymA+w2yjQyRaAnGPo WeNiEaHsQdnpx2f5OISJA3i7IDTOj1Hh9e1vQSJJ/LWc4g7PELjXDvNZmsFuF2dXav8B vTKO36ix/gWL+KAK1nktAQb6lGiBatRPAygrFtw2I8mNmVH9uoi/4j7NUnQX3GhjAv3W PGnsr23PCzoF+e/hkIsBAcYKSlJOOlv6RLPbeZm9cPa0+mE/WxKUsBxgzEHeVN29yPfy j7oQ== 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=zr1nk1szl5GG5n0n6PHuJBeCa8a7lrWWiwsyDZTvizQ=; b=jp7Tz+ZkoIf19a5HFSw5cOvNk/8EkTKeLi2aMdBK6hxpNUW/4s3E4ngzTBw9cMM0y3 clgqPSH2I9ADyq2ooY/tWD/x9MJJBqiPCaI4UOYdNK65MaWhK+jhWBHLIwBNopry5bOu j6cjooQSEnByHLr7q23Hy8cD+WzsW0OD6FmbaOEPf0K9+JQGJKQ4wVDJl61IJowMlgfF J5COCEzfqZddzEkovbV1Tq24jbv28/xwIvFJ3+a+VqJ6Ab5+YK5YGXE5+CQaimSvC5l1 /oQb5w7cffLfpQG16u2kvUm1j4iLNlmfEPUwzZONDQamSpOJHI62EmozpKdxxurQrbZ/ 5nCg== 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 j20si330320ejt.403.2021.01.05.16.50.34; Tue, 05 Jan 2021 16:50:57 -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 S1726685AbhAFAbF (ORCPT + 99 others); Tue, 5 Jan 2021 19:31:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726594AbhAFAbE (ORCPT ); Tue, 5 Jan 2021 19:31:04 -0500 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EE2EC061793 for ; Tue, 5 Jan 2021 16:30:24 -0800 (PST) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwwiO-007DEZ-VN; Wed, 06 Jan 2021 00:30:17 +0000 Date: Wed, 6 Jan 2021 00:30:16 +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: <20210106003016.GZ3579531@ZenIV.linux.org.uk> References: <091174F9-F6E4-468E-83F5-93706D83F9D2@amacapital.net> <87mtxodxat.fsf@x220.int.ebiederm.org> <20210105005700.GR3579531@ZenIV.linux.org.uk> <878s97aq4c.fsf@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <878s97aq4c.fsf@x220.int.ebiederm.org> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 05, 2021 at 06:03:15PM -0600, Eric W. Biederman wrote: > > 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. > > That does sound interesting. Anytime we can clean up arch specific > weirdness so that it simply becomes generic weirdness and it can be > tested and maintained by more people is always nice. vfs.git #work.elf-compat, and AFAICS it works. arch/Kconfig | 3 ++ arch/arm64/Kconfig | 1 - arch/ia64/kernel/crash.c | 2 +- arch/mips/Kconfig | 8 ++---- arch/mips/include/asm/elf.h | 56 +++++++++++++----------------------- arch/mips/include/asm/elfcore-compat.h | 29 +++++++++++++++++++ arch/mips/kernel/Makefile | 4 +-- arch/mips/kernel/binfmt_elfn32.c | 106 -------------------------------------------------------------------- arch/mips/kernel/binfmt_elfo32.c | 109 ---------------------------------------------------------------------- arch/mips/kernel/scall64-n64.S | 2 +- arch/parisc/Kconfig | 1 - arch/powerpc/Kconfig | 1 - arch/powerpc/platforms/powernv/opal-core.c | 6 ++-- arch/s390/Kconfig | 1 - arch/s390/kernel/crash_dump.c | 2 +- arch/sparc/Kconfig | 1 - arch/x86/Kconfig | 2 +- arch/x86/include/asm/compat.h | 11 ------- arch/x86/include/asm/elf.h | 2 +- arch/x86/include/asm/elfcore-compat.h | 31 ++++++++++++++++++++ fs/Kconfig.binfmt | 2 +- fs/binfmt_elf.c | 19 ++++++------- fs/binfmt_elf_fdpic.c | 22 ++++---------- fs/compat_binfmt_elf.c | 7 +---- include/linux/elfcore-compat.h | 15 ++++++++-- include/linux/elfcore.h | 7 ++++- kernel/kexec_core.c | 2 +- 28 files changed, 128 insertions(+), 324 deletions(-) create mode 100644 arch/mips/include/asm/elfcore-compat.h delete mode 100644 arch/mips/kernel/binfmt_elfn32.c delete mode 100644 arch/mips/kernel/binfmt_elfo32.c create mode 100644 arch/x86/include/asm/elfcore-compat.h