Received: by 2002:ab2:2441:0:b0:1f3:1f8c:d0c6 with SMTP id k1csp168355lqe; Thu, 4 Apr 2024 03:13:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXoeo0C0Zwukxcv+Openf956ApN0aBA4/ug8mFdBjdO7NWK0PQux7JSrngl1587uMgf0Hl/+UV85hb+HNL5Rjy1qbU1sfp1PC9JLY6A6w== X-Google-Smtp-Source: AGHT+IG02BJBAIV+7miLdUlhK0L4C9LhISmuEkmyvt3GljKkh2dn3bWGAdeHL+fIEOPAwk2PZEtO X-Received: by 2002:a17:90a:bd8d:b0:2a2:6735:c426 with SMTP id z13-20020a17090abd8d00b002a26735c426mr2230389pjr.34.1712225590867; Thu, 04 Apr 2024 03:13:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712225590; cv=pass; d=google.com; s=arc-20160816; b=EktmXOEiRGnJNuT7zjZX28U9aXO7WMug6yCz+v3TwCVDAf+IdAZAtUbbb5HBE4rBzw ofcHQ3Tp6+B8Tyh0KAm4EvRt8YZRiOIugpqniBhZ/Zy898VB5r97AVhtIJ52WXWOMzH+ 1JYwN29vtvJ7M2ks9FINoyb93+uS7YnI7Kxq+K9MEq6ODtXqbdOuxK/zoBnJhiJThLLm lUul8nQu7wNJF3lPVppkKlACJr5fdeF4z+dFoOToC38cSErVVybSyFQzlAWUDsgrbD59 zWGkKpooV3czPBTWt/rLdjRnT2C1n9+uOKG0yA976EMwVUpKdT92dKMkKxz6SDfX+zwd y9pA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Lr6yHlvo8H8DrHGotBAwG96Apwp5piBhDx+Xg8NsA3I=; fh=Q7eMnsa0Lokam9A5X9vzFs+NVz5YYR4bujHfZd029Qc=; b=DJuvYS/puvNG/RDkS5yziCgUTIyDQAWFR0jC0eYR9+w0lp+N0M8nm8XWgPpgVmVRqC sDL/nN5c6aaWGt5U7aXp8gJYPGC0XA2u/sRIsFSwH5wI3EmYpPE5fR5ck8kBM10Zi69R M6nQO1iDrVuAbYCdAMoyO+/cYfLZuqHAzKowbCeuPlOmzkrTiH7s9TdOmaXmiR6TyW4O xILrHQKIm3LviPoV2MCfidGtiPF5/21PuBeCQlw0eMQGftZ+69wwnKB8hBcgGrkvSWVT a6ljSPrqt0gSC+crwxWFSQmNXz6CaI20eL6dXgwqj3iSv96Qcd3eL6sR2qCsOsmCtlhq yhpA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Hg8VZYBw; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-131226-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131226-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ck12-20020a17090afe0c00b002a25408f855si1337796pjb.157.2024.04.04.03.13.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 03:13:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131226-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Hg8VZYBw; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-131226-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131226-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 66A4C284827 for ; Thu, 4 Apr 2024 10:13:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 44C6576044; Thu, 4 Apr 2024 10:13:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Hg8VZYBw" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 7EED33D96B; Thu, 4 Apr 2024 10:12:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712225582; cv=none; b=RKYyGQFYyNqbD21AQVI6/Qkx44tJZ4KVB4BZcaIR9pg65f562UEDeqodsXGF9wl7VFbUOd3nABCBtpCNJLx2Ha2Wy3vFWk7X7CZGbampBhFJJLAoKFiH8zkzer8PSZweYcjuxdDI24SzcyzO/aPL70tJK233+5R3Knru4+zn8w0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712225582; c=relaxed/simple; bh=4fg9inJNbedbRInZaMC4enjH7MPlO1J/oWaP14XD6d8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AEVTjlLNR78k+gdj/moc08fVB//sVnJe0IAg/X/MIPpY02f+HjRhOK/ppyln/KgKTHuFusvCOMT30BWJnqw+Bqb72/4rNemypLro+5zqPOwpghZrWOa1hYAaoSij7G7dCsP4DRCU8CbyPT/pHckD9951+36ckN1fhAFQtIOhyWg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Hg8VZYBw; arc=none smtp.client-ip=192.198.163.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712225578; x=1743761578; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=4fg9inJNbedbRInZaMC4enjH7MPlO1J/oWaP14XD6d8=; b=Hg8VZYBwD/hdUyY2N+YORQGaCYCZu4IgsnLDRlVcabqvRxo5MIzppgSu th/PfNk1X1hs8/eqiI44FoyaWCEkHWw7ECbCxgYbGlvYWZ3bA6bqUlC1l sfQNzjv6DIvY2oeGoNJP63dwpytzwrXttTtgvGDsV1CXwg2eB2JGhJrPy lav0ATPh0lIjA1TKERnAM62qSZ2I9m4TRmN/YRtimLreUM7y0XNRe7su1 6BNegYTiGRhXHA5BJo2aB+nv1s9iKtA5Lb6A+oQtEi4XoVRD0OgiJ7R47 2mx7iUimtgN7hc76XnwEejeZBNc5AXOud4JEtC8rA8T9C3gvLUhGxS+As Q==; X-CSE-ConnectionGUID: 9yCDK68WTt2rveY3bD5/xw== X-CSE-MsgGUID: e9QkaufkSbuRl2Tu6d0lcg== X-IronPort-AV: E=McAfee;i="6600,9927,11033"; a="18852574" X-IronPort-AV: E=Sophos;i="6.07,179,1708416000"; d="scan'208";a="18852574" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2024 03:12:56 -0700 X-CSE-ConnectionGUID: NvVrsfnTQOOCA8SlitGbUA== X-CSE-MsgGUID: lAbIT/5FSwS+rqoDjBoEFA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,179,1708416000"; d="scan'208";a="18856074" Received: from unknown (HELO mev-dev) ([10.237.112.144]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2024 03:12:53 -0700 Date: Thu, 4 Apr 2024 12:12:38 +0200 From: Michal Swiatkowski To: Arnd Bergmann Cc: Kees Cook , Yury Norov , Marcin Szycik , "intel-wired-lan@lists.osuosl.org" , linux-kernel@vger.kernel.org, Alexander Lobakin , Eric Dumazet , Netdev , Alexander Potapenko , Simon Horman , nex.sw.ncis.osdt.itp.upstreaming@intel.com, Jakub Kicinski , Paolo Abeni , "David S . Miller" Subject: Re: [Intel-wired-lan] [PATCH net-next v6 19/21] pfcp: always set pfcp metadata Message-ID: References: <20240327152358.2368467-1-aleksander.lobakin@intel.com> <20240327152358.2368467-20-aleksander.lobakin@intel.com> <701f8f93-f5fb-408b-822a-37a1d5c424ba@app.fastmail.com> <5afd6f21-4f0e-442f-a970-77195b355a0e@app.fastmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5afd6f21-4f0e-442f-a970-77195b355a0e@app.fastmail.com> On Thu, Apr 04, 2024 at 11:56:29AM +0200, Arnd Bergmann wrote: > On Thu, Apr 4, 2024, at 11:45, Michal Swiatkowski wrote: > > On Wed, Apr 03, 2024 at 10:59:36PM +0200, Arnd Bergmann wrote: > >> On Wed, Mar 27, 2024, at 16:23, Alexander Lobakin wrote: > >> > >> 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? > > > > I used ip_tunnel_info_opts_set() to set options_len and flags. > > You are right that it can and probably should be changed to: > > > > __set_bit(IP_TUNNEL_PFCP_OPT_BIT, tun_dst->u.tun_info.key.tun_flags); > > tun_dst->u.tun_info.options_len = sizeof(*md); > > > > instead of copying the buffer. Thanks for pointing it. > > > > Should I sent a fix to the net or patch to the maintainer? Sorry, don't > > know how this kind of situations are being solved. > > I tend to just send fixes when I run into build problems like this, > but since you already know what's going on, I think it's best if > you send the fix as well, citing the warning I mention in the commit > log, and explaining that the warning can be avoided by the simpler > code but is otherwise a false-positive. > Thanks, I will sent the fix ASAP. Michal > Arnd