From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 396CCC433FE for ; Mon, 28 Nov 2022 19:52:45 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8B367852ED; Mon, 28 Nov 2022 20:52:12 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="IK5saZZC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EBC9E852ED; Mon, 28 Nov 2022 20:52:10 +0100 (CET) Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 81807852E1 for ; Mon, 28 Nov 2022 20:52:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-ej1-x635.google.com with SMTP id vv4so28619731ejc.2 for ; Mon, 28 Nov 2022 11:52:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=fyK8K/SzoXydG/xfiaVGSbExI3bN37oA+FhAGzFWoY8=; b=IK5saZZCw3qIcqDigb3aUxUObNngWNxjTZ3YcC4Jslh3ARVKI17f4rm+GQ45Zn4YAs yoVJd4rkRjOATLFatlUpYFTxF+mg5BuO3F6EO+lZde8OIjXN/+4Dnu4LtZ1QhFuAVVZ+ 9onTG7g1GtQ+opixiNuWfB92FVhgOOsLCgNhs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=fyK8K/SzoXydG/xfiaVGSbExI3bN37oA+FhAGzFWoY8=; b=LRp1GZBRyAwpiE9nbtXIYhzOOXSlLvD2dsq8wcbRQHNEWyAD7ewqIpAJx0GEhMeQpY 0dRY68iCvgolFLVwZXdxMJFGb9I4nMoZOVwOeSPUg26g/HXtBSv0ZQ4/1CvLSx49pWz5 oIehMvBOhC0Sfp+gBjU7gUGdXFmWjZcnfMsqyS2epyRr0yC61+lxbTwhObCruQJCMwJg zPOJjZ9MgmhDv3uvjgfJg5oRs3E0Ge6ZASA+P4+lsqh+LtDEMFQywXDb4mmGuykJDVHJ 4JtVHopfB4m9lidrfNCwFvf7rQSQr7onq9oNiZMkm8iKN9wsW5hBv2EHAN+lgjcfvM62 fZMQ== X-Gm-Message-State: ANoB5pmzZQ6L9BIz6ozq2GDQXy2d2o7kVq4BuIwlVUkwfdSo+kxCJoL0 x5lEAecqeiPiJlE6+Ny+l0mScw== X-Google-Smtp-Source: AA0mqf7JcF+n/CiWW4Sf7W5xnpnpTXx/MK4V/KGfm3gPE1RSUZhWuTq+HR+ImtYqq9wcpNPiWG4aUQ== X-Received: by 2002:a17:907:cf84:b0:78d:4795:ff1f with SMTP id ux4-20020a170907cf8400b0078d4795ff1fmr46132086ejc.331.1669665127144; Mon, 28 Nov 2022 11:52:07 -0800 (PST) Received: from bill-the-cat (2603-6081-7b00-6400-69da-bdfc-6a2b-e036.res6.spectrum.com. [2603:6081:7b00:6400:69da:bdfc:6a2b:e036]) by smtp.gmail.com with ESMTPSA id mj22-20020a170906af9600b007ba705f8f90sm5309806ejb.79.2022.11.28.11.52.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 11:52:06 -0800 (PST) Date: Mon, 28 Nov 2022 14:52:03 -0500 From: Tom Rini To: Rasmus Villemoes Cc: u-boot@lists.denx.de, Fabio Estevam , Nicolas Bidron , Joe Hershberger , Ramon Fried Subject: Re: [PATCH 7/6] net: deal with fragment-overlapping-two-holes case Message-ID: <20221128195203.GI3787616@bill-the-cat> References: <20221014174342.3216982-1-rasmus.villemoes@prevas.dk> <20221017075251.3359940-1-rasmus.villemoes@prevas.dk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="gRZ38brEgCoUohoa" Content-Disposition: inline In-Reply-To: <20221017075251.3359940-1-rasmus.villemoes@prevas.dk> X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean --gRZ38brEgCoUohoa Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 17, 2022 at 09:52:51AM +0200, Rasmus Villemoes wrote: > With a suitable sequence of malicious packets, it's currently possible > to get a hole descriptor to contain arbitrary attacker-controlled > contents, and then with one more packet to use that as an arbitrary > write vector. >=20 > While one could possibly change the algorithm so we instead loop over > all holes, and in each hole puts as much of the current fragment as > belongs there (taking care to carefully update the hole list as > appropriate), it's not worth the complexity: In real, non-malicious > scenarios, one never gets overlapping fragments, and certainly not > fragments that would be supersets of one another. >=20 > So instead opt for this simple protection: Simply don't allow the > eventual memcpy() to write beyond the last_byte of the current hole. >=20 > Signed-off-by: Rasmus Villemoes Applied to u-boot/master, thanks! --=20 Tom --gRZ38brEgCoUohoa Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmOFEWMACgkQFHw5/5Y0 tywMGwv/bselZc9EDKra8ABqd0pDCNLqhDiX4Pezl7Zo7vbHdegMLB8BP+CqfTek sjz9iC7O4fn+mY+1C2bZ9lpyPJZ48sIc19vg/4dtOKTvLcZTNwLFYLxza3nQ/X4g skKrEBJ9Fxi1hpcflIZeHt9/duiudoq5nwtC9PZGtZWhS4FiejLblz1RZgn0qj+O VTUMHeCwm4ZCYxbtTqWn9Re0WqGzcilpSy3OS+mCsI7SIjgAFcRRwa7Q+7abBhB7 oI9DXme1WWYmv/0oOKfKpWTTZnzwY+LeBT/PIEBkp3Hz2RTeBotNj15RZcikn88q xmDn+cX6c0RGYPYm/2VXKEhgndKgsH2ekfWFvKQKMApcTK/rp8cNtrG00Sh5efVJ NsCKHa2Jof891DK6n2TFe1NCSDGmQ1BCQudrhMysdiSQ+0ESSLEMt6FCOO9HdnGJ zrjK1KgUrpHB+lo9EMhpiyaD79Yhvr7iAuPnCd+CGd2p4oibmMkwt1KibfleJ3Jk WX153evD =RFv0 -----END PGP SIGNATURE----- --gRZ38brEgCoUohoa--