From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC79DC6369E for ; Thu, 19 Nov 2020 16:27:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 413F1246AD for ; Thu, 19 Nov 2020 16:27:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="fGu+7Bf2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728896AbgKSQ1h (ORCPT ); Thu, 19 Nov 2020 11:27:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726820AbgKSQ1f (ORCPT ); Thu, 19 Nov 2020 11:27:35 -0500 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 598FCC061A48 for ; Thu, 19 Nov 2020 08:27:35 -0800 (PST) Received: by mail-wm1-x341.google.com with SMTP id p19so6620365wmg.0 for ; Thu, 19 Nov 2020 08:27:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Z36MlF26WgWXOikzwPdY6S4xLAQhn1npxSnvJNteclE=; b=fGu+7Bf2lyWU/lgx4K/qS0Ycvfcqw+M6On5Tb5RL0jM+IkZKCmP9vLsbL4zJRFes3M l+Ll2BcApNvJlfdn0KlrAn5iveQ6/KPXJhXMDSoBGy0cuMyV6srYTnOdHfpkc0KxL9Xi Kje/Norox0GHxKdLiAEvU8gDOm43OPjQYjC1M= 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=Z36MlF26WgWXOikzwPdY6S4xLAQhn1npxSnvJNteclE=; b=YNO2Xx0NO6VtQk3BxTWzTeCRFOj+P56pp6kMSI3bBvIME7q3Hw+dCQS7AiHS/dayWh IWH9sjx89JmjCKLZZQFcUqbFUf0vKKc6vZlOcKPNAl/LIQmm4g3d5qJSoO07rWun454g O4XRTtHN0ec54sGHDQcrFqFkwt1kJXydJq3z5PHxLxjwB6l5q+Slaw4D9x7CbmhNn+ji 0y4B/w8zzTBKk29/qOmMKR7T6dPq9oQDVEJ1VlbcIy/Foh87TI8bsl1eZ0MsnN7rMwaP rDe1Kz/qZ9cjH4CteSnA/vHfy0NfcbLKQOQnwDFbDCdTmnD+GhuSw2kHaU4qLPfECNLA S/6A== X-Gm-Message-State: AOAM531qX6MsYB2X89YPgt67vAd3oDyEBZ2gM9lKt9tDZe8xz7w5gqfg H8W/4wt5PbkqJiKJyw/5KqsEbw== X-Google-Smtp-Source: ABdhPJwzpEf8BMNhQktHP9wY1hZnvZBrQH11aEU7uxGK8wfrft4HifITGFcsDcw+G1QgAaS0oSAxkA== X-Received: by 2002:a7b:cb82:: with SMTP id m2mr5350605wmi.75.1605803254062; Thu, 19 Nov 2020 08:27:34 -0800 (PST) Received: from revest.zrh.corp.google.com ([2a00:79e0:42:204:f693:9fff:fef4:a569]) by smtp.gmail.com with ESMTPSA id i5sm380061wrw.45.2020.11.19.08.27.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 08:27:33 -0800 (PST) From: Florent Revest To: bpf@vger.kernel.org Cc: viro@zeniv.linux.org.uk, davem@davemloft.net, kuba@kernel.org, ast@kernel.org, daniel@iogearbox.net, kafai@fb.com, yhs@fb.com, andrii@kernel.org, kpsingh@chromium.org, revest@google.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2 3/5] bpf: Expose bpf_sk_storage_* to iterator programs Date: Thu, 19 Nov 2020 17:26:52 +0100 Message-Id: <20201119162654.2410685-3-revest@chromium.org> X-Mailer: git-send-email 2.29.2.299.gdc1121823c-goog In-Reply-To: <20201119162654.2410685-1-revest@chromium.org> References: <20201119162654.2410685-1-revest@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Florent Revest Iterators are currently used to expose kernel information to userspace over fast procfs-like files but iterators could also be used to manipulate local storage. For example, the task_file iterator could be used to initialize a socket local storage with associations between processes and sockets or to selectively delete local storage values. This exposes both socket local storage helpers to all iterators. Alternatively we could expose it to only certain iterators with strcmps on prog->aux->attach_func_name. Signed-off-by: Florent Revest --- net/core/bpf_sk_storage.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/core/bpf_sk_storage.c b/net/core/bpf_sk_storage.c index a32037daa933..4edd033e899c 100644 --- a/net/core/bpf_sk_storage.c +++ b/net/core/bpf_sk_storage.c @@ -394,6 +394,7 @@ static bool bpf_sk_storage_tracing_allowed(const struct bpf_prog *prog) * use the bpf_sk_storage_(get|delete) helper. */ switch (prog->expected_attach_type) { + case BPF_TRACE_ITER: case BPF_TRACE_RAW_TP: /* bpf_sk_storage has no trace point */ return true; -- 2.29.2.299.gdc1121823c-goog