Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2967395lqz; Wed, 3 Apr 2024 14:00:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUnpF37deKVGoExlYKBGqivoKswU80nya94c3sUa4ugp9jqwcBYNf13frNsFPEEJqPHFEwolqiGCbbC3We+N0YK7aJgJYFyaSWF1Mh8IA== X-Google-Smtp-Source: AGHT+IHvGYQN6ZiT/p+iXu2Rb036ju8O0i2th3SqYnv5Mkg6Gh2viGe9TouOZiVH38OCXcO7a+7z X-Received: by 2002:a17:907:7f08:b0:a4f:5601:104 with SMTP id qf8-20020a1709077f0800b00a4f56010104mr735014ejc.25.1712178013098; Wed, 03 Apr 2024 14:00:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712178013; cv=pass; d=google.com; s=arc-20160816; b=jGN/79ySAlhB3BA9br9Fxk52ruanTcnkevCiBBmMb4jO+ogQJyZ+Z3CiPK+tCckwn9 KlKcPZ9Cev2LbjvenSBVbNenxAJQrHs4lTKSKwvBS4h9JxFRkmbAsAWSHOKM379XN8C3 SgzLeceZJ9GPHShvydjtLq6LEhb5oUltbdIP+hCOdXTYDdArhlAkh5Ow0m4eXvjJNaIS Wfo6ZeXbspLURlVj93Sg29jJpMUI9A+uo8zo6secrWX/VecdVBJRms9NnNHSMlKpyL2r tcN0FoP4GG2I9aX8/0e9bH8XSbJA+s36RSh3gYAxXd5ilExG+HgN1WzGdv5/GFGsvyGg hMwg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:date:references:in-reply-to:message-id :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:feedback-id:dkim-signature:dkim-signature; bh=TkyKpF4n3Cq52s0X3ZL3E7R1KrZzCnoADc0YqLDsh/k=; fh=1X0gYhKlEzOTKm24/FdYKCFUbYp0aTaY1kF5Fkyad+k=; b=mtshHuT1BzgaScbT9ST/Ww/AKfCht5vtPiwzPIAaOayom8Hfv52M1aDSSzuheCxYTM puicKjCvRDdhn7EZ6r9errm73SNd6X+KrXC4s6hhsM/sHdwbLG1vVnbGL3xAiMkt8/J/ WZ/UyIIHr/7PsQzQ7EhHup7kc/PGXzyZl//8NdpwO2bPLvsOnMmyNGrvqX9pJR+hymb9 LAEHO4X+8IbNvqDDJ8Br2+QmpTIAXNdoEQp1xAyr4Ter0VV348hjZ8eogGDWKmEhTK6U 99KFN8JHGuXbc2Y5J6zj3FKqpykPn71oCkMRAgBZ0iWTG5B7ql+rXQJzJEcJ24RcI/OK oSSw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=bMjpQfbV; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=CIQGSrnF; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-130598-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130598-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h18-20020a170906111200b00a4e25416e54si6648600eja.6.2024.04.03.14.00.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 14:00:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130598-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=bMjpQfbV; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=CIQGSrnF; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-130598-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130598-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id CF7631F2227B for ; Wed, 3 Apr 2024 21:00:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 99FAE15664D; Wed, 3 Apr 2024 21:00:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="bMjpQfbV"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="CIQGSrnF" Received: from wfhigh6-smtp.messagingengine.com (wfhigh6-smtp.messagingengine.com [64.147.123.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3400153BF3; Wed, 3 Apr 2024 21:00:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712178002; cv=none; b=XV8d7gCfz48laHKaS+kGhiSGC/2CjtfuhbaM6LSn46gEGtioFFImvQHaahOxsYq6ZpqEfla+gU383yw577qRXEksSax3B7LC9ougV01eFKe0QWPJ0D4ZMvPAu/UKR64G68ijMwPhqKi5jacAl04M87cr6GpuBvzF/CATkoA6kfM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712178002; c=relaxed/simple; bh=z2aFj7Yero9UEAl+EmXBknvXwFagdYrg8gO/nPAA5PI=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=YxH7PfYQJdLJBaRKZo/lvdfNWmn78kCSvfAfkZnUNmolscKQdGA44BXMJhMSYgFIcVFbmIS9FOrnFcGJFk3cA0ejoSprfWe/t48sz8H8lPDb3qGaQrpsLBW3BZX7i9+kAwJ83T98IGYG9FQ8/5RMzTTzePG45HPlYB9Qv9Y+RtY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=bMjpQfbV; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=CIQGSrnF; arc=none smtp.client-ip=64.147.123.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.west.internal (Postfix) with ESMTP id 506BD180010E; Wed, 3 Apr 2024 16:59:58 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Wed, 03 Apr 2024 16:59:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1712177997; x=1712264397; bh=TkyKpF4n3C q52s0X3ZL3E7R1KrZzCnoADc0YqLDsh/k=; b=bMjpQfbVCi8Fq8X/stkrxnmNLa a9eEqq1QgwOAfhJa8IBNoTc9TmPgl8k37iGa3Plj+yL82KuU/DHLiW+B0EgYL82c 02tVQS6fGmyZwYLxqYe78UZVRUV2mMN5Esd/08WwqhNyFJnJG5un/99DDmFMwWJW Az5K6oBjccQ59rLVezsvSSIgR8itvVTkbtC7jvrMY7NfxDzqNxrboKzUGqXNJQNi YyEsWKJ6or2z1WSTEA2riV00U8oJRsjYk9nuZTZA0u6iQkwzng051T0bgvZmXXPP VRHZnfJUFtIoxLojPbaHAglzRdn7e1lXGHeVQhMviK/+OorI/43OpHbHQFVA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1712177997; x=1712264397; bh=TkyKpF4n3Cq52s0X3ZL3E7R1KrZz CnoADc0YqLDsh/k=; b=CIQGSrnFZRNZgMpARGSyCT5M46ioL1XGSw7MA0g7Rydv zQYYjGI4sejaWCkb1bXdvVklGyJXheHuMfcxVjySSplR2bL7EkH3oyVUTIcl3Gai GRPNR2tZJraIWZvwn5KzpR22QuKSAe+H/q/bRz04wgH0bXdpjj0tB9CO4CCBuABc JG6u7OvcvJPWSiT9jPR78+639l1b3s8ex+E/W3xiVe/aTUxK9Sv6x4pVOmIGaBI3 2bEcxjq0cO+cB5msjHtB12nJhcKNH0JPZEy/brteYOce2+8Nno6d0bwX3DLJrcdy m4VzX7YEp2FHkgYzSIWEumxrId/cRz6NUlyjxfgMOQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefiedguddufecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdet rhhnugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrg htthgvrhhnpeffheeugeetiefhgeethfejgfdtuefggeejleehjeeutefhfeeggefhkedt keetffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grrhhnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 251F5B6008D; Wed, 3 Apr 2024 16:59:57 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-333-gbfea15422e-fm-20240327.001-gbfea1542 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <701f8f93-f5fb-408b-822a-37a1d5c424ba@app.fastmail.com> In-Reply-To: <20240327152358.2368467-20-aleksander.lobakin@intel.com> References: <20240327152358.2368467-1-aleksander.lobakin@intel.com> <20240327152358.2368467-20-aleksander.lobakin@intel.com> Date: Wed, 03 Apr 2024 22:59:36 +0200 From: "Arnd Bergmann" To: "Alexander Lobakin" , "David S . Miller" , "Eric Dumazet" , "Jakub Kicinski" , "Paolo Abeni" Cc: "Yury Norov" , "Alexander Potapenko" , nex.sw.ncis.osdt.itp.upstreaming@intel.com, "intel-wired-lan@lists.osuosl.org" , Netdev , linux-kernel@vger.kernel.org, "Michal Swiatkowski" , "Marcin Szycik" , "Simon Horman" , "Kees Cook" Subject: Re: [PATCH net-next v6 19/21] pfcp: always set pfcp metadata Content-Type: text/plain On Wed, Mar 27, 2024, at 16:23, Alexander Lobakin wrote: > +static int pfcp_encap_recv(struct sock *sk, struct sk_buff *skb) > +{ > + IP_TUNNEL_DECLARE_FLAGS(flags) = { }; > + struct metadata_dst *tun_dst; > + struct pfcp_metadata *md; > + struct pfcphdr *unparsed; > + struct pfcp_dev *pfcp; > + > + if (unlikely(!pskb_may_pull(skb, PFCP_HLEN))) > + goto drop; > + > + pfcp = rcu_dereference_sk_user_data(sk); > + if (unlikely(!pfcp)) > + goto drop; > + > + unparsed = pfcp_hdr(skb); > + > + ip_tunnel_flags_zero(flags); > + tun_dst = udp_tun_rx_dst(skb, sk->sk_family, flags, 0, > + sizeof(*md)); > + if (unlikely(!tun_dst)) > + goto drop; > + > + md = ip_tunnel_info_opts(&tun_dst->u.tun_info); > + if (unlikely(!md)) > + goto drop; > + > + if (unparsed->flags & PFCP_SEID_FLAG) > + pfcp_session_recv(pfcp, skb, md); > + else > + pfcp_node_recv(pfcp, skb, md); > + > + __set_bit(IP_TUNNEL_PFCP_OPT_BIT, flags); > + ip_tunnel_info_opts_set(&tun_dst->u.tun_info, md, sizeof(*md), > + flags); > + The memcpy() in the ip_tunnel_info_opts_set() causes a string.h fortification warning, with at least gcc-13: In function 'fortify_memcpy_chk', inlined from 'ip_tunnel_info_opts_set' at include/net/ip_tunnels.h:619:3, inlined from 'pfcp_encap_recv' at drivers/net/pfcp.c:84:2: include/linux/fortify-string.h:553:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning] 553 | __write_overflow_field(p_size_field, size); As far as I can tell, the warning is caused by the ambiguity of the union, but what I noticed is that it also seems to copy a buffer to itself, as 'md' is initialized to tun_dst->u.tun_info as well. Is this intentional? Arnd