Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp2632242rwp; Fri, 14 Jul 2023 08:58:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlGO5w8cGlRmDSdeY8b0jAx9xkWNnSXPrBd8anjpLH9Gi5WtvsZRDDv9G8GA0831hwbEbePT X-Received: by 2002:a05:6a20:8e1c:b0:12f:f9af:3a2a with SMTP id y28-20020a056a208e1c00b0012ff9af3a2amr5027479pzj.54.1689350301572; Fri, 14 Jul 2023 08:58:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689350301; cv=none; d=google.com; s=arc-20160816; b=kiFlt8q3lacMeCfmqX0ltC8euTEaAlxOlRVTHEz3JpzoYQ+nLEMoRhNdT7uBh05wo1 z5lYFbuCEV8dqywzA/3gC3bDZPQSCJ58uqt7ijWQavPHN0xqR9LZW4rb4gMkHpFxaNXs twEuaKQ6q+pSpsjpu3s/A9dOEvSSifnbfM+wS1Mz2NM6VBPH25bw5KEAFHgsyiTnjeRz 7tZ6km3g3NnWoi3jpPjy0X8TpLtUoi2wDQDdBmfjDJGNTcJW6A5nYP0QZ9aPTftlmhR3 i1aWruHO5cBSuKcoLqT3TT0H/iMXGgGT2LtICSc9KEZ9gd7SgQiiDPQAZkwr/1ycraJg 1Quw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=EKBy0YNGObpgB1BmUC/uePhrcJSLmzMkm+Has0CB9Ns=; fh=JdtR/lO+vOQUXJ4ioCfFKkCw0TkiHVkDV0x+Etoa7vg=; b=uoC7aiGj52Im9YEWgwxJzzQ+Szo4tooioiUYQLNSL57T04FRw+EfbiqozSoPFxBt3F fI6kJVh6lXPJIVNV8VMu6iCGNtJzYfsdo6MZffUw+n/zRYXIs3AIyJOv1YbrfCDEMRGl /x6FFCUixZIncdUovzMupzi5dQWUNOKSt8FjRXd7JgpUU7/C0mounTXwS9sunKMSOX4D BSfHw3B7uj1s08hjuEIKkRowJSM+HrUb/krzJxhIGw/pLd4rYDNMI90GAgnbAWvtevAJ irrx2SntPd26vyZbXu6Jx978XSA9WVytF1I1EcNBpNnEgXjY2n1STjWLPF8nZrPDlmWl tgqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m7GjHJfH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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-20020a636b06000000b0055b602e0b55si1938012pgc.831.2023.07.14.08.58.09; Fri, 14 Jul 2023 08:58:21 -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.org header.s=k20201202 header.b=m7GjHJfH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236132AbjGNPrz (ORCPT + 99 others); Fri, 14 Jul 2023 11:47:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236139AbjGNPru (ORCPT ); Fri, 14 Jul 2023 11:47:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED0BA30F8; Fri, 14 Jul 2023 08:47:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8750C61D53; Fri, 14 Jul 2023 15:47:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2B66C433C7; Fri, 14 Jul 2023 15:47:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689349669; bh=zFqlmjpsUpD+jmVpoeLIgKaEz5lAVss4HVnOntoEqqQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=m7GjHJfH1Mk4J4pGHhjKC67W9RKCBexZJhPfF9tKMuI83eOxxqj1V6rwDDu6ba5pE 9FoyW5Yz1b3DjoSTPdDCPI+iw/BcH1oRafGZOLQvkkP0C0HR0LTKpqhhSUkWkpxxRV I+8NnBmAlPWi/P55EhXkMVWNQb96dtwGLV0FCY5o7YaS2scTIiKLlFEWaq+lNl9Zo3 KP9Od2ztH1bo4NnGWBI/VK4R4LtxQDiU1MUaNRc15XZ5tLHLeAFQhDgipPGaHaA1GM wTh2NS6yVx/NRkle4gD31WtyCHW2RhtmaUltblWcWuhQ+PBi37f6Kx6q0BgHxGiBSL AfDUF5t0Um3xw== Date: Fri, 14 Jul 2023 17:47:45 +0200 From: Christian Brauner To: Jens Axboe Cc: Arnd Bergmann , io-uring@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/5] io_uring: add IORING_OP_WAITID support Message-ID: <20230714-grummeln-sitzgelegenheit-1157c2feac71@brauner> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Tue, Jul 11, 2023 at 04:18:13PM -0600, Jens Axboe wrote: > On 7/11/23 3:22 PM, Jens Axboe wrote: > > On 7/11/23 3:11?PM, Arnd Bergmann wrote: > >> On Tue, Jul 11, 2023, at 22:43, Jens Axboe wrote: > >>> This adds support for an async version of waitid(2), in a fully async > >>> version. If an event isn't immediately available, wait for a callback > >>> to trigger a retry. > >>> > >>> The format of the sqe is as follows: > >>> > >>> sqe->len The 'which', the idtype being queried/waited for. > >>> sqe->fd The 'pid' (or id) being waited for. > >>> sqe->file_index The 'options' being set. > >>> sqe->addr2 A pointer to siginfo_t, if any, being filled in. > >>> > >>> buf_index, add3, and waitid_flags are reserved/unused for now. > >>> waitid_flags will be used for options for this request type. One > >>> interesting use case may be to add multi-shot support, so that the > >>> request stays armed and posts a notification every time a monitored > >>> process state change occurs. > >>> > >>> Note that this does not support rusage, on Arnd's recommendation. > >>> > >>> See the waitid(2) man page for details on the arguments. > >>> > >>> Signed-off-by: Jens Axboe > >> > >> 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.