Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp3683055rwp; Sat, 15 Jul 2023 07:27:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlEWKWsIxBQdjNzBw85yyrFkEjr48CMcUn/HLAknWW17tz8IIC3t/bTaZZ/M+lU6/zreYeMB X-Received: by 2002:aa7:d7d1:0:b0:51b:c6d8:71b5 with SMTP id e17-20020aa7d7d1000000b0051bc6d871b5mr7107073eds.22.1689431251155; Sat, 15 Jul 2023 07:27:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689431251; cv=none; d=google.com; s=arc-20160816; b=F2jm5SbthATbTRjbctcV3piOtnSVMtDiAlb1WmgDNOfretcOrUwXplRpVimkprl+wl YwwJq+HE1g8aYta4zbyo4rKf2OkW6/oX+DyfhEjzXxPnQnjy17zbTRfPyLI/FNwJVIgI 8hy+gW8Vde+5QzJowj8W2FgFf0g6ybhI3odyD78g9ijNHRAw4ppd1/GmFUPlH0EnmhdA lcRMs+oEEAzHz4LTTsdCbyUtZlm3H6MgmLbrC6cu+LRQAE1rHKoCS50B1c2sRDyIDF/p YfFxP2dQZj1eCFVkt3TMcGVsWP0qfPpjKkMfBws7HkqttumSXjykv3qFvbQ2I0Hnv621 R5JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=NgkcBe+eB7Csc+Gi/e5UdYxcks5oWoeS5M2PXyiSPV4=; fh=PEety428AVvX1EZtCBANLlNFZAnT8x+b341x0LdHJ9Q=; b=joC/CZV4CKLnA2xTMg0BkjB8QTwmw+eA2VL6daVT1XYJWqEapayHuYlwazOUWkySgG q94g6pC409qib/UfmMQY3zHLVDRAA+oesSYbpQePB/AHeJ9JBd1rmhnNuqwuz/iHZaAQ SC5KMTtVkHvbd9lkq3VQUkqSotzDVKaZlUZDGuSIONie3+9UzkzYfiXlP+JGa3ioR+Cx 9c552NGI4od6lqLLsSuuPxWk1sbQ7A+nBQ58gzxBXWk3y2sioy+9SPOv+YMRECcjoEWw oV40IaUk3o62Lyr1tPEfnmp6EFOaUiTKbYGuuJSJqdXQXHGvep2UZjdUL1oDx3JDoUjq xFDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20221208.gappssmtp.com header.s=20221208 header.b=gp6+jueB; 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 r7-20020a056402034700b0051defda017esi10769228edw.506.2023.07.15.07.27.05; Sat, 15 Jul 2023 07:27:31 -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=@kernel-dk.20221208.gappssmtp.com header.s=20221208 header.b=gp6+jueB; 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 S229506AbjGOOG3 (ORCPT + 99 others); Sat, 15 Jul 2023 10:06:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229549AbjGOOG2 (ORCPT ); Sat, 15 Jul 2023 10:06:28 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61216F3 for ; Sat, 15 Jul 2023 07:06:27 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1b898cfa6a1so4009965ad.1 for ; Sat, 15 Jul 2023 07:06:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20221208.gappssmtp.com; s=20221208; t=1689429987; x=1690034787; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=NgkcBe+eB7Csc+Gi/e5UdYxcks5oWoeS5M2PXyiSPV4=; b=gp6+jueB2lVhLbMiQMzs9xH/n17AiwvDryMVEdZMXMjZ1g/x8P03LSRxqWZepQ+GN9 AMxmFRQ/pgjlI5lTXHi14zhgU/tzUks6AzU9WWVXUbpCCzq6755r5Yev08oaVVNGKsrs dmuzbz1KOzSGPMd936eDyeLB19mWm8ROOvX2krl+GZK0yJHIne56lkOVf6eYqRExVBz+ zCWpy5I/7PYqnsfCxdq+hPi2hKRav6AF7/iO8rDdQnpPIFrTzqU+tvM9L5TQyqF433ef tzhm2Ew05gnmofai7TuPYlaRuL8RqFY34IHbgkGAgoqEap2jk6FxV2PflrwdkUPnpU+I SKbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689429987; x=1690034787; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NgkcBe+eB7Csc+Gi/e5UdYxcks5oWoeS5M2PXyiSPV4=; b=gQya6pxSpRF6rDUwDmG5MJT0WgXGbuAWY6LlAJ7pqrMXe0LV0zQBb7vH8ECkUxCZF4 zXkkbknKmzToB5Twh9joM6rpGDkNjN8/khfc2Lfq0nw8Ijlluzr3TdK10Cp514fAFy5N StZC0Yv9w1l8+Ok49DLbeFFC51C0uHvenG+9KzBIFcmm2udprbalYnRNQmJKgfu52ljV LUDkS00k7Lc5H+7/WJIapXhjitiS5eVnCPM3AzERBaAEE7IOUPpsw3QDh9/LGXVeCxk8 WQ/wNwcOad7XPtZtQh6jDE6emmbV/c6HiNqMAD1bKLdbr0e4PlXgn4X+Ev5Y62VQXjVr mlHw== X-Gm-Message-State: ABy/qLaff1NP1CRVHJLnS77CAQqJLKHiitAmSj1s2zm7iq8eIMmWGbhy qVF97gqAA5YCW8khLW/zvLvNCg== X-Received: by 2002:a17:902:e84d:b0:1b3:d4bb:3515 with SMTP id t13-20020a170902e84d00b001b3d4bb3515mr2592580plg.0.1689429986748; Sat, 15 Jul 2023 07:06:26 -0700 (PDT) Received: from [192.168.1.136] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id q1-20020a170902788100b001b80760fd04sm9522484pll.112.2023.07.15.07.06.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 15 Jul 2023 07:06:25 -0700 (PDT) Message-ID: <509f35fc-72dc-8676-4e3a-6bbc8d7eefb4@kernel.dk> Date: Sat, 15 Jul 2023 08:06:24 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH 5/5] io_uring: add IORING_OP_WAITID support Content-Language: en-US To: Arnd Bergmann , Christian Brauner Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org 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> <57926544-3936-410f-ae0e-6eff266ea59c@app.fastmail.com> From: Jens Axboe In-Reply-To: <57926544-3936-410f-ae0e-6eff266ea59c@app.fastmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,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 7/15/23 1:12 AM, Arnd Bergmann wrote: > 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. Yeah, took a look too this morning, and not sure there's much to reduce here that would make it cleaner. I'm going to send out a v2 with this unchanged, holler if people disagree. -- Jens Axboe