Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1164257imm; Fri, 13 Jul 2018 12:44:15 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcNv0vz5S/UfmIrGTvHZylUDHF0F0IiuxiiGaQ7Eal2MkoaP6UDfp239NAbTxc9Hx1/7aeQ X-Received: by 2002:a17:902:6845:: with SMTP id f5-v6mr7618699pln.173.1531511055610; Fri, 13 Jul 2018 12:44:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531511055; cv=none; d=google.com; s=arc-20160816; b=F8VwIqAjm6mcLentW0lblJs7Vulfq0xFNKKin6yvgjUADGugZntAw0FP8w7rMuQzYn QP/fZ0ggq9Tz6MlZ1Ai/slbJvvgYZY8srdgLvhNdBdL/3AQ6vroN3p1J96HKpH7y+2ZE xauE6rcCVmVHD7v8ZnPBl73lRKxTKgojA5yhNtgGsQLf60ughkBWlaqpZWTMwGpoVu+1 JPd9IHsSzi3o/AWfUWuCq2xrmGEFWqRKHjEDRJitOUMR0LzmqMkNJax1UMPhgVkSJSOg iviMFgCZZlxkgN4LtAv3wo9Ydfz8zD6HW1NA5RWKNFL5LY0hoYzIC7S2nU89uosOzEfX DnTA== 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=t1UQxPEtkjAl5mkC/90yoJAEQtIZvQtPetPysB9zJTw=; b=vExNMe09grTL8ZOXsp4nHm+2fublQ5myfBOgU7QZ6uiR0Gaz0pYjCxfhOvZrUAwQ9w OLpQCZtoJ3RkgHYktNW6sx1TgSJI9bACwE8JC18GMEQtTEZ5lp5lamz71tNA0Ivmi4Gz eFlBA/4GR7F5ayNA/6cGekDSpS5Dfxs0aR1uo/T746zo8c6tysRiCqUwexXxwKCxeOoe lh/O/LOsTtCzeQj+cNrl8zw4Kabtta3K/X0sCRjcoXAEoGoQXfyai6/CcQgoQkQ60oUc A9X1P1tTqipjBEZAyP9kHHsIPBwbrzHF2+eYF0jSxEmiRip9J71bsdvTnn0J1NmDoRL3 P0RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=eIue8Dtz; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=VurghPpk; 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 s35-v6si23825312pgl.656.2018.07.13.12.44.00; Fri, 13 Jul 2018 12:44:15 -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=eIue8Dtz; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=VurghPpk; 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 S1731910AbeGMT6B (ORCPT + 99 others); Fri, 13 Jul 2018 15:58:01 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:39656 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730149AbeGMT6A (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 w6DJcpc7013895; 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=t1UQxPEtkjAl5mkC/90yoJAEQtIZvQtPetPysB9zJTw=; b=eIue8DtzKuvwLWS7qKR+nkeR5PlB2W2xpqXKJ7KVPHiX4wNmtaZs0S3PY9taNeZB9MB0 9xrya58FGlogEaZNS8r+luJCcvNjG9SuINA0Pya1hDpg7A34+UssNePwNV17YyOL9H1O shdDYlqIT870mMS9/2v3+Nfs45lM49Oc9A8= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2k7075rd26-4 (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:38 -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=t1UQxPEtkjAl5mkC/90yoJAEQtIZvQtPetPysB9zJTw=; b=VurghPpkcKw3IiLiq0Nq7qZ0EWmjswtEcVhiuxHc1a82NMsS4MrAyMwthA0pB0BDrEVpmFrebvuJA+sz0U4RN5NppSC/PUMi8KwEh0CRMpA+y6kjPR+5brClqA4MEPcN22SSrBpfLvC84wbnEe1RAjf1PtjbhsWMXHQIT/ugFuA= 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:33 +0000 From: Roman Gushchin To: CC: , , Roman Gushchin , Alexei Starovoitov , Daniel Borkmann Subject: [PATCH v2 bpf 5/5] bpf: add missing rcu_dereference() in bpf_prog_array_copy() Date: Fri, 13 Jul 2018 12:41:14 -0700 Message-ID: <20180713194114.2711-5-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: 5cf18761-1830-4736-a267-08d5e8f8a3f7 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:G3JKIszkG2n/0cg4P/E+T7utURslgLSsCgRU/taQWesAWsPMU31j4APC8uvFqICIRbPNkESaoKMym8dlLLejum4FH7YyDGd5guWQ6rqhPDe5IUOAwx1rZ1uJiKY9nql/9EkFgQOWwXvYfJfh6/niXo7KsLXKPhIxihbpTE2fTpr3WsVvmaAsbecCj83oZopL8GRgYwunBC3/CiC5swe+cY8fO1n5W0JouBHDFvLPtPzyfv0Vzh+WdWqttuVMjEoC;25:xQlpZLR5Q7rce39bczRUpFg7aDbRgOZjsBcCjdO/ACwmn1141oUeiTK4ri4rswOQJI+8qfK5DV6ukvG9YIkkduu7ULtJMAlL+NKyMdqJ9LwX2ymzqFTNMBA47RqM5srljGGvY+isfGCZPa2vWstsS5wh7vGKAYfs0Z1TydkXN/ArUOd5ZGaMY3Rf726MU/KylPnewVgvJM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iUFtHoJFd7hYAN0Qm9Rsu+xww1O3+w358PZUyK7fbuGwQLHCVU+kkZenEMdbj884ifdg3COUjIm5ox49tSWbMtjwJfvkA25Vm21cmk1/x7jkmKQZf1N76z8qxO9Nrqk43lE6JpqOD3WKWudJMU96auMtdGgkR84BokRTdQNEcGkqAoDgz5PSiwLRZFGP6L3lSeFALbiP8CQIZ 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)(5024004)(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: =?us-ascii?Q?1;CY1PR15MB0171;23:UV7LpG+dzk12eD6xuTA4D/JQPFgpdEBZtkyZigOwM?= =?us-ascii?Q?IMIocuvglNhYP8Rfq1y4wZ8UTWl/elXslRO9KOlsQhfq4gDqrIwjOqmR9Pib?= =?us-ascii?Q?jNDkxTNJNGTbJSTCSQpZe6J3FlIYlRG3EuSH+Ew11VYkw6EAi1BUE8L20rHm?= =?us-ascii?Q?VGOwUthRl5ApO9NkrRbsfU/rSkr57mvH0AG2sgvh714/r1sDD+QPBJOPkvju?= =?us-ascii?Q?fftH0QZJFqquwtRzswcJBXO+IVQUQisZFCqkCUzA8IvrLybgI9EjNzdcp//l?= =?us-ascii?Q?zGFS7bLIj0x9kvdwBLu5qoPOJdAYJiat6CBO8A1r6aybzKUO6cbtZWdT70nl?= =?us-ascii?Q?6tJEB8wTIfZLDewmbx0/oUIkmJh9C3PXWcUKNJQDOQJza1mHsdcyQGHGksok?= =?us-ascii?Q?5BvRoosNiQWEloTMqlEeOAvNrFLP5OJlPK8UoVRjjiK27HWM92m+YUyUJIaG?= =?us-ascii?Q?nADAZ+2iLvdFLWmmBMct0hjrs2oKITbYX9I29nSn2V1tiondS+hzgWo5Om6B?= =?us-ascii?Q?oltUOhRRfP8PvKmyprfA5F5mb5XRHtrbIXRWLS1ADZQtkGoxKlxmDcKjARJr?= =?us-ascii?Q?BBpPTxtejzNBYOwQx93vtMQpj/OXgImYnxD19ym2a/VUA02YFIYrssOUB+FD?= =?us-ascii?Q?UPE6tyle/wICTXGhrl7rsdX6IwxUzuX8wsdw0pTEUoMXmJZd7+qAixFjM1cW?= =?us-ascii?Q?90ys6v5iTxFLQaz3taJD2+yHke2xCCijdGEZvLf85sT48Be2yND+gO4FYtFi?= =?us-ascii?Q?xXKzR3nhDFWLdtBYTmShtbCCv3C+iRZ/YPYA24lPObv+0gJOlmc5wwFt8vu6?= =?us-ascii?Q?DXMC424XV+M8ybJArqS0ql6CGIZMo7jpNSIakQlhZknLaZw8k3VrOTZjcyLE?= =?us-ascii?Q?XPgQFhr0gPRJGYcxSJ995FTjGNu9uUjJEFzZPJtpn7LySXgz0NdQfeEt2Tq3?= =?us-ascii?Q?Tr1nM9YCWSvXUAUwodGvffUO+JesRDWI8vK5eisdg0Q/fAgP1aZyH7uKUxcv?= =?us-ascii?Q?Vt/ieY2rnQ/eupNjHaWt/lTGgzy/712kNNus7RsO4SRjUBB3ShjrXzm0tjwT?= =?us-ascii?Q?Gld76lugZI+cXPSioDBdr+3pu4uF82/sHmkqkSS/dG0Z3o+aXdPP70sUwUW5?= =?us-ascii?Q?R9tP4hk4aWL3J6mvaQXBYT3WOU2C6SxF6ArDfLVDsfKuQhcIXgS5U6yFf8K8?= =?us-ascii?Q?KOQIrCe337ARYTLFOW1eUIb5aimzwGK531ku/pKkx2Hbj/gv8q3KrH56CQP2?= =?us-ascii?Q?nG0HtrhAE8L27MbjuZljO6eYFQChrAl/RSlvgqXabCf3LhpCHU3IqGxFumx2?= =?us-ascii?Q?vUHOpFE6F0wvUX9QI3RJJk=3D?= X-Microsoft-Antispam-Message-Info: FvSTsS0UV2hYw5VO2Gv9p21uLWKE1u0TLruSYZt9FWwJon6/JSfOCguOom2PopLkjOfd3MnqDte85FFpBKBVGMJ7xFf/yIdsfEE66a7wgNcJD62HJIWCpfiI/X0SUji/M3g2WS8mwDf9OK3odxKjIPi4uqlb8pPUnbDVIQOh8MuP1tgrksoPchMulo8eKliBnCEzBt8O+sOiLf/Sltv/08BTDTqkqs8jDOrGcrZnEypnBEnLlmjwGJDjpIU7e3yHusck255Uqp66/Nj0csk84Z2BN3u9R9OMxGRq8pYK7lvkiO35uP8/z8UER0OKB/knrV8ZfdW66eGsE6WZ5KtHVrc6OY6/8ehcua4p3VO7+oc= X-Microsoft-Exchange-Diagnostics: 1;CY1PR15MB0171;6:HeXcUn6kHpZ5/w74jAxkCZR/QRhIvYsi4q9VFuzF5njPqixZI8IpsbufStlPlsLhrHADrctqlJe1wThQTF9khVYVIbS2bouzsZaSrlZaMiG55ThDFaF0uQ8rXMtET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BDRwEs/IseIJg+YXuXXEf5AEUAVH0fR1Vqk07O7u5KG9yp46wXPTX1NRkB8NdQKFtYRpCmeZOzY= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2018 19:41:33.6196 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5cf18761-1830-4736-a267-08d5e8f8a3f7 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 The old_array argument in bpf_prog_array_copy() is marked as __rcu, so the dereferencing should be performed using rcu_dereference(). As we do this a couple of times, and we want to be sure, that we copy a single array, let's safe the result of dereferencing in a local variable and use it further. This fixes the following sparse warnings: kernel/bpf/core.c:1653:31: warning: incorrect type in assignment (different address spaces) kernel/bpf/core.c:1681:15: warning: incorrect type in assignment (different address spaces) kernel/bpf/core.c:1687:31: warning: incorrect type in assignment (different address spaces) Fixes: e87c6bc3852b ("bpf: permit multiple bpf attachments for a single perf event") Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann --- include/linux/bpf.h | 2 +- kernel/bpf/core.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 329026baef6e..3cfc8095d2e0 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -363,7 +363,7 @@ void bpf_prog_array_delete_safe(struct bpf_prog_array __rcu *progs, int bpf_prog_array_copy_info(struct bpf_prog_array __rcu *array, u32 *prog_ids, u32 request_cnt, u32 *prog_cnt); -int bpf_prog_array_copy(struct bpf_prog_array __rcu *old_array, +int bpf_prog_array_copy(struct bpf_prog_array __rcu *__old_array, struct bpf_prog *exclude_prog, struct bpf_prog *include_prog, struct bpf_prog_array **new_array); diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index 722ae6913dc0..26bdc99fc807 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -1634,11 +1634,12 @@ void bpf_prog_array_delete_safe(struct bpf_prog_array __rcu *progs, } } -int bpf_prog_array_copy(struct bpf_prog_array __rcu *old_array, +int bpf_prog_array_copy(struct bpf_prog_array __rcu *__old_array, struct bpf_prog *exclude_prog, struct bpf_prog *include_prog, struct bpf_prog_array **new_array) { + struct bpf_prog_array *old_array = rcu_dereference(__old_array); int new_prog_cnt, carry_prog_cnt = 0; struct bpf_prog **existing_prog; struct bpf_prog_array *array; -- 2.14.4