Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp3371500rwp; Sat, 15 Jul 2023 01:01:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlFxm4o+aQyiOxY9bc4tmXfCc+8bvs+E+y6yrPho+5i9rXfgR/KgMZBnApGY/4EztHMrKcUM X-Received: by 2002:a05:6402:268b:b0:521:66b4:13b9 with SMTP id w11-20020a056402268b00b0052166b413b9mr1689174edd.0.1689408070354; Sat, 15 Jul 2023 01:01:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689408070; cv=none; d=google.com; s=arc-20160816; b=OkWLvjcZfHfSgWrfxzJYHQ58ZDQwXGBmIPpScjrPfSOJD/GPrSTnRgwNujORCNNG7y oVLvdBfj0tgT/vHMxVMKYGLKV245DqffaRoNQMLTymbW1Vmhh09DJOGTl2NVzrTB24R8 AAjHNtkqyr46NUfLkDF4CGiYeeeXYPSEcMVrgW3uYKGhqr+lo/SljYqDwq//vCOTtdCX C14u5dpzYr2DfDUDf/RcPc7IHazHhBR4CRnSqBnQDy7YoWoFzWv7HWFukpOPSgJDlujB FhHSda0X/Dq2GuBH7H0Xz0vHeA48yiao4CQsae2TOVZ+B2hoC/lMyJF1Nbw9+dvlHXoz F6aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=NPZdg7U5OFteWw9mt8dxF3+d1wDU2AjLnh9vC531+Dw=; fh=3hiNGV9Gnzi2SAiT35IoFbVTbn46Po/FsXNPNpcBRCA=; b=Bp8zaFGrKx4OtVX1NBRGMrcGNbmCS0laO07GiNSMGYxk7uxXffT+C2SH5Nao/517KC ndWg8U33MsvoBNfPzOWs+duk0tjja8PEgHCeGqCJpLx4BGcddJoTf+3/MXcFIvGNEkMw +gF2hISrMaQ/g59x0YCpA9aTwunSQ3tEpE8/d+l37svXxeuAD4Kq3+pBWxcS66DpomM0 VjWIpldhBAWjrjoyGKWDJ+PTLl9OAgW7t2gZsbKsDA8K/5P+ZjCc3GJqtw021zGfVel8 WvL2adUI86+QDtohbm7Souln7MJJshHXVthvUSXce77ui3xIJlTkxLRpQzdtNjdVeUh3 KVlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=R4emI4Fz; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=T3hBSK9N; 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 g6-20020a056402180600b0051e2ccf8121si10323538edy.631.2023.07.15.01.00.46; Sat, 15 Jul 2023 01:01:10 -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=@arndb.de header.s=fm2 header.b=R4emI4Fz; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=T3hBSK9N; 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 S229930AbjGOHMk (ORCPT + 99 others); Sat, 15 Jul 2023 03:12:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbjGOHMi (ORCPT ); Sat, 15 Jul 2023 03:12:38 -0400 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FD93B3; Sat, 15 Jul 2023 00:12:37 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 8D17C32008FA; Sat, 15 Jul 2023 03:12:34 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Sat, 15 Jul 2023 03:12:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1689405154; x=1689491554; bh=NP Zdg7U5OFteWw9mt8dxF3+d1wDU2AjLnh9vC531+Dw=; b=R4emI4FzB/qbHnS4sI ErpYBlztRokW6tQLn39i1ez18R2u2jIAmWa//MDOjcq5oKGRG9Fj5JI0OtQfqJjb s5Cca0wXHq7Ca7a2HBM+pbGf4gCHyXXv73pIjzmL2Llq2eSW8grsxBkdgfzXO8w+ DxL75vTapBCynfdenaQ66ICYLutd4EuZ51GrM2lz6DBXc89B7guvAhyu0ADKuIrb wi1WAt+kyzDxa6xpV7G65jwjVHYZK7e13FgYBvE7AqgovgoQ9kwM7TOZPNbQDnwt WlsI/UazeW8UUpmPfSKRpP6vMuafmBBkjRHEL7gCLo2iJ9XAT31VjoUPwGhCzoMW 9d5g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1689405154; x=1689491554; bh=NPZdg7U5OFteW w9mt8dxF3+d1wDU2AjLnh9vC531+Dw=; b=T3hBSK9Numj+hlXwDTKXJ1TO83oV6 qpnKnoCzdLLmUJrVk/MfCtPUAmr2msVmX3wFbni4ls9g+pZrcYrfGXisZKWW1ucu nli4Q3zX68BoKxZuJUKLLofa9NNbGqk47tzOU39lihrk2l3jcGgN8dgfeEhJNGhd ifs7tD7R8FTOHRe5vTDlAeLpQR0OnXu4eKokUj8zWLkUkE4C3h8Dy5toZ0z1rif2 IwLR9lTG+lLHczDpy2rgGKkLHZcfHnAqkmD8+vzXjKSxvl1ayp9536k7pqu4VAIS Qnh5w1RmfOFlLAQ3fMMDK0gzQgec3NSDFXuvalxhO/7F2Il5Ih/OzG3+A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrfeejgdduudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepvdfhleffveegleeiuefhveekheeguefhfeejgfetffdtgeegveegteegudei ueefnecuffhomhgrihhnpehkvghrnhgvlhdrughknecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomheprghrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 86529B60086; Sat, 15 Jul 2023 03:12:33 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-531-gfdfa13a06d-fm-20230703.001-gfdfa13a0 Mime-Version: 1.0 Message-Id: <57926544-3936-410f-ae0e-6eff266ea59c@app.fastmail.com> In-Reply-To: References: <20230711204352.214086-1-axboe@kernel.dk> <20230711204352.214086-6-axboe@kernel.dk> <8431d207-5e52-4f8c-a12d-276836174bad@app.fastmail.com> <048cfbce-5238-2580-2d53-2ca740e72d79@kernel.dk> <20230714-grummeln-sitzgelegenheit-1157c2feac71@brauner> Date: Sat, 15 Jul 2023 09:12:13 +0200 From: "Arnd Bergmann" To: "Jens Axboe" , "Christian Brauner" Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/5] io_uring: add IORING_OP_WAITID support Content-Type: text/plain 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, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 Fri, Jul 14, 2023, at 22:14, Jens Axboe wrote: > On 7/14/23 12:33?PM, Arnd Bergmann wrote: >> On Fri, Jul 14, 2023, at 17:47, Christian Brauner wrote: >>> On Tue, Jul 11, 2023 at 04:18:13PM -0600, Jens Axboe wrote: >>>>>> Does this require argument conversion for compat tasks? >>>>>> >>>>>> Even without the rusage argument, I think the siginfo >>>>>> remains incompatible with 32-bit tasks, unfortunately. >>>>> >>>>> Hmm yes good point, if compat_siginfo and siginfo are different, then it >>>>> does need handling for that. Would be a trivial addition, I'll make that >>>>> change. Thanks Arnd! >>>> >>>> Should be fixed in the current version: >>>> >>>> https://git.kernel.dk/cgit/linux/commit/?h=io_uring-waitid&id=08f3dc9b7cedbd20c0f215f25c9a7814c6c601cc >>> >>> In kernel/signal.c in pidfd_send_signal() we have >>> copy_siginfo_from_user_any() it seems that a similar version >>> copy_siginfo_to_user_any() might be something to consider. We do have >>> copy_siginfo_to_user32() and copy_siginfo_to_user(). But I may lack >>> context why this wouldn't work here. >> >> We could add a copy_siginfo_to_user_any(), but I think open-coding >> it is easier here, since the in_compat_syscall() check does not >> work inside of the io_uring kernel thread, it has to be >> "if (req->ctx->compat)" in order to match the wordsize of the task >> that started the request. > > Yeah, unifying this stuff did cross my mind when adding another one. > Which I think could still be done, you'd just need to pass in a 'compat' > parameter similar to how it's done for iovec importing. > > But if it's ok with everybody I'd rather do that as a cleanup post this. Sure, keeping that separate seem best. Looking at what copy_siginfo_from_user_any() actually does, I don't even think it's worth adapting copy_siginfo_to_user_any() for io_uring, since it's already just a trivial wrapper, and adding another argument would add more complexity overall than it saves. Arnd