Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1751774pxj; Wed, 19 May 2021 13:05:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEZg0dTmYbimb1UkPQHIjEXoTchrVIrFt4qhhQc9nFztQUIrhfkHnJlZxkzxIUyYVbsUXk X-Received: by 2002:a50:c446:: with SMTP id w6mr846919edf.62.1621454718690; Wed, 19 May 2021 13:05:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621454718; cv=none; d=google.com; s=arc-20160816; b=aTDxuodYwtI6yx75uQHwycO4XB6mLE5uIJbIxSeBIv4U5RkKCXrvTPoWky1nIMrJxN 9SFCVR0hDmeF2SUMN6bLQosvU6Ja1J5aI4A4ar+XGPpE9zq8T9qIp9UaYsekhBHnS73X u2V2uIgT9cgvnxQs/Mlnc2tVgx3HplyB5HATxnCHgHxzv9z3TSYijZvwu2ik69PPELRh klzLP6e4803a2yRIaad2FqjKoe6tr8hUZUm7khwJtdhk9c1VeKqWDpkS1fllO21n3cR1 kTRISVtZQMIpoWIjBguskkeleqUx8C6kDORptcwOjnmBdXDmC2mAFgfnL6Xb9KA2uicc D3eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=I8t7IC8rszKDO64b8khK6AR6AKFnTbofVr0A+rLLUB4=; b=C7SCqPYp22SpCqs5KgM89Mzjlg9Wz8+1NZK8bmhLb0IF+LWfX6vxRBqQYSb1myHbj4 DktXdo70RmrX+uWQZX+ckioCV2flBlNvwzSpCf+3gaRQqKFhsElb4tsQGeSDSkXKSj/f EQBw1GSaNZeAEfIO8RLvgUzjCmsHfOW2rY9W+E7eL+GHv1Xocw0r1poEV/mChqiNlmPe V2cC9mY8oOh6KGBRz6G+wevIyBtAqvKvjIQrzA+CDe02dZWZqlWyv82ebUDZwn1cvLYi mn1bDn/aaZ9bC/mEGRg5i2qf14vUt8guFQmmj4pcPKZXIGr/4/G08LGu0OkMTVvwoD3n tKiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jfMrMsy5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w24si709445ejb.528.2021.05.19.13.04.54; Wed, 19 May 2021 13:05:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jfMrMsy5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354409AbhESORd (ORCPT + 99 others); Wed, 19 May 2021 10:17:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354090AbhESOP4 (ORCPT ); Wed, 19 May 2021 10:15:56 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3677FC061354; Wed, 19 May 2021 07:14:17 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id n2so14278159wrm.0; Wed, 19 May 2021 07:14:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=I8t7IC8rszKDO64b8khK6AR6AKFnTbofVr0A+rLLUB4=; b=jfMrMsy5UAAC10en9iNj5b6UsSvI+9eVsNRclD5mxFTdDo1fV4oxafdbKPAhLnNJpE ebTvnEQhqJ8+TwGCL+x760x+RU/bnBIoK1dKQ9e1V6sEd4i4dQIMDDMUA/EwrKEYhIl5 uKVwBMrafgR9MaYLTFBuLPPFewGifJJezI1nvJo0SLePNjo96ZUiAE/W0SzF8OYeASO7 X3jRxvBjwM04gg0lswl2h/3tju7Zb8Pyz+1qAHAnt0LWXzt0byUJmIINondvh18W4r7y 2z/TVIKaVWBsZQqD/BHyicmSHN5Y/ZxJBrefOdeeWjYj9Rq/UxH2SzsehL6kpV0ffBST j5rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=I8t7IC8rszKDO64b8khK6AR6AKFnTbofVr0A+rLLUB4=; b=LmTlrX5oyejPfnE+RvLkmY+BSw//6XQ136ZdQHJ38zKDn45U2zdgts7C8hgiaRMcT8 YdwQKAX9V5kihFIdRbZuWP1ReDD8giFYew7fXi5PkAyNVaDUQehWT6kFRRz6FmuoR0RO XvUb2gRISx3KjWBCRXZPvrp3AJn0WP6lxPULcpJikONX5ygPWuwsZOvpHEMp7hikpCDC n2qY+RbnZZ2YEIpcXY8DKuiCE9i7VhBBbAgwR2bE1oeKNbOIoJkxhB5WC55KUA0V8cHD r6i/VqyRCjQvHhqtFdVetebdufBsaySEB5k4ev03TrcoYwewyQzfEtgystXy2ZXTUmX2 xt0g== X-Gm-Message-State: AOAM530nNEfdTQsl7OQqdQJGMqfFSruRRz8ZK0FyTBRzYf+bnf8NAvWo V1CFhRpnLSaeQZKGtt++gd5YdK4JD9wTXEe6 X-Received: by 2002:a5d:5049:: with SMTP id h9mr15148372wrt.24.1621433655895; Wed, 19 May 2021 07:14:15 -0700 (PDT) Received: from localhost.localdomain ([85.255.235.154]) by smtp.gmail.com with ESMTPSA id z3sm6233569wrq.42.2021.05.19.07.14.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 07:14:15 -0700 (PDT) From: Pavel Begunkov To: io-uring@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jens Axboe , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Horst Schirmeier , "Franz-B . Tuneke" , Christian Dietrich Subject: [PATCH 21/23] io_uring: wire bpf copy to user Date: Wed, 19 May 2021 15:13:32 +0100 Message-Id: <12ed7a929cca94a82023076ae99e90f7663f297f.1621424513.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Enable io_uring to write to userspace memory Signed-off-by: Pavel Begunkov --- fs/io_uring.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/io_uring.c b/fs/io_uring.c index c37846bca863..c4682146afa4 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -10467,6 +10467,8 @@ io_bpf_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) switch (func_id) { case BPF_FUNC_copy_from_user: return prog->aux->sleepable ? &bpf_copy_from_user_proto : NULL; + case BPF_FUNC_copy_to_user: + return prog->aux->sleepable ? &bpf_copy_to_user_proto : NULL; case BPF_FUNC_iouring_queue_sqe: return prog->aux->sleepable ? &io_bpf_queue_sqe_proto : NULL; case BPF_FUNC_iouring_emit_cqe: -- 2.31.1