From patchwork Thu Sep 15 13:30:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 76303 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp2444702qgf; Thu, 15 Sep 2016 06:30:50 -0700 (PDT) X-Received: by 10.66.183.108 with SMTP id el12mr6632087pac.102.1473946250589; Thu, 15 Sep 2016 06:30:50 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id m66si476506pfa.259.2016.09.15.06.30.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Sep 2016 06:30:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E37521A1EFC; Thu, 15 Sep 2016 06:30:49 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-qt0-x22a.google.com (mail-qt0-x22a.google.com [IPv6:2607:f8b0:400d:c0d::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 49DE41A1EFB for ; Thu, 15 Sep 2016 06:30:49 -0700 (PDT) Received: by mail-qt0-x22a.google.com with SMTP id 93so24187455qtg.2 for ; Thu, 15 Sep 2016 06:30:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6BjzCc5+y4SVaQNOoEBGv1io4n6wYcsyq2k+chSVkmw=; b=JKm2VMsAXyXgK7YPEH9xcBtBsj3MghhV2uQaaZNSj0pt6vQRl/8gGrBRrzhmNLa2Je vwzueAnj+DUz5g1/rU3mCDgWz7yJhxo+6Lbm/F44gISfLImKLFRRleDx/M6vTdyKy5G2 XF62OQgVp9ikch8IfF82f8t/Dvyw7BwGj7ieo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6BjzCc5+y4SVaQNOoEBGv1io4n6wYcsyq2k+chSVkmw=; b=WdvPHP2yms9FDO0qUCF6eL70Y/ej8sJ/i16tVAHVhrcYXmUAtLoQJOMr9r/n/5OIde 5aMjt0kGX88KyHpUADQ45/lnQxhf27LVwSSdgr/14CbD78UkbYyo0/y33StW6p6DSjT4 Wjj4xlB6DSohhfOqourGYHftqAi3ZsoZDfvoF4uDJ1EHrYoA3M68dLtNKLJ1oNNk7rje Ski7gTwvxnN1KfCebgrMXusrPrb9ORgzrrvgfBeMUawvw3J8x0sra6MBtTEh+mCeR5i+ jI+Xm6yEg/AcZFp1C4q82k0Bv0Q5GPrPnurNtMtB1hatkPBIEwse2M8Po1CCNn4xGmPk aEcA== X-Gm-Message-State: AE9vXwNDv3Gq0xM+8Qc6ib5OHZh4gxj2E139G7cJYRzJOay6W1eBCe8Zj8YG7J7ccxp99vuu X-Received: by 10.28.134.8 with SMTP id i8mr2951126wmd.59.1473946248272; Thu, 15 Sep 2016 06:30:48 -0700 (PDT) Received: from localhost.localdomain ([160.168.239.246]) by smtp.gmail.com with ESMTPSA id r9sm3532696wjp.15.2016.09.15.06.30.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Sep 2016 06:30:47 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Thu, 15 Sep 2016 14:30:30 +0100 Message-Id: <1473946233-10547-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473946233-10547-1-git-send-email-ard.biesheuvel@linaro.org> References: <1473946233-10547-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 1/4] ArmVirtPkg/FdtClientDxe: fix check for size of "reg" properties X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Currently, the code in FdtClientDxe assumes #address-cells and of tuples, this means the size of the entire property should always be a multiple of 16 bytes (i.e, 4 * sizeof(UINT32), not 8. So fix this. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- ArmVirtPkg/FdtClientDxe/FdtClientDxe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Laszlo Ersek diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c index c336e2410033..2063a597323b 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c @@ -178,7 +178,7 @@ FindCompatibleNodeReg ( return Status; } - if ((*RegSize % 8) != 0) { + if ((*RegSize % 16) != 0) { DEBUG ((EFI_D_ERROR, "%a: '%a' compatible node has invalid 'reg' property (size == 0x%x)\n", __FUNCTION__, CompatibleString, *RegSize));