Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1390462ybb; Thu, 9 Apr 2020 00:49:06 -0700 (PDT) X-Google-Smtp-Source: APiQypKLf0DLxJHqsS5XAbW0xQf8MHWc/Oe4u3EBDIZSmiGsijeU+uIN5ZuaWYqfNXQ3BlPaB8FQ X-Received: by 2002:a4a:355d:: with SMTP id w29mr9121151oog.41.1586418545878; Thu, 09 Apr 2020 00:49:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586418545; cv=none; d=google.com; s=arc-20160816; b=vgt9YqYyErrVf9QwJHiEPxG4mrlZ/htX7FmlXdF4BJoeWM/W4q60qYnFazKkaFQNdm dIVfCXnFA8xeoJ/xfx8Zmv9kSrOwy2pGHDu5OvaR8SPJ8DyY7uo7eZDGv5XA4IpgoK7S yRHKbwUFpmwQJgW6xQhXr6PfUyNNCv0at8G/7ookzQJQwL0UdwLDJoeVNoxTQ2LMe1D3 ydHOfP8MHXq9Cbuf7ZrC6Yx2fPWtM68ejRc18D12aSEQ6997qZHoDVL0NO7HLIY5E/I1 Le1L5yVRgVxeMBIJJU4khnxz0gQH4d7jHBWgpDdeDf4iYIx/xf085qceYQfku7+ugWlh aV1w== 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 :message-id:date:references:in-reply-to:subject:cc:to:from; bh=kMquGj/TNWB092YqoRzLBsCR/AvO57k76Nd92gLkf80=; b=h/9o/Wx8z8++bKNIJ13zQlKuTCU5VWMGBDH/ERwSPOrx6p3DjIgJGn3Im/Lm1vTubH YnRIYl7rHJHyzRorMFXghhNND8zlny8RNxg8U00p1yc6mZTu1mjB1KSj22Pfi4YprQpu 9Hu445Fj1lScuLO/KIa1L5ya+6WhagC61fCfQW5zBpKf7c4BSQNpQO6G/0zQesZdAgwx kyIOQNqZA3SntOaI7jl/CH+0SMuAzvBX6yofLbXOnA6KcrqZqLfjd5DYGGiVWNA4KZdd wKr6+BDpDd/c4+xB5EI22OhKg0B2jiaMSAcMLktu4qf3IsC4zJpi2WPu0peU+rPQa/4G To6w== 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 z12si3540828otk.227.2020.04.09.00.48.50; Thu, 09 Apr 2020 00:49:05 -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 S1726620AbgDIHrW convert rfc822-to-8bit (ORCPT + 99 others); Thu, 9 Apr 2020 03:47:22 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:51377 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725881AbgDIHrW (ORCPT ); Thu, 9 Apr 2020 03:47:22 -0400 Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jMRuA-00028z-83; Thu, 09 Apr 2020 09:47:18 +0200 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id A742D101150; Thu, 9 Apr 2020 09:47:17 +0200 (CEST) From: Thomas Gleixner To: Andy Lutomirski , Thorsten Glaser , X86 ML , LKML Cc: Andy Lutomirski , 954294@bugs.debian.org Subject: Re: __X32_SYSCALL_BIT being defined as UL constant breaks userspace In-Reply-To: References: Date: Thu, 09 Apr 2020 09:47:17 +0200 Message-ID: <87wo6pp0ca.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andy Lutomirski writes: > On Wed, Apr 8, 2020 at 7:34 AM Thorsten Glaser wrote: >> asm/unistd_x32.h:#define __NR_mmap (__X32_SYSCALL_BIT + 9) >> >> This construct is, thankfully, still usable in something like >> #if (__NR_mmap > __NR_somethingelse) >> but as __X32_SYSCALL_BIT is no longer int its type also isn’t. >> >> Therefore I ask you to revert this change, bringing x32 closer >> to all other architectures. >> > > One might reasonably ask whether it makes sense for syscall nrs to be > signed at all. > > 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 > 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.) Yes.