Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1046433imm; Fri, 27 Jul 2018 10:14:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcs/AfbW2oUrBFlXNYR8uE5xXSVzGgeLvYEMBd+XEVBrwWD4znJF7XkyDTWi9SesfH+Spnt X-Received: by 2002:a62:1815:: with SMTP id 21-v6mr7517086pfy.227.1532711661284; Fri, 27 Jul 2018 10:14:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532711661; cv=none; d=google.com; s=arc-20160816; b=KRBrAzUnr9DJq4Pi0FTOc7FIZdIr0/twXm401khOsZNktnpZkq5edvZnAVZE6Hygng ayR0Zjxw2uCR6w7GNkmmoqoE/pZBiHZRtL2heZ+Bhw2Oact0Nwbh9ExGHxPE3VWICrOe xZspCWOFEaFXqEV1F3lJtRoGAw5mqqwhOoJ009dYNuNB7eT4zRhp4jfJRZj8mY9Q2Dgg PRMmGfq3pefAHohB8rvbonMqj1IQfb5XYVoaswuq0/LmCMi92hHp+uIGHNDHeTRmdXCo MjWiAELwMkEHKAhlmfY4wDNBdn80AYTM+wWbzgEGaC4DEYaHrRBeBKYOVIOfqTx/rrrG T1YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature:arc-authentication-results; bh=QD3rg/gXqJ+Zc9g5z3V2WA2XigUW15BwGQCfYKKl0zs=; b=NaDxktOeSsPZzhD492Vf58eNU/F+l60LtDkmGgaGL0ECvjl9Kly77qkT/VluQid/zL M3y3qEj79qayljpxMlQOW/tv2lRdmxmYD1JwPVahuRroBnGXj57Fvntqbzug8yIQ7NLs 86IPGu2jGcxz9fGOpTlGSeNHP9neAXUNdjyHYeYayN8fbpGku35Ic1jG35YIha0YXuuU sE7ie5sSLIlFTXiZ3Ej15BnGnImNdC7ugk/vnZHN31TrSjsMJ0ROGClPODH16VpGX/T0 vsDeULmYMqxN4kUmS2zVOh23Z1AHVdNkhIJPvwMfUiHhEi6LZhVv5rd5gcxKKMtsRw8j VGgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=q8D9Mjgn; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=XTSCjBmx; 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 p185-v6si4279269pga.476.2018.07.27.10.14.06; Fri, 27 Jul 2018 10:14:21 -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=q8D9Mjgn; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=XTSCjBmx; 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 S2388634AbeG0SgE (ORCPT + 99 others); Fri, 27 Jul 2018 14:36:04 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:34208 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730771AbeG0SgD (ORCPT ); Fri, 27 Jul 2018 14:36:03 -0400 Received: from pps.filterd (m0001303.ppops.net [127.0.0.1]) by m0001303.ppops.net (8.16.0.22/8.16.0.22) with SMTP id w6RH7Z7W002993; Fri, 27 Jul 2018 10:12:53 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=facebook; bh=QD3rg/gXqJ+Zc9g5z3V2WA2XigUW15BwGQCfYKKl0zs=; b=q8D9MjgnH00fIfR5UjMwazFXDNOYXO2THWacMQ2UTHKsIYKCK9JcWr0JtCvao8y7jBxA NkHokCGgJYx5cXhi1VWvDsJCR8PnnXBKCxy54SycVf3qTb5buKYXc8nl2TRR7Ff+NQPT ruYP5WogX3nDd4NQ3MfsiXRCK9jKQcvMd9s= Received: from maileast.thefacebook.com ([199.201.65.23]) by m0001303.ppops.net with ESMTP id 2kg6v7r4k9-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 27 Jul 2018 10:12:53 -0700 Received: from NAM03-BY2-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.27) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 27 Jul 2018 13:12:52 -0400 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=QD3rg/gXqJ+Zc9g5z3V2WA2XigUW15BwGQCfYKKl0zs=; b=XTSCjBmx1+ieJiXp7DbZgH0SN09p8cQWracrIDoA1uE1JN/f44TgvbEv8OalAAoOd53bUN9b8jHhosSuMV4VSe1v7NqomAv8DdsgUdvXh6AO+Qg/XIIACqMyvtdcbJ4lo4igp2y4qVEPE4ujuLXJMaHI6AS4reOK4eA7NPucvGw= Received: from castle (2620:10d:c090:200::5:d753) by SN1PR15MB0176.namprd15.prod.outlook.com (2a01:111:e400:58cf::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Fri, 27 Jul 2018 17:12:48 +0000 Date: Fri, 27 Jul 2018 10:12:43 -0700 From: Roman Gushchin To: Daniel Borkmann CC: , , , Alexei Starovoitov Subject: Re: [PATCH v3 bpf-next 02/14] bpf: introduce cgroup storage maps Message-ID: <20180727171239.GA9128@castle> References: <20180720174558.5829-1-guro@fb.com> <20180720174558.5829-3-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-Originating-IP: [2620:10d:c090:200::5:d753] X-ClientProxiedBy: MWHPR19CA0058.namprd19.prod.outlook.com (2603:10b6:300:94::20) To SN1PR15MB0176.namprd15.prod.outlook.com (2a01:111:e400:58cf::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 49dcbf6d-ec56-4bf9-f52c-08d5f3e42dfb X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:SN1PR15MB0176; X-Microsoft-Exchange-Diagnostics: 1;SN1PR15MB0176;3:3TcsLNMRfXzYI1YM0G/RMQXQNwob7RH0P/8vsTXajCPm8mSVG8bDz83SY9d5NTgUPgLO9J8aQAvlO1Jfnlg9tpBjk2Xt3hwt4K5BylAjD3K84OT3IYfeKlTcCZI5oO9jyqgY4W3G+oa4BDY9jxBMusIoQISCNJcdrpIQUv3y+3MyxwPr0n6C1nO0QToicalboPtmuVAm+uQpcvz1KxjvDGyMMcfh8QEjiH+xUGzWAYMzkbQA2/p0WXuLbFKI+72A;25:AAck6L+QthYuEXTHb6uMTfzhZVOeAgpuXDmTxGCe6BwwQqOmMYh3qO3XHWeb4eNzZsaAhid4ufc/2sfVsu83N7E1b9xvZdXDZCbq18CaF+cHcVQUyGop9IcPXX1GjYIzK1abNNc+3THIshcCRVWQpLR0R7Q9rgPFDdDmsfg9PEZTiLvT7gLqORMZ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HUPbJkn0dYGFnsdh5R079a4a6voNWD9Yhbu875r3GX27AW/IHH7yALGGfU8PVssXUwjY2HCuCgBQZ85ryWwrlyE/fELv5GKdzX6Zza9DResWF3wgjhf3n6MrCTjtTKYNuVliyh5YfU17s3I7vbtyfodnrKQXUEkshoTjSVhgEKHGvvKL4viWPi2Tl7QHE8Oi8L6/6PKzDKtskB672a2LY+nmlAmvWnWE8AGRRrtEbFsN+JqG0bSpquYochtgOSAmWwetMB2LlHyngHlxuSn4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(67672495146484); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231311)(11241501184)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:SN1PR15MB0176;BCL:0;PCL:0;RULEID:;SRVR:SN1PR15MB0176; X-Forefront-PRVS: 07467C4D33 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(396003)(366004)(376002)(346002)(39860400002)(136003)(189003)(199004)(11346002)(446003)(25786009)(4326008)(58126008)(50466002)(2906002)(76176011)(305945005)(97736004)(46003)(52116002)(6116002)(7736002)(575784001)(86362001)(478600001)(316002)(6246003)(16586007)(229853002)(52396003)(53936002)(476003)(8676002)(16526019)(5660300001)(81156014)(81166006)(186003)(14444005)(5024004)(6496006)(6666003)(105586002)(47776003)(486006)(6916009)(106356001)(33656002)(9686003)(33716001)(68736007)(386003)(8936002)(345774005)(53546011)(23726003)(55016002)(33896004)(1076002)(18370500001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:SN1PR15MB0176;H:castle;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: =?us-ascii?Q?1;SN1PR15MB0176;23:64iDHaZMvfyttgefJJrJyfSRcOR9NJBl8gXqptXfZ?= =?us-ascii?Q?qIZZ+/oR4eunOEXU3VS0PCGCXjYlLQ7TAFrm6x+/vDI9P0N2wWIDk0e1VoC2?= =?us-ascii?Q?cieSIudCOaiGKRgBh7BYwhNSB9nBmqBJiIJcGTHC476DzQo6MnfJ1XOBYbJN?= =?us-ascii?Q?S9N0JlNRzSp/UVCtOEwZOiViHj5lmIntY47ByrPjOldoa+C6xUb4+KX4rprp?= =?us-ascii?Q?81RyjWWMxPC5FIw1t9IBB9ure04KHfOY5NT/k+RllYCAbHITxw+IEblwhxCu?= =?us-ascii?Q?YU1Sv29ucnYczVUDvMPBD1ySkyS0cw1HAbnSZLTwqIQMwbKSTFHbma+Y/iBM?= =?us-ascii?Q?A6Z8+DLye24tMYEiKMXQshxlf1ZS3JCLgWnF074tcV3rP1U+dKspuzMDRXFG?= =?us-ascii?Q?pSYLWHRx5e0nnFPzXQxjN6U42L/bzpIl/yfM1CzRb1rdSoDkxwEDggxT21g4?= =?us-ascii?Q?TxPJr/adyDsfMlKej6g51WWwt3QyW4y7x7bNBnS8UbZhbDTsSns0fQS63urh?= =?us-ascii?Q?11iGleg+NZgcSaSimQSNLRvQuByIS7fg1oS1dFWS/C8ocFaLE7wcqwaEZsbg?= =?us-ascii?Q?35yeab6NEczaxSowdn8R1TAjoHpVNgte94XsbD3ZiYbbw6HD1zuG/gZpmf3l?= =?us-ascii?Q?0XBuS9a5Zt+n8lQVLE0DMFIZOyzY51uK1DWJKQ/Ks7tQjjxH3VUMAcoIt+Mk?= =?us-ascii?Q?tveiZpSl25FmoyN+qi0xuIyxk0rKH5WQg4soXRV1OtB40uWgAhy8c3idugSC?= =?us-ascii?Q?XHYXgVX8hrNCOkXjPsoE4PPRKRStmnLQkIRATvq5jegUsRxf0PAWKJSmqpBN?= =?us-ascii?Q?MzbuoxlTI4MD11OCehLGbooIZK/j0MXfqGcEAZd5Mt7/a4MmFbkjnLbEtPcH?= =?us-ascii?Q?sxEaPC2/iYv6AEikO4ztZDJefGHllamRKHAp2eFEyHWZkGGUdZ286lLeKFbM?= =?us-ascii?Q?dFUJ1V35H1dWOQG/YIMQn/XtX9tDnxFXpEZ1rRTgwf8wEW3WkNS/4TBDrVaY?= =?us-ascii?Q?1CKTlQOselbdca3ne47Gul6GxTnQ/SJwEvJQxwg/I+8PNxUCFfwamMrNYuwD?= =?us-ascii?Q?nPd1UCZUG0MFlk7FoxMg6kors95L5eNDv+7yjIVp4Perfch0Vw2zKNyG0Kum?= =?us-ascii?Q?5mqa/OaH4RNicF9QShvKGCyctKITVK28z33dkXVqdkkiHFUm523HowyE3qyJ?= =?us-ascii?Q?gCre7nleVXrdcEqHrvc4KY4MIVqMBNk74+HC6imlpRs3s+JXJrTYhfY7RAg0?= =?us-ascii?Q?aLuR1A+UJZTRNDi7cW61HCadGUju5sfR3mZy7UA3hV4UBlqGYQyMaMvOP/Kp?= =?us-ascii?Q?tMSI+Y17svZ2UGMzu44oXkQw174du5d98QyJ5SSkqL9w7Jkxrrru2TUg3IG9?= =?us-ascii?Q?R+biQ=3D=3D?= X-Microsoft-Antispam-Message-Info: PvAns7NQKXFlSlSUtE1jO0gRyA6bw3kHdadMGegu+O0Qs8dRMNW+LKtyTYMX8dGEqE/rCRZF2Z2Nq47399EOpchOPX4PeJwAmno5dF3xbQPpo8fQkXVr7f+GRIpqk2MKG5twspaG9to76r0MceWwnTfKkQ558TXxhuZiv42R5EFWg0eLVihmbNnsD2CCwM67VATXn9iAEKTF5bCCCL3HqwWjIlIRSDR00P6dp1FZd3DjjQmdfZNHbk26Mln5/SQApl2mIwR71f3LAJGmzrCdTvJ5KAUztbGiwhjlbO5VKlLENighC6LJEuf74P8qhMHUJNo7g1GJQr75IwS/cLVuGiTED01cCynNSCpervNe9xU= X-Microsoft-Exchange-Diagnostics: 1;SN1PR15MB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tg3ToWzGAT3KOM99EDGf6KlQmi08DHOvYza7eD2jPKqssYaHIZnnsZbJUKuCBnAVyQUex4Ql4XWI= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2018 17:12:48.6748 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 49dcbf6d-ec56-4bf9-f52c-08d5f3e42dfb X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR15MB0176 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-27_07:,, 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 On Fri, Jul 27, 2018 at 06:11:31AM +0200, Daniel Borkmann wrote: > On 07/20/2018 07:45 PM, Roman Gushchin wrote: > > This commit introduces BPF_MAP_TYPE_CGROUP_STORAGE maps: > > a special type of maps which are implementing the cgroup storage. > > > > From the userspace point of view it's almost a generic > > hash map with the (cgroup inode id, attachment type) pair > > used as a key. > > > > The only difference is that some operations are restricted: > > 1) a user can't create new entries, > > 2) a user can't remove existing entries. > > > > The lookup from userspace is o(log(n)). > > > > Signed-off-by: Roman Gushchin > > Cc: Alexei Starovoitov > > Cc: Daniel Borkmann > > Acked-by: Martin KaFai Lau > > (First of all sorry for the late review, only limited availability this week > on my side.) Np, thank you for the review! > > > --- > > include/linux/bpf-cgroup.h | 38 +++++ > > include/linux/bpf.h | 1 + > > include/linux/bpf_types.h | 3 + > > include/uapi/linux/bpf.h | 6 + > > kernel/bpf/Makefile | 1 + > > kernel/bpf/local_storage.c | 367 +++++++++++++++++++++++++++++++++++++++++++++ > > kernel/bpf/verifier.c | 12 ++ > > 7 files changed, 428 insertions(+) > > create mode 100644 kernel/bpf/local_storage.c > > > > diff --git a/include/linux/bpf-cgroup.h b/include/linux/bpf-cgroup.h > > index 79795c5fa7c3..6b0e7bd4b154 100644 > > --- a/include/linux/bpf-cgroup.h > > +++ b/include/linux/bpf-cgroup.h > > @@ -3,19 +3,39 @@ > > #define _BPF_CGROUP_H > > > > #include > > +#include > > #include > > > [...] > > diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c > > index 15d69b278277..0b089ba4595d 100644 > > --- a/kernel/bpf/verifier.c > > +++ b/kernel/bpf/verifier.c > > @@ -5140,6 +5140,14 @@ static int replace_map_fd_with_map_ptr(struct bpf_verifier_env *env) > > return -E2BIG; > > } > > > > + if (map->map_type == BPF_MAP_TYPE_CGROUP_STORAGE && > > + bpf_cgroup_storage_assign(env->prog, map)) { > > + verbose(env, > > + "only one cgroup storage is allowed\n"); > > + fdput(f); > > + return -EBUSY; > > + } > > + > > /* hold the map. If the program is rejected by verifier, > > * the map will be released by release_maps() or it > > * will be used by the valid program until it's unloaded > > @@ -5148,6 +5156,10 @@ static int replace_map_fd_with_map_ptr(struct bpf_verifier_env *env) > > map = bpf_map_inc(map, false); > > if (IS_ERR(map)) { > > fdput(f); > > + if (map->map_type == > > + BPF_MAP_TYPE_CGROUP_STORAGE) > > + bpf_cgroup_storage_release(env->prog, > > + map); > > I think this behavior is a bit strange, meaning that we would reset the map via > bpf_cgroup_storage_release() in this case, but if we error out and exit in any > later instruction the prior bpf_cgroup_storage_assign() is not undone, meaning > at this point we have no other choice but to destroy the map since any later > BPF prog load with bpf_cgroup_storage_assign() attempt would fail with -EBUSY > even though it's not assigned anywhere, is that correct? Same also on any other > errors along the prog load path. E.g. say, as one example, your verifier buffer > is too small, so any retry with the very same program from loader side would fail > above due to different prog pointers? Yeah, I see... We should call bpf_cgroup_storage_release() from the generic verifier error path. I'll fix this and the leak in the other patch and resend soon. Thanks!