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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D048C433EF for ; Wed, 27 Oct 2021 07:41:57 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 66AB96109E for ; Wed, 27 Oct 2021 07:41:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 66AB96109E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 251E382C30; Wed, 27 Oct 2021 09:41:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="PuhG4SBV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E136D8331D; Wed, 27 Oct 2021 09:41:52 +0200 (CEST) Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (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 F1CB580F5F for ; Wed, 27 Oct 2021 09:41:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-wm1-x329.google.com with SMTP id 192so170242wme.3 for ; Wed, 27 Oct 2021 00:41:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=lEnBlczVBejXI8Eb7lORC2xpPaaScP5/lC7VGX2Stgo=; b=PuhG4SBVt8up5cvh4fPARiumWYElpFPWIXKCa12c4XJBDl9cqJWUKWy5OBa2+BzG9B G4p9l8dLUORjAG2yyEkc6mWbpG3R7LiVEDFVy19lmgJXJZDqqjrWB4mEEF9zbiqDbYty zDPjzCTrLP2dR14jkhejXSetKawGuJ+jf5cjDjZdcVakDFKKDdOoTJzr1A3WE1AstKAu yd2so70UgWXNIcSy9d4oELl3ZRHRrWGV6zXj1/e1lYzxkJ/gz/tRX5HWgOBvK5cGcyrZ 6rKxWnJOT+a+H94W3f4b0CQcJ/ebYgFQ2PV2BYJdXd0ciYIEu3QK4YnsWeQsG8muN+eT a8Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=lEnBlczVBejXI8Eb7lORC2xpPaaScP5/lC7VGX2Stgo=; b=EFZhFNc4KtspiEN1noQfmWlzRa0TV+BWXAZqsaz5sbxV1kWOHqzbFjrc0NOEBEMzsH stbkMfeAasrstn31Yjafhp3ZXNCmiQTXPLcFqe57N1Djv7b8dCHboJ962xcvKvh1jDvZ CJkqZ/q+A4nI0iri/w9MizV2/3Z2govoIZ35w4omi+WNR+8HIcoAZ9Bb9dxOhxx2G9Kn VGlm5oebp/Y467Sj69h6zD7SYqpn7yNiFMuayKVf7fUpxuFHo+2/ai015ldaBv6D74CX T/jGyuNaOsvteACMnO0IJxPkCZUNH05I1Td5wPcAor7RV2FDi0cslhE2mEVGKmTzz6no A64A== X-Gm-Message-State: AOAM5307lfToKtooom7UWCrqK6pmWDSuKiN1qvgmAVxSVDytbDGlEVgS nwgMh8+7AKULSBpszZYeoLIW6A== X-Google-Smtp-Source: ABdhPJye2RXHfns3GihpgH5gymLIAJYClclQhIKx+1+fI6IWiXuIPi6byDboFILKEWbkZagJs2+/XA== X-Received: by 2002:a05:600c:2145:: with SMTP id v5mr3904496wml.182.1635320509521; Wed, 27 Oct 2021 00:41:49 -0700 (PDT) Received: from apalos.home (ppp-94-66-220-13.home.otenet.gr. [94.66.220.13]) by smtp.gmail.com with ESMTPSA id r4sm11694030wrp.26.2021.10.27.00.41.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Oct 2021 00:41:49 -0700 (PDT) Date: Wed, 27 Oct 2021 10:41:46 +0300 From: Ilias Apalodimas To: Simon Glass Cc: U-Boot Mailing List , Michal Simek , Heinrich Schuchardt , Tom Rini , Daniel Schwierzeck , Steffen Jaeckel , Marek =?iso-8859-1?Q?Beh=FAn?= , Lukas Auer , Dennis Gilmore Subject: Re: [PATCH v2 07/41] mbr: Correct verification check Message-ID: References: <20211023232635.9195-1-sjg@chromium.org> <20211023232635.9195-6-sjg@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211023232635.9195-6-sjg@chromium.org> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean Hi Simon, On Sat, Oct 23, 2021 at 05:26:01PM -0600, Simon Glass wrote: > At present this command considers the partitions to be identical if the > start and size are smaller than expected. It should check that they are > the same. Fix this and tidy up the code style a little. > > Signed-off-by: Simon Glass > --- > > (no changes since v1) > > cmd/mbr.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/cmd/mbr.c b/cmd/mbr.c > index e7e22980969..c269833eb82 100644 > --- a/cmd/mbr.c > +++ b/cmd/mbr.c > @@ -244,12 +244,12 @@ static int do_verify_mbr(struct blk_desc *dev, const char *str) > for (i = 0; i < count; i++) { > struct disk_partition p; > > - if (part_get_info(dev, i+1, &p)) > + if (part_get_info(dev, i + 1, &p)) > goto fail; > > - if ((partitions[i].size && p.size < partitions[i].size) || > - (partitions[i].start && p.start < partitions[i].start) || > - (p.sys_ind != partitions[i].sys_ind)) > + if ((partitions[i].size && p.size != partitions[i].size) || > + (partitions[i].start && p.start != partitions[i].start) || > + p.sys_ind != partitions[i].sys_ind) > goto fail; > } > ret = 0; > -- > 2.33.0.1079.g6e70778dc9-goog > This seems irrelevant to the series and a general fix. Can you send it as such? Acked-by: Ilias Apalodimas