Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2499706pxu; Mon, 14 Dec 2020 04:37:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzgbe+iNzJeNlAeJHOdcvntmaloEeIQVbU/RLdHfyVrl3YtJu++ZVDESMj7+TQbouiDclO/ X-Received: by 2002:a17:906:fa12:: with SMTP id lo18mr22754553ejb.354.1607949421383; Mon, 14 Dec 2020 04:37:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607949421; cv=none; d=google.com; s=arc-20160816; b=iD7fFywMDGrVPWbHa8ltf9mYSGd8bBhXncNisrM7c4cF+ArUKvexIHg6HuC0QCYkfA AQ0vKTvLazr4O0rbrfkCy99ilyPoYqhXxFreCa0uLNqO1SRy3NePzq4/9WLawbSUrm/f WgNcE9DgmGYLSGgqACkO1b7QPL2SvvTKsOQERs08NZLroitqARdpAv9/sgOPQR0+L6YY KVKCFdU2JoQHKgCng6WHb2IUP8JmEpAV5HcLI0A+S3G/D1EeuRDTcRLSsoABk+S5XW+N mif3E19qzGGdjRqr4DQVyaS2CiPemSBlOiD8DDvWkFvRxXJ0hCu7/Pm2Mrpm1cHv6F9Y ctEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=Fa2uzBKynCYPDBA/hByieRMoMRB3C7YozsyGn6LPz+Q=; b=hUguZ3KozlzbaF3LMQFgVFqLnJot17QZOt+stGRYGcES9LU136g1iZWl8/hopyr+EW 6XW3E+K08lXGsYTUtOfSzdjykTA/SHC99MQO/J3p8uuZemuaq0/TCrRro6w2d5iJHgG4 5BnjtM7G+M1UN4vwCJnVeyL6jBksGfgYIqAn+TXE820iGS2lWycm9dlsOlcdullya3vF ai1SXBncDF32BPNcnAgZkyO8tI88+eY3zSyrZ2qe8jgAWfF7KdYx/ue+Zi9zjGNU2lrs M+6MNSgFZ9y8HrcS2UQPT3iKs6daVeO/9xCDk1GpbS24RouY9KHd/ObectfR1pmnsy60 0XpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Dvra/5D2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 88si9872528ede.335.2020.12.14.04.35.40; Mon, 14 Dec 2020 04:37:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Dvra/5D2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727338AbgLMFWS (ORCPT + 99 others); Sun, 13 Dec 2020 00:22:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:35840 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725287AbgLMFWQ (ORCPT ); Sun, 13 Dec 2020 00:22:16 -0500 Content-Type: text/plain; charset="utf-8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607836895; bh=cV44tKi6E31BnITtCOWLyHjjS9XLowKnbRhNJZXaJOw=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=Dvra/5D2RYTkXWfQDsSyjOxTYcgxltABeZJVULPDQo/+W23kQkutGuebyBF3k9wDa /UT3mbkXolf6NeCO/upjzstc/oITZaf1QnZTfZrm2zXKKxKO8bqZSUYeOtqQBMWWUN q2Mib44yzw0PjAN3kcOvX+LucaQ/QYAz6+UuBaOmoc52voH+h8+J/9cbtGUl3R1W6o bq0RZjFrT4eli8YQLmvegx+3KsxuMbIIfMFoF8yY57cbmkyHdauNV39vxGW1/uViay 3VWKWD2vr7nL43828x6xLgjAnHp89DR/3t3EPGR4JAqO+fjXbKfXb7cgLkR1wZw78w 7G8WYGUQ5Dl7w== MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20201210093201.2419737-1-geert+renesas@glider.be> References: <20201210093201.2419737-1-geert+renesas@glider.be> Subject: Re: [PATCH v11] ARM: uncompress: Validate start of physical memory against passed DTB From: Stephen Boyd Cc: Arnd Bergmann , Eric Miao , Uwe =?utf-8?q?Kleine-K=C3=B6nig?= , Lukasz Stelmach , Chris Brandt , linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven To: Ard Biesheuvel , Dmitry Osipenko , Geert Uytterhoeven , Linus Walleij , Marek Szyprowski , Nicolas Pitre , Russell King Date: Sat, 12 Dec 2020 21:21:34 -0800 Message-ID: <160783689435.1580929.1038454293190061446@swboyd.mtv.corp.google.com> User-Agent: alot/0.9.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Geert Uytterhoeven (2020-12-10 01:32:01) > diff --git a/arch/arm/boot/compressed/fdt_check_mem_start.c b/arch/arm/bo= ot/compressed/fdt_check_mem_start.c > new file mode 100644 > index 0000000000000000..e58c3a79c8a31ec4 > --- /dev/null > +++ b/arch/arm/boot/compressed/fdt_check_mem_start.c > @@ -0,0 +1,131 @@ [...] > + > +static uint64_t get_val(const fdt32_t *cells, uint32_t ncells) > +{ > + uint64_t r =3D 0; This assignment is unnecessary? > + > + r =3D fdt32_ld(cells); > + if (ncells > 1) > + r =3D (r << 32) | fdt32_ld(cells + 1); > + > + return r;