Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1186455lqe; Mon, 8 Apr 2024 00:54:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVDkZfnnoLsuU8wkMxUA8xGNItKBgg8NZF+pgh4SAdqBYBlbqvLu6DeSg3tgi6B9WaE3H8HL/Unh0OlMvZED1LS0uIErzIZtZ7ytvhxIg== X-Google-Smtp-Source: AGHT+IHVe0U/H0mADQxnX2v+uvC97qOeEr2mGfAfgpim5m3vTGGZu9sSJlk0m4jwEZbFTh8SN1lC X-Received: by 2002:a05:6a21:670b:b0:1a7:6a90:8820 with SMTP id wh11-20020a056a21670b00b001a76a908820mr1635534pzb.4.1712562845851; Mon, 08 Apr 2024 00:54:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712562845; cv=pass; d=google.com; s=arc-20160816; b=F8/NENtS/bCY9o06IX958l5JD7D1QyQpG0+DZGPLZV236BXkRYSmEdQvKia8801Z2w RcGBTIiFsxwD0F4jUIW3NKoAxf4aRQDKLGS+6ivRIG1LIuXyfvGDGR+lm1YCjjdSWcG1 8ojz6ekCIjHyP/M0dnW0KkYAYBFEyGTA7+T28dZ2wCDxzS1zleL3gFb2M8IBtz/BjMzj 9gxErin0+ouJwEWakio4z04A3uMeq7YRNSJvatV1LA/adTrpU8T0dLcyTJ4TXi39enpn LEY9LNN/e/NoJla/EZ5Dpdf9HMxeKwDLdKD53iKrLvlO17+r5KtGUMOynI0aVg23i+kp LSQw== 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=lYa3AETRGu43DEiQhYxZTFZAvQ/cpPANqCuO4mDL3mg=; fh=yoxBEwt1QjRbXoGHso8FQLcy30e3xu/C0WryRuW+KXc=; b=FTdgEjRPtEjG1MYiSA4vbaoD7Qbs3nX9SXcRfIj2TTevKE+6DPAx07iSrNmM62av+g 1w2DBu6yiVYsYYBPDKbropUCedjz22Z1BwX0Qhh1L3Lmlc2urFagjPGe681wAqXtybJF BxpUIFvZ5j861yWPgQwYKAwHMb+IdjjtuJphHUd7dJucuQDXt8UBRxWazWwWSPOKQsJV NlFWQiBLwy9YBXEjzE4cVIf6sDPSPgwEKJ7q9s6r1cFlhmemmQJ6XyM4JPr0UUFa79v6 XPw/UhI6xi6SqIYmxWfPff66vsXIcVNYY/DWR6yn6BTs6B/QEcROa98msMWJDG2gMMjY DqJQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B5J8RCAs; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-134956-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134956-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d13-20020a170902c18d00b001e0c95a0d66si5734858pld.32.2024.04.08.00.54.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 00:54:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-134956-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B5J8RCAs; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-134956-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134956-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 89215283450 for ; Mon, 8 Apr 2024 07:54:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6A37F4D9E8; Mon, 8 Apr 2024 07:48:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="B5J8RCAs" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 871F15FB95; Mon, 8 Apr 2024 07:48:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712562512; cv=none; b=e3y3+mL4GtWTLUqtHEVQmfySzENNMmlfHQCqL/LrtGT5rRHnYoTu4i8dmylTQtrDLDl/5Z2NjEUwRixKAcP1NBQeqilSsG3mXW8b64ilZHrFQFBdoaY96UBtIWq4qVmUVc7cEhx47o3obIGNYerITeQwUqzZ7G19WC3kpQ8MVrg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712562512; c=relaxed/simple; bh=OyivqxCyCQHaU0TBvZu93VhrYPwd0djlXetBhWNnesg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pxs8y2cBebP20ZMzIVPeyFU7CeUGGQ4jvr4n/Yerc1EJZ7qYRzMRqKBGRsZljS/3U9eyB6vNzG/fztruHmpEdH8lE+f2T8e4lgVv+oV/tfwotwq1SyLmU5xhrgK7L/wjwXg9kjaT6W6f0RBjz+FOp32Eq/vZFClacVoBVXNSesA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=B5J8RCAs; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6E45C433C7; Mon, 8 Apr 2024 07:48:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712562512; bh=OyivqxCyCQHaU0TBvZu93VhrYPwd0djlXetBhWNnesg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=B5J8RCAsrKzRVEhhwi/e38juo3WpjVWQRnbyNanqNA6q/wEidu68HX91oGo+Wts8M HSrpru0oR2wUqZq9D+fZQi6I84bKIyh7Enb7oHQHXWYdlAcylmkepJI1OKJo2scDII 7o/efqaTf1SyH5XZWL20kh29NdFdsDcTljpDSZIjs8VlSnpwqV0ry3N+ce4m1fp9Z+ D16nABgcaVDmzyXmXuhbuU+bZkEPTrbPThBBk7MaMb6np+OubsWPXAMM62NcID6MPt l4KWRstfel4q0W2nWeYICj5y7GWvzx3pYRowW6oG+TQZXw78gnJX7UUAhBUghxvTSA sEBn334ShUFmg== Date: Mon, 8 Apr 2024 08:48:26 +0100 From: Simon Horman To: Alexander Lobakin Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Dan Carpenter , David Ahern , nex.sw.ncis.osdt.itp.upstreaming@intel.com, netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] ip_tunnel: harden copying IP tunnel params to userspace Message-ID: <20240408074826.GA26556@kernel.org> References: <20240404160302.3585661-1-aleksander.lobakin@intel.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: <20240404160302.3585661-1-aleksander.lobakin@intel.com> On Thu, Apr 04, 2024 at 06:03:02PM +0200, Alexander Lobakin wrote: > Structures which are about to be copied to userspace shouldn't have > uninitialized fields or paddings. > memset() the whole &ip_tunnel_parm in ip_tunnel_parm_to_user() before > filling it with the kernel data. The compilers will hopefully combine > writes to it. > > Fixes: 117aef12a7b1 ("ip_tunnel: use a separate struct to store tunnel params in the kernel") > Reported-by: Dan Carpenter > Closes: https://lore.kernel.org/netdev/5f63dd25-de94-4ca3-84e6-14095953db13@moroto.mountain > Signed-off-by: Alexander Lobakin Reviewed-by: Simon Horman