Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1753901pxy; Thu, 29 Apr 2021 13:51:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMwCNd6lnG3yAj5ChUAfPUjjrhDhiVYF1r8AZ0UYkNH8Ifa0Rev1hUE1UXQwQcKYXflTby X-Received: by 2002:a65:61a1:: with SMTP id i1mr1464522pgv.411.1619729465126; Thu, 29 Apr 2021 13:51:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619729465; cv=none; d=google.com; s=arc-20160816; b=HhR4vADSwdulC1xQNoTaDxaztqaZ9ATBKagc2/RI0OUSwkrcInkG/Nmc1i/Fwplhl0 rsyUxNzE7B0JD0nMTHFxDhV4LegCuO4TY4GkWoQVHjsyhAZB3cY40/sSma3XATT3i6JM wJIS/ykV+gECBY9p667kD7Jv/leloWytM3ReYzhy/aoCsxlqSmxVP4roL8pIGZj4C3RS kPf+cOtRF8zq0hfxP2BfsbRXupmcGCnR2voym2W7/C6OehtrTcqG2eiOjQtfJtlIeWRl SB3NrjiAY4MW+2fyUjaM49thgQFSgaeXRpWd7w4PC+glilzAU24OMtplxLcmkutoB5qS 8HYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=XPKr2OzxzEqAz4j8KYhUwNIVrgXX0dgHlgZCIhSjrP4=; b=GaoCNOifBbKwUptxnNrfEB8R8pIcAkTJsybqyNeLDRheMTYKjbii4GAbpcJ9Pme1tx UJvnf2DMI+yrdYjwHNzz7a5oaXCCkQHj/uj4iaZzn9BzCGS4+bLmYszdcbI5dXg+Q4u0 okIrt5nCGiwZquz8z6Tcyeh4z9yfQ8NmCGRWMs20bAdqR3TQTCUFYHD/HbFHxFL2+j1g ZILwoCKUR2Y7eoJjLA3A19nPL+QCKUo8usj6bDyKU7BoOSLjVlQGTnek7+FxxfWHVc3e rw8o24WHu6398n2HES1k61TM+jBV2v6d4clchKKNPVAQ87vmQ3Pu9210DCzWDCFITphK /vLw== 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 u24si1217487pgf.207.2021.04.29.13.50.51; Thu, 29 Apr 2021 13:51:05 -0700 (PDT) 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 S236825AbhD2UuJ (ORCPT + 99 others); Thu, 29 Apr 2021 16:50:09 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:54623 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231201AbhD2UuG (ORCPT ); Thu, 29 Apr 2021 16:50:06 -0400 Received: from mail-wm1-f41.google.com ([209.85.128.41]) by mrelayeu.kundenserver.de (mreue108 [213.165.67.113]) with ESMTPSA (Nemesis) id 1N4yyQ-1lUlMv1UpQ-010wy8; Thu, 29 Apr 2021 22:49:17 +0200 Received: by mail-wm1-f41.google.com with SMTP id 4-20020a05600c26c4b0290146e1feccd8so521816wmv.1; Thu, 29 Apr 2021 13:49:17 -0700 (PDT) X-Gm-Message-State: AOAM533Lsa8YXw7vetbN82yaMhNUIX/cxsJQ3o0zJumPSHkeUDH4ZlrO E2NdMfX1mGTztpCj5Y3ak1IEvnDZGYHfo9QU+VU= X-Received: by 2002:a7b:c4da:: with SMTP id g26mr2183043wmk.43.1619729356972; Thu, 29 Apr 2021 13:49:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Arnd Bergmann Date: Thu, 29 Apr 2021 22:48:40 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: siginfo_t ABI break on sparc64 from si_addr_lsb move 3y ago To: "Eric W. Biederman" Cc: Marco Elver , Florian Weimer , "David S. Miller" , Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Peter Collingbourne , Dmitry Vyukov , Alexander Potapenko , sparclinux , linux-arch , Linux Kernel Mailing List , Linux API , kasan-dev Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:Y5+kRV9UPqKJX/D/7aStG7U/Py7dIw+sGe7g3Wp8tNykx536WRq iv7bhZcLn7MPQIK+Gsjut2r2Itj6RnUpzjoS5iGld/vCXEhrGh/Df0y2laAfdIIVWqQjYsF qJI0oQN0aJfc67ZCbPr2aLvhIAp+UGPF3D9E0vMbh/JrPrLq+vGNDfq5TQtBp+fTWKRYaCR rOsFCo+6OdKTmhFtRMwow== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:0gnD6TDUOGU=:VQyZMBvfQy1PO9+fgiyh4r ueF8VvNBMmTBRRaDtlb+077rlOEFzdMgDjMwS8Okn2sDCgz5IB1TForHNfA5k5lhFjLK0S7sa BxWimh/mdubIO40EmLhbOs2XjMv1rr4YzC2flihFITSBaO5rL9M1fldhPs0zLjfveHNV63g1D BB5XqARpRCbi81hm89Yn56Qy0c3NWBA/6SZBrw0KaUjiQGPY3F3j5bozH7lhroDbXOEbW8l0W +cklcRFYePQw18i4fS0Z9l5WohNFS21H3x5xVSZuaerf1tDra5KIZDBQyN0SBga36FYnO55Gp RC1JrkceZDDqfYOMmRjkWp5jRdcN9CsCDOlwZyZTnzOoSW/OpgbIMYl5CurgWd0ugiETJDykW x93WVKNNyY8jyryfbqgyUdBjfpQHpPFnTbvlBkn8hsZyuMnTPj+XWRDHdZ9SF7fez1BWkcHb6 Y3rBRdFmnueYn6OdAW+QeId4qwhnyb5NNmxUUa9H0Nw/qb65slp5VdjlBYnAqNTeX+mT6Vkpl P0p7x9WVPIkywSg84RUSk0= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 29, 2021 at 7:23 PM Eric W. Biederman wrote: > > Which option do you prefer? Are there better options? > > Personally the most important thing to have is a single definition > shared by all architectures so that we consolidate testing. > > A little piece of me cries a little whenever I see how badly we > implemented the POSIX design. As specified by POSIX the fields can be > place in siginfo such that 32bit and 64bit share a common definition. > Unfortunately we did not addpadding after si_addr on 32bit to > accommodate a 64bit si_addr. > > I find it unfortunate that we are adding yet another definition that > requires translation between 32bit and 64bit, but I am glad > that at least the translation is not architecture specific. That common > definition is what has allowed this potential issue to be caught > and that makes me very happy to see. > > Let's go with Option 3. > > Confirm BUS_MCEERR_AR, BUS_MCEERR_AO, SEGV_BNDERR, SEGV_PKUERR are not > in use on any architecture that defines __ARCH_SI_TRAPNO, and then fixup > the userspace definitions of these fields. > > To the kernel I would add some BUILD_BUG_ON's to whatever the best > maintained architecture (sparc64?) that implements __ARCH_SI_TRAPNO just > to confirm we don't create future regressions by accident. > > I did a quick search and the architectures that define __ARCH_SI_TRAPNO > are sparc, mips, and alpha. All have 64bit implementations. I think you (slightly) misread: mips has "#undef __ARCH_SI_TRAPNO", not "#define __ARCH_SI_TRAPNO". This means it's only sparc and alpha. I can see that the alpha instance was added to the kernel during linux-2.5, but never made it into the glibc or uclibc copy of the struct definition, and musl doesn't support alpha or sparc. Debian codesearch only turns up sparc (and BSD) references to si_trapno. > I did a quick search and the architectures that define __ARCH_SI_TRAPNO > are sparc, mips, and alpha. All have 64bit implementations. A further > quick search shows that none of those architectures have faults that > use BUS_MCEERR_AR, BUS_MCEERR_AO, SEGV_BNDERR, SEGV_PKUERR, nor do > they appear to use mm/memory-failure.c > > So it doesn't look like we have an ABI regression to fix. Even better! So if sparc is the only user of _trapno and it uses none of the later fields in _sigfault, I wonder if we could take even more liberty at trying to have a slightly saner definition. Can you think of anything that might break if we put _trapno inside of the union along with _perf and _addr_lsb? I suppose in theory sparc64 or alpha might start using the other fields in the future, and an application might be compiled against mismatched headers, but that is unlikely and is already broken with the current headers. Arnd