From patchwork Sat Mar 13 11:37:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 12136735 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 347A2C43381 for ; Sat, 13 Mar 2021 11:38:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0236364ECE for ; Sat, 13 Mar 2021 11:38:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233507AbhCMLhd (ORCPT ); Sat, 13 Mar 2021 06:37:33 -0500 Received: from mail2.protonmail.ch ([185.70.40.22]:31339 "EHLO mail2.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233529AbhCMLhY (ORCPT ); Sat, 13 Mar 2021 06:37:24 -0500 Date: Sat, 13 Mar 2021 11:37:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1615635442; bh=ftpGwrO8lUj/+nf3ZEMhVVW9gOAMLofs/x8sHMcxcZI=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=eJQO1rJq8ThcFtAOnrXSWUS0jy8TjW1bNWMzpwsTX40b3DWBYINzUpzVs5DhIz2EI uoDh0E4vEmkCaMCHbydHF3U0TJ+J8weKrIsZ5Myu68oTX/ocoU2Nz7LnqYXCZlS2ST Z3fs5IQNLW+c8o1fvCREYJLcJ0bw5tT7rzTm0AdKhI1hgBXARx7fVF0p14NOXEzNVR bOCZ/DMAQ7ryfzbsNhAwVf9ijx/XJ3ZXmYunQFyfXwrg7FUQDgqNC8Si7rWOVIqQ9l GI/CFHxZVLM+2GPrlMPywwPfqS/U4thSFM8iJLjPmoAUTQJmNNCWsxhNpHOltdJuvJ JAs3a+EYDv7jA== To: "David S. Miller" , Jakub Kicinski From: Alexander Lobakin Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Jonathan Lemon , Alexander Lobakin , Eric Dumazet , Willem de Bruijn , Kevin Hao , Pablo Neira Ayuso , Jakub Sitnicki , Marco Elver , Dexuan Cui , Vladimir Oltean , Ariel Levkovich , Wang Qing , Davide Caratti , Guillaume Nault , Eran Ben Elisha , Mauro Carvalho Chehab , Kirill Tkhai , Bartosz Golaszewski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Reply-To: Alexander Lobakin Subject: [PATCH v2 net-next 1/6] flow_dissector: constify bpf_flow_dissector's data pointers Message-ID: <20210313113645.5949-2-alobakin@pm.me> In-Reply-To: <20210313113645.5949-1-alobakin@pm.me> References: <20210313113645.5949-1-alobakin@pm.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org BPF Flow dissection programs are read-only and don't touch input buffers. Mark @data and @data_end in struct bpf_flow_dissector as const in preparation for global input constifying. Signed-off-by: Alexander Lobakin --- include/net/flow_dissector.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.30.2 diff --git a/include/net/flow_dissector.h b/include/net/flow_dissector.h index cc10b10dc3a1..bf00e71816ed 100644 --- a/include/net/flow_dissector.h +++ b/include/net/flow_dissector.h @@ -368,8 +368,8 @@ static inline void *skb_flow_dissector_target(struct flow_dissector *flow_dissec struct bpf_flow_dissector { struct bpf_flow_keys *flow_keys; const struct sk_buff *skb; - void *data; - void *data_end; + const void *data; + const void *data_end; }; static inline void