Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1395253ybb; Thu, 9 Apr 2020 00:57:55 -0700 (PDT) X-Google-Smtp-Source: APiQypK+EcXPnSyvX1aCn0cSLEqgvOB1WiJjsyeaFMCiKH50BvpSA7qRGJSOzloXJeEv/C7VgxWD X-Received: by 2002:a4a:cb91:: with SMTP id y17mr2880138ooq.51.1586419075760; Thu, 09 Apr 2020 00:57:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586419075; cv=none; d=google.com; s=arc-20160816; b=q0e+bviko1rsFOvIJ1mZCWUZXAjbttGb7mWQsrpoo4OGr9Y3+S4PzfjrRyR8ZlQ/WQ Fjtolj1sCWsEyrPiPAX0peuC5Zhtf5+lf21UX2A/eVpQWjuyA8OlBSADAGkybk1jeeC3 SJ8jivdrGqgt6cZmwYfqVxgPZj757aPvz/h2ReC9y01If0rCEeUwTbS6+b8Nk82qDmFj jAhcHeb2nNQTq6Sl+1xqy9WrYLr+xGdzS4jnSBBURz8++Sil96Nl66MB+j6os+aFVuAn WiGqKTCBXinAIHNTn6yt6KJdTM0vNUiBh7ThoyiwPAS7LwSupii1+qRwsoJ/07YlrS95 WHkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :content-language:user-agent:references:message-id:in-reply-to :subject:cc:to:from:date; bh=9TY+pgieP7pGkjLjEN0Ze3P7USnk6J7masGmFdZ5kkU=; b=bzMLZX8u+oItbg8bal+6SW41Safxa8FOW6xiyWu5uEON1WOpO7eXjAUv39r9nv4nXO rUdpyCQehgT3UVf6Q2tf677swbVDUClLf3DWtwwkkPsPREZ304ps+Qym8pLGAeJXPSjo wcsYj0LuddVyFCOlnrfxCO2OxAvN8a2r+kVKx44ujFVwAXgcrGWRLCgBNiPYo6jPFunM Jx4CqOfbAnHAsrEMBhvIvtOdSWLoZA1Cgct0ScbSFFtLgDNDv/jjkK8wYK5XKA9kqCjt 3a8kktuxUSMJELwDZxQeLgI1w9RgizXAe2OpSF7yKpPt/diJGeKNT/0WkxwkcaZ36wWy xUJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k185si3429134oif.13.2020.04.09.00.57.40; Thu, 09 Apr 2020 00:57:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726470AbgDIH5C convert rfc822-to-8bit (ORCPT + 99 others); Thu, 9 Apr 2020 03:57:02 -0400 Received: from lixid.tarent.de ([193.107.123.118]:44812 "EHLO mail.lixid.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725972AbgDIH5C (ORCPT ); Thu, 9 Apr 2020 03:57:02 -0400 X-Greylist: delayed 542 seconds by postgrey-1.27 at vger.kernel.org; Thu, 09 Apr 2020 03:57:01 EDT Received: from localhost (localhost [127.0.0.1]) by mail.lixid.net (MTA) with ESMTP id B721814094B; Thu, 9 Apr 2020 09:47:57 +0200 (CEST) Received: from mail.lixid.net ([127.0.0.1]) by localhost (mail.lixid.net [127.0.0.1]) (MFA, port 10024) with LMTP id L4OhUbqpilQB; Thu, 9 Apr 2020 09:47:52 +0200 (CEST) Received: from tglase-nb.lan.tarent.de (vpn-172-34-0-14.dynamic.tarent.de [172.34.0.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.lixid.net (MTA) with ESMTPS id 4FB5D1406B0; Thu, 9 Apr 2020 09:47:52 +0200 (CEST) Received: by tglase-nb.lan.tarent.de (Postfix, from userid 1000) id 0662B5203EC; Thu, 9 Apr 2020 09:47:52 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by tglase-nb.lan.tarent.de (Postfix) with ESMTP id 038A352034C; Thu, 9 Apr 2020 09:47:52 +0200 (CEST) Date: Thu, 9 Apr 2020 09:47:51 +0200 (CEST) From: Thorsten Glaser X-X-Sender: tglase@tglase-nb.lan.tarent.de To: Andy Lutomirski cc: X86 ML , LKML , Thomas Gleixner , 954294@bugs.debian.org Subject: Re: __X32_SYSCALL_BIT being defined as UL constant breaks userspace In-Reply-To: Message-ID: References: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) Content-Language: de-DE-1901 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 8 Apr 2020, Andy Lutomirski wrote: > One might reasonably ask whether it makes sense for syscall nrs to be > signed at all. It doesn’t, but it’s probably this way for hysteric raisins. > But regardless, this breaks userspace and we should fix it. I can > whip up a patch to split it into X32_SYSCALL_BIT (unsigned long) and > __X32_SYSCALL_BIT (uapi, int). Thomas, etc, does this seem This would help with the issue, thanks. > reasonable? (For those not following all the machinations, this > change caused some userspace build failures in libseccomp and/or > systemd for reasons that are vaguely silly.) Not very silly: printf("%d\n", __NR_mmap); That with -Wformat and -Werror (or -Werror=format) rightfully warns, as the compiler cannot, on x32 (where int=long), detect that, on architectures where int≠long the constant is int. Even worse, switching userspace to unsigned long globally would completely hose this on LP64 architectures. So this is, in my opinion, completely justified. (Disclaimer: I’m not affiliated with systemd and not even running it except udev.) bye, //mirabilos -- tarent solutions GmbH Rochusstraße 2-4, D-53123 Bonn • http://www.tarent.de/ Tel: +49 228 54881-393 • Fax: +49 228 54881-235 HRB 5168 (AG Bonn) • USt-ID (VAT): DE122264941 Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg