Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5168341rwb; Mon, 31 Jul 2023 20:12:41 -0700 (PDT) X-Google-Smtp-Source: APBJJlEtPP+sEPMnHi5bi1NjphYzvtKyt37T+zXfTfVxeqV2t+8/Qibdlly94ay7+qlT6hFlOsC1 X-Received: by 2002:a05:6a21:7889:b0:117:3c00:77ea with SMTP id bf9-20020a056a21788900b001173c0077eamr14885652pzc.0.1690859561593; Mon, 31 Jul 2023 20:12:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690859561; cv=none; d=google.com; s=arc-20160816; b=d8h1UW4B93xla0926ZtC72hAbI8usl6TH6wNKB5p3vbBUQSfnBJ2nyqEtdonhR6XKc ab5VFZUUjtYLHUF59ubvOiYi0BZr1OuEKXIT73FhGlWc+D0QUzyz2+gbMw92jKw4ueuR 27uzAVMhiJH+13kh8RzeK8aP7xvI0VP3fEW4UN1xc93MWzDuDCXg+4xazdeCCy0QKlZy 3HzlDkC5kW5DRH53Sg57dPagI9NltdoRFr62cU4o9lvAvURP/DrYlbB4tvRKCkRo5wBT QR1hvUIpBKoQwAUoQC9BCiXnukZgpZRTmCHB3t8gxVW7Ki3g43lUPybspizcb3ovWkZL pPoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=334XzK4sUQw29izKxXhVMPDqKOQOFm4Il91KEG4/Jt8=; fh=KQ90Ttb+hjRhrqohgBrNlB8erbx4b2chdheTEAKjJt8=; b=fbII42gD8J+OUZ3h4a8QkFWON1N4szuHXuYLI6aFOmJJomm75bhtdKr4pTIWKvsii5 mp8Q7iKHs5Dssiska7n+HNhMrYhU1L22M6hAl2R5cGQDtCQebclIa2LciOB+HSXy2srb 28MFZZsM9rgO9PPC8zmod7CHEFpci3pbAtLw1YkbF7fqBUP42pyPVmcbn9C2S1aux28k P15M+yO/yr0RZldL2YmEJnbq+yjuoEMHzeJxfqUUa3mZ2i+md+H8VCoUyOPBvQmEn5zd DKmeaf7lGywPwIuEhcHjGe4zOhU3aBPVx+quwgE6gzN00UT2/xshq+wJ7VuuFDFZiRuw xrsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@jrtc27.com header.s=gmail.jrtc27.user header.b=AanWT0ep; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a32-20020a056a001d2000b006870b977759si5319889pfx.382.2023.07.31.20.12.29; Mon, 31 Jul 2023 20:12:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@jrtc27.com header.s=gmail.jrtc27.user header.b=AanWT0ep; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231868AbjHABjD (ORCPT + 99 others); Mon, 31 Jul 2023 21:39:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229724AbjHABjC (ORCPT ); Mon, 31 Jul 2023 21:39:02 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 317E019AF for ; Mon, 31 Jul 2023 18:39:00 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3fbd33a57ddso47613205e9.1 for ; Mon, 31 Jul 2023 18:39:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jrtc27.com; s=gmail.jrtc27.user; t=1690853938; x=1691458738; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=334XzK4sUQw29izKxXhVMPDqKOQOFm4Il91KEG4/Jt8=; b=AanWT0epf4MShymtvLHSoWkqKvnKTGhrbmMCLffmEcS1CZjw8L7jFwYSCsFdgUcL+Z Iua3Oqaxp09HrQQgzuwpFyI5cF3gXPBLJJXuGQBa2t0AcBlizvEOGzVMsh/JDRqWcEQC zteelzy/yhv3CD8KjnNO0skVQxoynGmIo7om1Ybg9l6I059Zt95hAUGhT2ulawoaKQUF 4JsH6df2C0ZfdxLKPNecs5YoHVCECzKCyipbND4c+Fwnjty7bfvCMvmYksUpd8bz+tH4 YN1/EAis5L2eKJ8SWevWA9tEndLzJ4C3SPzwIgsfbXTSQ4mt6hi2nmX6UNfZsGHVnFBS /p4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690853938; x=1691458738; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=334XzK4sUQw29izKxXhVMPDqKOQOFm4Il91KEG4/Jt8=; b=EHhUNsAKp7hIGaHYfvCjemyliJYfp1xORE/Zxp3c9c/Pim77D+fETXvMllkiSA+DiB KlysR863twPmHcWa7xnq3/mabWyEnNuB+6eBpdTLzjsFXCYcUGaC5q/94Z6lwZbRUNMn 53CRFZ9n04i682Dn/7fxIK2a6tRF9dHbOYYCUjTg93pcuJgVMjenF/yyvuo52E99llqC U6z1dv8HAxMD8bNosHBa43uY1eZfsbypFPPBScWPymc7Hxh6zizvhAfCw5Xzz0/Mi1MU HPLQcnVt5/bMf8Ph0SkwWrlihvEFY1GfhnswivbpLb6FGXnIMsX0lubJwqeUHwzTxuyb 3ivQ== X-Gm-Message-State: ABy/qLYasxJGcAXBitKje6AGtMD6ZWPHLDseYmOUu6vH7MFUY7do428U 0z36UDcDKumGMVVLvL7X4+lggw== X-Received: by 2002:a1c:f019:0:b0:3fb:b5dc:dab1 with SMTP id a25-20020a1cf019000000b003fbb5dcdab1mr1043631wmb.39.1690853938565; Mon, 31 Jul 2023 18:38:58 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.246]) by smtp.gmail.com with ESMTPSA id u13-20020a5d514d000000b003172510d19dsm14657118wrt.73.2023.07.31.18.38.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Jul 2023 18:38:57 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: Re: [PATCH v2] x86: Fix x32 System V message queue syscalls From: Jessica Clarke In-Reply-To: <347eab9f-b64a-b124-ba7a-ee458e6407f3@gigawatt.nl> Date: Tue, 1 Aug 2023 02:38:47 +0100 Cc: Andy Lutomirski , Rich Felker , linux-x86_64@vger.kernel.org, Florian Weimer , Thomas Gleixner , Ingo Molnar , Borislav Petkov , X86 ML , "H. Peter Anvin" , LKML Content-Transfer-Encoding: quoted-printable Message-Id: <5C330BFF-A81A-465D-BE7D-6DB6A7B263AF@jrtc27.com> References: <1156938F-A9A3-4EE9-B059-2294A0B9FBFE@jrtc27.com> <20201012134444.1905-1-jrtc27@jrtc27.com> <20201101012202.GM534@brightrain.aerifal.cx> <7842A462-0ADB-4EE3-B4CB-AE6DCD70CE1C@jrtc27.com> <20201101015013.GN534@brightrain.aerifal.cx> <04832096-ED7F-4754-993D-F578D4A90843@jrtc27.com> <20201101210102.GO534@brightrain.aerifal.cx> <29423184-A433-42D4-B635-CDEFE7271B40@jrtc27.com> <2AC632C0-EC00-4C4E-92DC-B7F238897C4C@jrtc27.com> <347eab9f-b64a-b124-ba7a-ee458e6407f3@gigawatt.nl> To: Harald van Dijk X-Mailer: Apple Mail (2.3731.600.7) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1 Aug 2023, at 01:43, Harald van Dijk wrote: >=20 > On 06/12/2020 22:55, Andy Lutomirski wrote: >> On Sat, Dec 5, 2020 at 4:01 PM Jessica Clarke = wrote: >>>=20 >>> Ping? >> Can you submit patches implementing my proposal? One is your = existing >> patch plus fixing struct msghdr, with Cc: stable@vger.kernel.org at >> the bottom. The second is a removal of struct msghdr from uapi, >> moving it into include/inux (no uapi) if needed. The second should >> not cc stable. >=20 > Hi, >=20 > This looks like it was forgotten, but it is still needed. Jessica, are = you interested in submitting the requested change? If not, would it be = okay if I do so? I have been running this locally for a long time now. Hi, Please feel free to; sorry that it dropped off my radar. Part of the issue is my laptop no longer being x86, making it more annoying to test. > There is one complication that I think has not been mentioned yet: = when _GNU_SOURCE is defined, glibc does provide a definition of struct = msghdr in with a field "__syscall_slong_t mtype;". This = makes it slightly more likely that there is code out there in the wild = that works fine with current kernels and would be broken by the fix. = Given how rare x32 is, and how rare message queues are, this may still = be acceptable, but I am mentioning it just in case this would cause a = different approach to be preferred. And whatever is done, a fix should = also be submitted to glibc. Given POSIX is very clear on how msghdr works I think we have to break whatever oddball code out there might be using this. The alternative is violating POSIX in a way that makes correct code compile fine but fail at run time on x32, which is a terrible place to be, especially when the =E2=80=9Cfix=E2=80=9D is to special-case x32 to go against what = POSIX says. I just can=E2=80=99t see how that=E2=80=99s a good place to stay in, even if = something might break when we fix this bug. Thanks, Jess > (musl define struct msghdr as well, but defines mtype unconditionally = as having type long, so if this approach is still preferred, needs no = changes.) >=20 > Cheers, > Harald van Dijk