Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp693657imm; Wed, 18 Jul 2018 09:05:07 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdRsEH5/400vUZ9tSjEUNWFf7pNdkRVALLDzBs8CJyhz8UlYOBF5bX5/aLGcygLsDTLQ1gx X-Received: by 2002:a63:6743:: with SMTP id b64-v6mr6256438pgc.91.1531929907905; Wed, 18 Jul 2018 09:05:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531929907; cv=none; d=google.com; s=arc-20160816; b=eNDvlfFJBkQQjRviO3Uoxuwy+ZA/4oOkDclGPO215Aqnkti+T494c7p8C24thR2r2l cLxRhwOrMeoOcCk4khFGU9/hnc0W4RHqjc3ze6WDIFCyCpbNof5jXZwYZAGInDs+zlO7 nW30wbbMKxU/tU+z6PEixRG2MOqS5HS3UhBuDRUi2SpBYQuCgSl0dx2NhJOLMfxj5FD+ I1UhonfECLffzWzJxx7NTBz1/QSuIxr0aZJKEmqtGQmRTbJvH1XgTAZkuZRLLJLmobCg flz8ez6DRpalhZ33w9ebk9IUJ7iSVMz+uEq8/zJT8FtjmfKVagDmCGNr4EQsbIFcyt/t QLtA== 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=ivyiMGDAOisKROdjgC+uHHIosTQ5uL2UIz9JZJ/SiCI=; b=VKagHDWAxan4ZFPd9scaqVVwvDal3SL+j+E1JbptCVGxbUjEmspLmZuE/2nf1GrJh0 xodJ9UZeC0UmbvVRG+7MfF2Qh2gwqPWHYMtZvIMXdsz/D33ew0x0lBJP7zaX1+rnCsUc IAkpbxyOoXx5kvZXtPBf/56fkb1Uu34L+XA2VlBynCqbvJD/t3SXESj5JZHBgnOkVWFW sqB/aj2/dUu+NEKES2pqqeNz4Xp+wjNSnFiDPmORmGrySIYhWXPe5mY0CrQpF9fNRU5X um6Ic9ypoj+xYUgo/Zwl7IO/AKPb8k7sdcHNxeK+Dnc/pboIpTcEqh6hFoWdWM7ZDt76 BCqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=SGA7Eydg; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=ha2d5rT6; 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 p7-v6si3804825pgp.70.2018.07.18.09.04.52; Wed, 18 Jul 2018 09:05:07 -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=SGA7Eydg; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=ha2d5rT6; 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 S1731391AbeGRQlQ (ORCPT + 99 others); Wed, 18 Jul 2018 12:41:16 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:44934 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731241AbeGRQlQ (ORCPT ); Wed, 18 Jul 2018 12:41:16 -0400 Received: from pps.filterd (m0109332.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6IFx0bx028189; Wed, 18 Jul 2018 09:02:19 -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=ivyiMGDAOisKROdjgC+uHHIosTQ5uL2UIz9JZJ/SiCI=; b=SGA7EydgTEn1/H3TBTpCc2E8OdEMH2wTB5R6QLohtIG75dSFZuqS0lVUKoyTywpH6aD/ fBg0DGj00Jfqfxpm4/K+qRxetmv96qjsMllnSnkp3jFk7R1pUbxgOvzm6ZxnuVHVk8Uz ve/v4O86sApssPanb6FdCsM+Y6b9LDrf/ck= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2ka75ugbdx-10 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 18 Jul 2018 09:02:18 -0700 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.24) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 18 Jul 2018 09:02:11 -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=ivyiMGDAOisKROdjgC+uHHIosTQ5uL2UIz9JZJ/SiCI=; b=ha2d5rT623oSTvjFnxtO/QJ7HPhyk2ChiKojpvBrGyYXQkfNmtPmumL1B6QQPZrr1MKoAeWwPo3FLv2QBl9pR9AwP2w5nY0CdVeo/hLigb355BzFkUztfdmBn++uajJWzbbMRZCEMJd0lZl9y/cnES04SoCjO+oH9HxfEXJvJYY= Received: from castle.DHCP.thefacebook.com (2620:10d:c090:180::1:a4c2) by CY1PR15MB0170.namprd15.prod.outlook.com (2a01:111:e400:58bb::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.952.18; Wed, 18 Jul 2018 16:01:37 +0000 Date: Wed, 18 Jul 2018 09:01:31 -0700 From: Roman Gushchin To: Daniel Borkmann CC: , , , Alexei Starovoitov Subject: Re: [PATCH v2 bpf 3/5] bpf: bpf_prog_array_free() should take a generic non-rcu pointer Message-ID: <20180718160128.GA10652@castle.DHCP.thefacebook.com> References: <20180713194114.2711-1-guro@fb.com> <20180713194114.2711-3-guro@fb.com> <41b5f919-3155-5bd4-2774-84efd58650e2@iogearbox.net> <20180716225715.GB3898@castle.DHCP.thefacebook.com> <1a40b0a8-7440-f2d2-d743-64901b5d1bfe@iogearbox.net> <20180717225520.GA15643@castle.DHCP.thefacebook.com> <90bc1d99-da1b-065a-cd4f-457b7f17a533@iogearbox.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <90bc1d99-da1b-065a-cd4f-457b7f17a533@iogearbox.net> User-Agent: Mutt/1.9.2 (2017-12-15) X-Originating-IP: [2620:10d:c090:180::1:a4c2] X-ClientProxiedBy: MWHPR04CA0084.namprd04.prod.outlook.com (2603:10b6:301:3a::25) To CY1PR15MB0170.namprd15.prod.outlook.com (2a01:111:e400:58bb::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d8702130-f196-4aa6-15c1-08d5ecc7be77 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:CY1PR15MB0170; X-Microsoft-Exchange-Diagnostics: 1;CY1PR15MB0170;3:wJwOqENw1A3mKQWueg11QkFajKd9ExLvJmTBFDi7AHObJ+MgyrvDNal7ZuTGnA9WHb0wBdTWf2ziL8xs0dwu1A/DxzmmRHzqNWflZk/KWldpaafsKrxCMWt9aSeduoBUODy8nbuZGA9jghdBjgABW9y0hA9db3xSml65yraQe6AqN6Hg6SpAertAjA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3EYY3u55U0qMFA+UfIufQPxMqCm9RcwaUY3biwOQkuy1+jz0yIBFw89Fyn+ciZjkMJKV2qk+MLNql0Qwq9lPkJZTj3zqvlj+7lE3eBACNEDaeyqUJ3n1c+JVUncmCpAXkc1tZtQWsLiCokgGN4jlb4rNJo;4:OeCwVobaEXcHzbG/JtX8sM3dyfqyTBeavS3IiIefoqC15CuskmO0sRvqC20sAmjuYDJKMSkc9V+VFR3ndbbO91qHYiiG58mfefl6uh0Id/rYVTTGsxf22ZU1+3ovvOOLjJ2dWiIStPGTJvnw0ocqBSt05w7JnyW+8laCtPRzvyvQ8fkHdjy23lgzBjz+kvdDOQSgnSGbokyTQjcyruxFR8iltyTpLyyAClKq/LZQQNEY8g7kPCvJzn0/qW6Qb7BUwWCEyxbvRBQSt4wbpASTXcQB3RmyJP2H/Jr4+J0YY1APp2TsZY42eRQdGUlaqfiPXtkM0WVMzVE49KX8CuJdf8COmgDsAvgfjzL9L6joO64= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484)(17755550239193); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231311)(11241501184)(944501410)(52105095)(149027)(150027)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123560045)(6072148)(201708071742011)(7699016);SRVR:CY1PR15MB0170;BCL:0;PCL:0;RULEID:;SRVR:CY1PR15MB0170; X-Forefront-PRVS: 0737B96801 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(979002)(346002)(136003)(366004)(376002)(39860400002)(396003)(199004)(189003)(8936002)(229853002)(25786009)(81156014)(8676002)(23726003)(55016002)(4326008)(476003)(1076002)(575784001)(478600001)(81166006)(9686003)(6116002)(97736004)(6916009)(6246003)(446003)(53936002)(11346002)(68736007)(305945005)(6666003)(486006)(16526019)(52396003)(33656002)(93886005)(86362001)(7696005)(2906002)(386003)(46003)(53546011)(6506007)(186003)(52116002)(76176011)(16586007)(5660300001)(105586002)(316002)(7736002)(50466002)(47776003)(14444005)(5024004)(106356001)(58126008)(18370500001)(41533002)(42262002)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR15MB0170;H:castle.DHCP.thefacebook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR15MB0170;23:/OF57zeQpZDdzgR64dmHtkKVPanl7OHQsOkxXnAoS?= =?us-ascii?Q?lzkJy151SjmKdwW3UBhDpMS4DuV/f5jwsxRmvwCgn7V7Vgz7es6TT3y+Kl6d?= =?us-ascii?Q?ehWAO1IjkM5/zOfkw70WePkC9gphuYNoYwigDdh68Li67x728QsxLd2YsKI+?= =?us-ascii?Q?XhWjEwn3FDjP0OUB0Je2FATuq2yLR/IoY9pCtyoH3CCqud8moA7aHpsHMtRr?= =?us-ascii?Q?hHz6u9ugKkSnEWdSrYtM3Hm9AShm3Yq6gcEHWH9X+9HP4EYPxVO4VlfNe46z?= =?us-ascii?Q?eVAxu4fSYkO8TvdYWAsZ2wcYCrn9nN3LHOwl2To9nI1GuAU4cBHsb8tcj4Fn?= =?us-ascii?Q?M1GJk6Ca/Hse0yxpEt2nVkJZ/HXcsVbb9pyRMEjZeYCRJb31asRIeoyvQSB6?= =?us-ascii?Q?vklnaw0VGPT8EafIScAs5Avm5u2Rr3GX/z6Earmqq6D9v68GN8d/eJw7fOF+?= =?us-ascii?Q?HaHDzIFD38N9yjQ9sjuEERzu6Yejh854PZ9AcixonKV6UNJ75VeIxZCRxfQK?= =?us-ascii?Q?llpS8Bzi9RrK/n21WDoN+HJQgGTiaehwqv7QveBUBURbKF1/kmEXyJDITans?= =?us-ascii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cam54NRKb3AtvneqX1+fJ52hxA8tlT3pUnjksaFb3BAE5bbVURxiM8qWh7JpeI8K+1pKp5KhRp4jm4g7jiD+zC5P0/n2bA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY1PR15MB0170;7:dUjwFr8E4QVUf91JL1hjiT0ALHKGy98A16V9wWzifXgY6AByIKg4fv8wtRRpU9u/tY4jIO9206CGk5e6UFBkBgQV7XI/th2ffqza7wTulenSLijAN+RJEl+hIPMgkuiwaCEE+TWpFOWwPBA2vOM4EnJgMZCcXdziXg8V6Iot4NArnn6ZYOZ6QVN2SC2qVSr+g6tbPBI6ZagFmu0nJHJwkPGeEmmHb/pEcGA638ScoVvQr8eS4qJy4BUyMfIctvsO;20:/42MwOMpK2ZwnSHMCZvidNy7DL4bnGNUOk1rUcQhv+exsKrzhY7tX9HpbBlE50jAFipVbchzUIYYGw/9VoThn62daFeb/TCaNFMoIhYpclSPKkGwTh1UfUkWxtUq+UOV6+vAaKgRlmSrHWnBe7BTTBWflds1BC15ENYc5g68n5Y= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2018 16:01:37.5871 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d8702130-f196-4aa6-15c1-08d5ecc7be77 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR15MB0170 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-18_04:,, 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 Wed, Jul 18, 2018 at 03:07:48PM +0200, Daniel Borkmann wrote: > On 07/18/2018 12:55 AM, Roman Gushchin wrote: > > On Wed, Jul 18, 2018 at 12:38:50AM +0200, Daniel Borkmann wrote: > >> On 07/17/2018 12:57 AM, Roman Gushchin wrote: > >>> On Tue, Jul 17, 2018 at 12:30:18AM +0200, Daniel Borkmann wrote: > >>>> On 07/13/2018 09:41 PM, Roman Gushchin wrote: > >>>>> bpf_prog_array_free() should take a generic non-rcu pointer > >>>>> as an argument, as freeing the objects assumes that we're > >>>>> holding an exclusive rights on it. > >>>>> > >>>>> rcu_access_pointer() can be used to convert a __rcu pointer to > >>>>> a generic pointer before passing it to bpf_prog_array_free(), > >>>>> if necessary. > >>>>> > >>>>> This patch eliminates the following sparse warning: > >>>>> kernel/bpf/core.c:1556:9: warning: incorrect type in argument 1 (different address spaces) > >>>>> kernel/bpf/core.c:1556:9: expected struct callback_head *head > >>>>> kernel/bpf/core.c:1556:9: got struct callback_head [noderef] * > >>>>> > >>>>> Fixes: 324bda9e6c5a ("bpf: multi program support for cgroup+bpf") > >>>>> Signed-off-by: Roman Gushchin > >>>>> Cc: Alexei Starovoitov > >>>>> Cc: Daniel Borkmann > >>>>> --- > >>>>> drivers/media/rc/bpf-lirc.c | 6 +++--- > >>>>> include/linux/bpf.h | 2 +- > >>>>> kernel/bpf/cgroup.c | 11 ++++++----- > >>>>> kernel/bpf/core.c | 5 ++--- > >>>>> kernel/trace/bpf_trace.c | 8 ++++---- > >>>>> 5 files changed, 16 insertions(+), 16 deletions(-) > >>>>> > >>>>> diff --git a/drivers/media/rc/bpf-lirc.c b/drivers/media/rc/bpf-lirc.c > >>>>> index fcfab6635f9c..509b262aa0dc 100644 > >>>>> --- a/drivers/media/rc/bpf-lirc.c > >>>>> +++ b/drivers/media/rc/bpf-lirc.c > >>>>> @@ -135,7 +135,7 @@ static int lirc_bpf_attach(struct rc_dev *rcdev, struct bpf_prog *prog) > >>>>> goto unlock; > >>>>> > >>>>> rcu_assign_pointer(raw->progs, new_array); > >>>>> - bpf_prog_array_free(old_array); > >>>>> + bpf_prog_array_free(rcu_access_pointer(old_array)); > >>>> > >>>> Taking this one as an example, why can't we already do the rcu_dereference() on the > >>>> 'old_array = raw->progs' where we fetch the old_array initially? Then we also wouldn't > >>>> need the rcu_access_pointer() on bpf_prog_array_free() and yet another rcu_dereference() > >>>> inside the bpf_prog_array_copy() from your later patch? > >>> > >>> We can, but then we have to change bpf_prog_array_copy() args annotation, > >>> and also all places, where it's called. > >>> IMO, basically all local variables and function args marked as __rcu > >>> should be not marked as RCU, but fixing them all is beyond this patchset. > >> > >> Right, agree, the __rcu markings seem somewhat arbitrary. :-( I think we need to > >> investigate this a bit deeper and do a proper audit on the whole bpf prog array's > >> RCU handling (probably won't get to it in next two weeks but put onto backlog just > >> in case it's still unresolved till then). That said, given this has been there for > >> quite a while and it's rc5 now, I think we could start out on bpf-next with the > >> obvious candidates which should be okay even if it ends up bigger. > > > > Totally agree. > > > >> First two from this series we could already take in if you prefer. > > > > That would be nice! > > Ok, done, applied 1+2 to bpf-next, thanks Roman! Thanks, Daniel!