Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1163955imm; Fri, 13 Jul 2018 12:43:49 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeLdtfvgBT+0TjDimirM8MklRCjCLgy6figrK2ZFD2/1cfJ0tK1kAPrPBuuM/z/7iAf+585 X-Received: by 2002:a17:902:6acc:: with SMTP id i12-v6mr7684786plt.278.1531511029564; Fri, 13 Jul 2018 12:43:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531511029; cv=none; d=google.com; s=arc-20160816; b=0/+QWSgigf3HGSd1+20Srir9W5BPHHgRCOUjaEZOk7HAOYS1h7y04blgr8FEJ2YFUY Hz95NA1hrWnXEK2xYAj3R4Lj+jr8T5LXoCJGsSzR+uifp7RL0egHoWdpakuIes5589HN h7SQ9mTEy9sOmmNAC/jb6+IeOiPLUrRKHFPTyC5SUogkf4jMRZ24UqKfmx/7jXMpsRI6 /qPaox4/J75cO3xCVwSJqfLi4q16eQicBO0ZHSzSjU2hSqn3wKaMqWvtfe8JQshV6lek f3YvD7dgvo1loOA8G2w6/LPpdZRB95H/3zkwnGf4MaPd6G6Pcjot3LX2KeW4Fn1w/0o2 2j6g== 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=gECjGceX+g/D27H221wy5ZSl4ETKuQtv1dD7iGug5Ug=; b=UZLDOn9Yh3Y5ybMxapq1pni61J4YeN72YaClAWcMrtRvNyt2VAGoKIYIGR6ZOWdm5W zLrIw71ZSXxtBoYXrl+rw76NrI0X2Skotmxd2qzN8G5C1b7grrwLKLwzbKqtPMMAYyAP R30UeTv/5RaFsHMMdGkf93DmSqZRCb2tSfJCe72ww+Y6BhsclxM83QSgqu+zI/LpknbG BY+bKGtroSb8puuudrF3J8UiKAREyl+fBQvr8lxoy7l9BlOiH7Gi8XuXb0BUFiCO+iU0 IThasSLMxwSVxet9sFPWVeRnTvqLEjcCcOhd/hUXr6A2SC1+nDRCE4Vrq2gmipTKBALE 1lNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=JW9kFXcX; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=ZDOe4bCG; 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 e6-v6si6411839pgh.50.2018.07.13.12.43.35; Fri, 13 Jul 2018 12:43:49 -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=JW9kFXcX; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=ZDOe4bCG; 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 S1732829AbeGMT61 (ORCPT + 99 others); Fri, 13 Jul 2018 15:58:27 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:39658 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730038AbeGMT6A (ORCPT ); Fri, 13 Jul 2018 15:58:00 -0400 Received: from pps.filterd (m0148460.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6DJcpc8013895; Fri, 13 Jul 2018 12:41:40 -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=gECjGceX+g/D27H221wy5ZSl4ETKuQtv1dD7iGug5Ug=; b=JW9kFXcXUvA/bfPdSNRwbT/Kf15NBCptpmdQUfv7mwQN9hpnRDonDgsDb4PFOFfg8Tnh ty7xhRSEJNAT2RkIgB2FBnF7pV1KJvMDpNttphFlPoMlTL5TRp9GOqv1ckpsRnM8Opyl sWqe6tXEkCVaZWH/HFOXzyrIVo34Gd3wYv4= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2k7075rd26-5 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 13 Jul 2018 12:41:40 -0700 Received: from NAM01-BY2-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.13) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 13 Jul 2018 12:41:37 -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=gECjGceX+g/D27H221wy5ZSl4ETKuQtv1dD7iGug5Ug=; b=ZDOe4bCGh4/SOQjhR/ToRi/xrtKS4Xfw1+HqXHLaoUmXcdXL4wYiVKgw1AX87UTMxm1EXxf1gBoeI4aBVdgWUFHMuyRomwHhPMF7tvgMzcM/Tqpnod9r2OTlooNQQ7p38z8vGcoWJ8X6xtGdyEjdGObkvIfLCCkJzoBZ8FGmNqo= Received: from castle.thefacebook.com (2620:10d:c090:200::4:1cec) by CY1PR15MB0171.namprd15.prod.outlook.com (2a01:111:e400:58bb::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.952.18; Fri, 13 Jul 2018 19:41:32 +0000 From: Roman Gushchin To: CC: , , Roman Gushchin , Alexei Starovoitov , Daniel Borkmann Subject: [PATCH v2 bpf 4/5] bpf: add missing rcu_dereference() in bpf_prog_array_delete_safe() Date: Fri, 13 Jul 2018 12:41:13 -0700 Message-ID: <20180713194114.2711-4-guro@fb.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180713194114.2711-1-guro@fb.com> References: <20180713194114.2711-1-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [2620:10d:c090:200::4:1cec] X-ClientProxiedBy: MWHPR14CA0063.namprd14.prod.outlook.com (2603:10b6:300:81::25) To CY1PR15MB0171.namprd15.prod.outlook.com (2a01:111:e400:58bb::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1bef757c-6858-4b07-2bc6-08d5e8f8a33d X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:CY1PR15MB0171; X-Microsoft-Exchange-Diagnostics: 1;CY1PR15MB0171;3:+VuSixTirp6GK4zwd3SB0qVS8AXILsPnrcS7z667imHTS8pIdk1xPUonKZ9btZhgj0XMULJ/RXtmf6rJR3t2L5bOWca6bCRPOT9o1PYvmBla7+5p7AK2egsuNnJxeBvttl4FsT6CIf9GD5GLh68HpH+oYPPigkJpEzBu+dSDA2lrRDmGS1rApkhkrqhKCG3MuztHrIX6ED274pZI1YPWWESJA7M787pqK9aQXmpsT2MaFz7pq3K+sLZgPqDXeguQ;25:0x4AUG4OI66dtiLq/fMAkJ4tn21W4TJ4jxtzzTK5+ultboWVcYzSlZ3dpzorM3eGHWd6oy8eLbINeJi9HpgGv7hHrB46bzW9aQHQiz2xXb6gXlsJP+ljpHT7LEpltnQlYIVBx5OhLcwxT3SMXRVBLUBGsVuLejyOBXsB7Py94KW1LwXsj7Mn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3lAT6xwXbtBbyHajBUKZtp/q4qDF1xh0QR5PObA+qTW80NdHnNKnqWd4O8IiEzza3h9qhg50n8KR2LZayekuOw6oNp36NmRJcUvOVKWuVIQ4+B+3A+0XlpWCbiVrvfrmrNJwU7zoPy3jPHJcte2712KVd47OUkQ+k5qi+EFRkgzwQlFoFvBKyaP8/MB2Y4Flf5n3pS2W5bUjjMa0zRXUqbn+8SBvn9KOYSscvV+ 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)(3231311)(11241501184)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(149027)(150027)(6041310)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(6072148)(201708071742011)(7699016);SRVR:CY1PR15MB0171;BCL:0;PCL:0;RULEID:;SRVR:CY1PR15MB0171; X-Forefront-PRVS: 07326CFBC4 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(366004)(136003)(39860400002)(396003)(346002)(376002)(189003)(199004)(53416004)(52116002)(16526019)(6506007)(6916009)(14444005)(50466002)(48376002)(386003)(6666003)(1076002)(8676002)(46003)(186003)(86362001)(6116002)(5660300001)(69596002)(8936002)(47776003)(6486002)(305945005)(2351001)(7736002)(478600001)(2361001)(81166006)(81156014)(105586002)(50226002)(76176011)(68736007)(106356001)(11346002)(54906003)(51416003)(476003)(52396003)(446003)(2616005)(25786009)(16586007)(316002)(36756003)(4326008)(2906002)(97736004)(6512007)(486006)(53936002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR15MB0171;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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P3wxJJa6/nr70WV3B/HoBz2P?= =?us-ascii?Q?U0uSTzYUfK6tPILKEgfe5YAiES+dVqVwZgl15qxSS/cy+7sL6lWbV2KaGu3Y?= =?us-ascii?Q?PqY1XYMgWuBZqzA1yvl69KEa68mejHlWipCYV7/o2kg0yyRIeI4OIQ1nMiEe?= =?us-ascii?Q?fLxVRSRRJaUpQGS3vwSWKXPz+UTzvvzYM3QNjcFYNAYmgmGO64MFgax6HeNB?= =?us-ascii?Q?PMLm/YO+nImpvdeWadQbRRYAbW1KB2v02O7sy+4BIQ4J2G4o877Gypx8dMGE?= =?us-ascii?Q?Buv4A6UuJ8Plz5f4x70W63fkH1wN7INiIOfwCqiTXQ5ICDc/raX7f81IR1yw?= =?us-ascii?Q?t/HwRc4ZFQB3IprMlgITMQyOEhQ2uVdKt4d2PL+s40gkJV/2UNnPsNp4G7sr?= =?us-ascii?Q?q3JH6LpDVF5RuFMs+s4Ta7B3oY202SvlWq051Mgn3LHIa6ehEx6fCl5G+/uW?= =?us-ascii?B?QT09?= X-Microsoft-Antispam-Message-Info: 07tqZMWJlvoSF2alcoU1rcH/8SxVsVyhgy5E6QllkN/JRTmpSTL4mZaohFwypcQ4LgIWDBeN7P4eFS8I62utj1lpeTFr/H+z962H9U6OGT/CcJk636H6QICcSULt2vkHtx8uFHMPFXTePGM6L5GB+cIvE6hwQSRBieo7+M2PfE/tGp50mBOqSxSYtaeB88V6NceJcPhdiLAI6pCPSqByg+pDLNi+ndX44otu+EfMMx4RB8tvnQurkVTuRFvhqyAZRzLj7Ne3RCQK8fBiCW2pQsvXIlj/rXJJ0SqI/oGokOOGXKwayKWcKBIG4in+zlKYF3IEWSbpidEk/DV2p1Emwt/l+10IEMOKftYKownsYP4= X-Microsoft-Exchange-Diagnostics: 1;CY1PR15MB0171;6:QtAR8uipvyUdC34gsw30Sp4nZYpexxKMUoJM7oDBScuDda69KmbRJ8GSeGuZ8DZVLeIC+ip3LC0hGKOEDWsPlTV0J6JmhHS1APg/sot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rWWM9JBAOz0mFC50iKmEkxkjHJEDUle7BVVJjQGGFtf/X/8cDlfpLHVdbxp4WMh6JGIQ3Lbz5ongssoHZzUNDtVZ1Vg= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2018 19:41:32.3875 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1bef757c-6858-4b07-2bc6-08d5e8f8a33d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR15MB0171 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-13_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 There is a missing rcu_dereference() in bpf_prog_array_delete_safe(). The progs argument is a __rcu pointer, so dereferencing should be performed using rcu_dereference(), as, for example, in bpf_prog_array_length(). This patch helps to remove the following sparse warning: kernel/bpf/core.c:1629:34: warning: incorrect type in initializer (different address spaces) Fixes: 324bda9e6c5a ("bpf: multi program support for cgroup+bpf") Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann --- kernel/bpf/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index fdf961f70deb..722ae6913dc0 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -1625,7 +1625,7 @@ int bpf_prog_array_copy_to_user(struct bpf_prog_array __rcu *progs, void bpf_prog_array_delete_safe(struct bpf_prog_array __rcu *progs, struct bpf_prog *old_prog) { - struct bpf_prog **prog = progs->progs; + struct bpf_prog **prog = rcu_dereference(progs)->progs; for (; *prog; prog++) if (*prog == old_prog) { -- 2.14.4