Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1057919imm; Thu, 5 Jul 2018 13:57:35 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc2KkFZc3b/8Rkx5flwc8R3LQIhUKWyu9KjXa0p+O4s+vX4Ca6SXoFNW3DRSHRHwdlCvzK/ X-Received: by 2002:a65:6343:: with SMTP id p3-v6mr7092376pgv.48.1530824255594; Thu, 05 Jul 2018 13:57:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530824255; cv=none; d=google.com; s=arc-20160816; b=gRS+Grr5gMhsyXzdvnr1xLAmCVWrAtqKdM/cG71AXbDEuSAYB6hoq27/OTrAJvd1Vz EcxjPPIV8qPAeFvmWyHMaeci/G4mHxDTYR9CGRmyGTw2XM3EbH3NA96RVvzesvFTOeaV ruyYX+YhlGtqVRcZ7RjCjUk91Naxkp1J5Ro0r7JPl985eMn+IDHadfESbBh6aKus8WIl ++R/jnbaP8k++NAGGGxyx1yl6iV38yPjJmZ0mWmQYDSxfw2p09+fM6Xf+OSi6IHK4kMg dplLL8Twdl0W1twv2Ws2W6XNEGCwVxCTn+bGBY1HV36VUOsIX+cAII5NrrpuKqRR0XNv Ex4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-signature :arc-authentication-results; bh=uQbcMIAUjqNcAX0WW8J0f8X7Oq7AsoJHe5fhb7m17+Y=; b=ekdBDYnqPlMx0pN2WzP79Pdvrxm9AD3VIepcNLrM8Kg9vFvOyzjJMXktShBwNHQMX0 HyMBFFQAuUv5qvtVokYn6uWKIQ91VQaa/vmvZWDQQi97YVHVRG/tbxd3gCbmn1qYuB+W NngMnhQfD/JO5wmxlXUV14atEEhErqthKJ7MvARTfvAc6KpS4DVJ37YL6epGP1f4ch5H aYLGZBeCUvLTZET1v5nbo5nK+8SdXfjUpun8Pu4nMnebc6mmL7XpBKnGrEsGMWLcs2sU vBiKGlHdw4qZ1+pJKmOzmFgu2K72EjGYHV7QChMLf9gXxsUXT3eC7Hhr17MXPeNkzush ENWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=cF+JyPOE; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=ekiznpXI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h9-v6si6474258pgi.502.2018.07.05.13.57.21; Thu, 05 Jul 2018 13:57:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=cF+JyPOE; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=ekiznpXI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754581AbeGEU4R (ORCPT + 99 others); Thu, 5 Jul 2018 16:56:17 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:42554 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754208AbeGEUwj (ORCPT ); Thu, 5 Jul 2018 16:52:39 -0400 Received: from pps.filterd (m0001255.ppops.net [127.0.0.1]) by mx0b-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w65KqIlx026792; Thu, 5 Jul 2018 13:52:18 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=uQbcMIAUjqNcAX0WW8J0f8X7Oq7AsoJHe5fhb7m17+Y=; b=cF+JyPOElSMu4DlgLLGsIskATgBDFKA1dAua86iIgqgKCOyDFJh3nesfLYFI0QC8wo9g TXLIuF/jXqaViJubH1iSAp6POwyJwD5bTEKqxofVjAQgq09zYLy7QZYJB4WH5HxdeSDb FRQVMMbYe+ZmSELAghybRWxBTTo461gMR1M= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0b-00082601.pphosted.com with ESMTP id 2k1q6urqhd-2 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 05 Jul 2018 13:52:18 -0700 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.19) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 5 Jul 2018 13:52:14 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uQbcMIAUjqNcAX0WW8J0f8X7Oq7AsoJHe5fhb7m17+Y=; b=ekiznpXIQ6G05nTKkm411kIcHiIA8qZyfagqkGLOxq48gpH3QyqCTyV6pc5eX0XaZ13Q97L+0zxMvrfcf7+NoSy+2rFG1wL+A7Sky5FHVLDfoebo4gRAAkowmaBMrA71FBQqqGtVBT9j0kAnKFn4z1gFXv/iJiUgHVJvSoXs+cE= Received: from castle.thefacebook.com (2620:10d:c090:200::4:9a3d) by BY2PR15MB0166.namprd15.prod.outlook.com (2a01:111:e400:58e0::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.26; Thu, 5 Jul 2018 20:52:10 +0000 From: Roman Gushchin To: CC: , , , Roman Gushchin , Alexei Starovoitov , Daniel Borkmann Subject: [PATCH v2 bpf-next 03/14] bpf: pass a pointer to a cgroup storage using pcpu variable Date: Thu, 5 Jul 2018 13:51:28 -0700 Message-ID: <20180705205139.3462-4-guro@fb.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180705205139.3462-1-guro@fb.com> References: <20180705205139.3462-1-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [2620:10d:c090:200::4:9a3d] X-ClientProxiedBy: MWHPR13CA0025.namprd13.prod.outlook.com (2603:10b6:300:95::11) To BY2PR15MB0166.namprd15.prod.outlook.com (2a01:111:e400:58e0::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c0851057-b122-4972-98e1-08d5e2b92dbf X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:BY2PR15MB0166; X-Microsoft-Exchange-Diagnostics: 1;BY2PR15MB0166;3:lYZ1VCTF80+x7CFDknfKkc6H4P3VX7wi5rEcpWP4cQxXCD2gXpzCJikQkCaFxXApbodxClze/w+v8yiwpa9P4rXIWeOMmRY93nljkdGmbJ1BOwsufF5lD5ZVEKlYVse081q3jYHhC+OIIlRgcV/aiyR9du0DWPq/5aoYJEUyCPoZddXi6nNRFurp46K+/pzUvThLHU2w8o9k5IE0++EODR1OeNOByh8ZpoZAD4A2S+IHdMpKQr3ucauA5KpFLmMR;25:BvBzmFIOeeHdlrpidISm/qZo6OPDzBg93xZPjyuPNziCX06E2ItSASKo2AtowA8MZan6ykCsyA3YEXDreQJYAF4E7MlHwSt6uzoblwNia4uft52CN4f9KTrlRa6eM0oq3GNcEzul06p/DLV64WVLfyMIlzB9aOipad78GXhB+jFvOg3rzghlwlYY+IqLpRL2Zddx3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2joAVss7qdEXK03VYbfw+zCtsR9puZhdqFRTtUGTnDSgXDe2l0q3GwRcR0Eu3Nwoe8uYKEW0Mc6a4gOK9FO1XX9amH0gabL5JmWA+oBkSFEzkx9yyUvbaU77SO4uazRQgBrIbDNmXbeAiHKUk289cB20cqSLcQ2+CHu+nMQ9cqz/tVA+hT5+sSjrf1sSuAlfouNp8F3veBeVeh7MCq5qYzcywSGn1 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(3231254)(11241501184)(944501410)(52105095)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:BY2PR15MB0166;BCL:0;PCL:0;RULEID:;SRVR:BY2PR15MB0166; X-Forefront-PRVS: 0724FCD4CD X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(136003)(376002)(346002)(366004)(396003)(39860400002)(189003)(199004)(11346002)(446003)(5660300001)(25786009)(6512007)(4326008)(53936002)(6916009)(6666003)(6116002)(7736002)(16526019)(50466002)(8936002)(48376002)(105586002)(53416004)(486006)(316002)(54906003)(68736007)(1076002)(186003)(16586007)(47776003)(476003)(2616005)(478600001)(106356001)(81166006)(5024004)(69596002)(8676002)(81156014)(305945005)(14444005)(97736004)(51416003)(575784001)(86362001)(2906002)(46003)(2351001)(50226002)(6506007)(2361001)(52396003)(36756003)(6486002)(76176011)(52116002)(386003)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR15MB0166;H:castle.thefacebook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: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6AuJjUWmikxX/jdhMVmYkJR?= =?us-ascii?Q?hlrMr9KxDoPtZt72OU96pzgHSNhvR/O9+px2ENwWiKng3fp+El9NZYymvRP0?= =?us-ascii?Q?YY1lmu5QJfKdHP6fQmn6+nu6zKKF1To6k5A56h+8ySgwygL+Z0cmnNU3EC+3?= =?us-ascii?Q?ETgYk76jlOR+IolMLNRHuZawhqimcSxhzU0D/Bnit7aj5i+y6Vixxyw4Kq8G?= =?us-ascii?Q?VAkX/gu6g3VSpfoo0PJXqR0el8JKutCNEZ2vqalYai1S31rjkmXScQsuUqlF?= =?us-ascii?Q?ntl++O+Bvhaog6POVUJC0VebQDbKIFIqT/nPcHiWeYtNSiR7zRw4uqbs42zB?= =?us-ascii?Q?WXkwnACOffr7wFDK6VBqag8tZ/dV9zZIfT3n0he7JOVVjRgaql2yegfQk13G?= =?us-ascii?Q?zHvm2LdrJA0gRnxoaHB8RI8Vb3XAuVIK6w+MC2c1oMzmFlvvxlly7j8jh1aH?= =?us-ascii?Q?ibQkzguJbtrO4QNl29gfQtuW9ZWRfAgCUFlBFVeJV4n?= X-Microsoft-Antispam-Message-Info: st3FGeueF+8I27n+UBlW4/5+EM4BTvMEMSSpNjiRAEDLlV60xdGJVoi26b/6Q/f86naxYUVOinuY6/UAKxJWRQGNsa0qmqNz1KJlOgirJHf6BwfZgjieqo1co0ZwNRG3HFZHbxX58kUar2Crq0nMGjmCyE+RyeB6sPZ3p3pkMgziggZFyx/vJitrF4fgdWUEPDsDpxTAHHZtrSaOdEDqJo/c/0SaIRYGK17RM6cH4tRmpFeERdYVWzxOO9y6b7YROaG667XAGEBcx7T9qFI2g7DkpFPFA8KsWFPhjT/IPFJwe16LvKDIkpMg4BTwELRV/gFs4/JwHkFoO288q0O4xHEjbC81cedVl4abZYLSSyQ= X-Microsoft-Exchange-Diagnostics: 1;BY2PR15MB0166;6:403VewRrqW7OPayE67p5Ig5KSE6bu+1GlEsO3Q+2GeTGZhnbEYbX9qTrVRYEjs6cWUD4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r6liIiG5YhlzOtSy5aiKL05J00EgZx8EtPP7MSa8jcF0ORl3Hdna8MeKKNgfZUHDaG+6mj6LRuT50gprxD6hQEL4GdqnMQLRK3MIuKYmtaGTLG1H9kaW5ZhS/R0= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2018 20:52:10.1506 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c0851057-b122-4972-98e1-08d5e2b92dbf X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR15MB0166 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-05_08:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This commit introduces the bpf_cgroup_storage_set() helper, which will be used to pass a pointer to a cgroup storage to the bpf helper. Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Acked-by: Martin KaFai Lau --- include/linux/bpf-cgroup.h | 15 +++++++++++++++ kernel/bpf/local_storage.c | 2 ++ 2 files changed, 17 insertions(+) diff --git a/include/linux/bpf-cgroup.h b/include/linux/bpf-cgroup.h index 6b0e7bd4b154..ce77a6dffb6d 100644 --- a/include/linux/bpf-cgroup.h +++ b/include/linux/bpf-cgroup.h @@ -3,6 +3,7 @@ #define _BPF_CGROUP_H #include +#include #include #include @@ -20,6 +21,8 @@ struct bpf_cgroup_storage; extern struct static_key_false cgroup_bpf_enabled_key; #define cgroup_bpf_enabled static_branch_unlikely(&cgroup_bpf_enabled_key) +DECLARE_PER_CPU(void*, bpf_cgroup_storage); + struct bpf_cgroup_storage_map; struct bpf_storage_buffer { @@ -96,6 +99,17 @@ int __cgroup_bpf_run_filter_sock_ops(struct sock *sk, int __cgroup_bpf_check_dev_permission(short dev_type, u32 major, u32 minor, short access, enum bpf_attach_type type); +static inline void bpf_cgroup_storage_set(struct bpf_cgroup_storage *storage) +{ + struct bpf_storage_buffer *buf; + + if (!storage) + return; + + buf = rcu_dereference(storage->buf); + this_cpu_write(bpf_cgroup_storage, &buf->data[0]); +} + struct bpf_cgroup_storage *bpf_cgroup_storage_alloc(struct bpf_prog *prog); void bpf_cgroup_storage_free(struct bpf_cgroup_storage *storage); void bpf_cgroup_storage_link(struct bpf_cgroup_storage *storage, @@ -249,6 +263,7 @@ static inline int cgroup_bpf_prog_query(const union bpf_attr *attr, return -EINVAL; } +static inline void bpf_cgroup_storage_set(struct bpf_cgroup_storage *storage) {} static inline int bpf_cgroup_storage_assign(struct bpf_prog *prog, struct bpf_map *map) { return 0; } static inline void bpf_cgroup_storage_release(struct bpf_prog *prog, diff --git a/kernel/bpf/local_storage.c b/kernel/bpf/local_storage.c index 940889eda2c7..38810a712971 100644 --- a/kernel/bpf/local_storage.c +++ b/kernel/bpf/local_storage.c @@ -7,6 +7,8 @@ #include #include +DEFINE_PER_CPU(void*, bpf_cgroup_storage); + #ifdef CONFIG_CGROUP_BPF struct bpf_cgroup_storage_map { -- 2.14.4