From patchwork Wed Apr 20 07:39:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1619383 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=tpG/RRIP; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Kjsxk56Hsz9sFq for ; Wed, 20 Apr 2022 17:39:22 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5C3A780331; Wed, 20 Apr 2022 09:39:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.b="tpG/RRIP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AEE1583C1E; Wed, 20 Apr 2022 09:39:13 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) (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 6248E839B7 for ; Wed, 20 Apr 2022 09:39:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-ed1-x535.google.com with SMTP id g20so1147684edw.6 for ; Wed, 20 Apr 2022 00:39:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20210112.gappssmtp.com; s=20210112; h=sender:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=1niHk/pJrk3pZpwz0MtJuxYRtvYEklXVE8lvHCnhmI4=; b=tpG/RRIPLx2SLneKGQOttJSrEYjjsHKAcw2GG55LLccz/RpSf3d/tMfrYQXCNTxxHC 4GGUlKdrOibi/2P7vUJKmq/58Ek25uni9efnzCxl2/6PZ1z3MQKYl169rpqz5fxlnKGP /mEuiCX06lNyeCkswPOUBIoM/OCWlchGOcUb734+obWYSvpJNXn/1IPhzHjtI1/z/R3N 9jqBFDbplSNCPvVvE4QJssZQh/VHdODKCCRB6M46Fx2/eDOaKBiMq37tpcs4txJRWomS ydFDexoOtp4BXswV9AFza8L7+/zv7DSNpQqFYJvBxLxzQ43vCrbn5m7XQy26RlC03hTy cZqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version:content-transfer-encoding; bh=1niHk/pJrk3pZpwz0MtJuxYRtvYEklXVE8lvHCnhmI4=; b=C5fweJ51TvbdB4/AWRBjY1Y/CCttoM+9OLdRtnNHMMRKWDgZkGYzrzENRKPlKXyslc JRFxRNxDokt3RLQuCbQ09TxBOPZe4XjnToh6zxWWJT/BMmMZ5XUsuCqI+ya9vHriEZ5X 08TW1djZc7kkh6e0AaqCZZfc3s8/+1hdJCY8GNsa0XjBHo8CeO4BcKwx2YsQLPZRfNjG 2/6kmIOqpMn1fq2s4KLtpglgJN8/QUQM09K/DZv/5GOkPm4e83IkL8uF+D4Nuc+PVme3 +sPLlBF6FwrcXo7TR5T0Xqo+ASQQKQ0GTO5CNxt9zwd8lfB1tx6WhMhcwHJF7680aqZ+ Y3dg== X-Gm-Message-State: AOAM531RmRfAybQKfTYRsQ/PsztzqKMyZmoRnSdtE+TGqVpAzAu+yj88 5j42Fvao20DCFGWq+4u/z7lX+0tBfUbKgg== X-Google-Smtp-Source: ABdhPJxU6pYC0hk0GAJXs2aAn7XRpgFQKLhcvDFY8k4uL+oOB1uomsdkBlahZG2YjVbq6QFsPPl/9w== X-Received: by 2002:a05:6402:448a:b0:41d:793d:8252 with SMTP id er10-20020a056402448a00b0041d793d8252mr21309913edb.6.1650440349781; Wed, 20 Apr 2022 00:39:09 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6::648]) by smtp.gmail.com with ESMTPSA id fy29-20020a1709069f1d00b006e8d248fc2csm6252728ejc.108.2022.04.20.00.39.09 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Apr 2022 00:39:09 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Subject: [PATCH] soc: xilinx: zynqmp: fix out of bounds array access Date: Wed, 20 Apr 2022 09:39:04 +0200 Message-Id: <5f1409de285d7454af171a54e5f115da9d82c44e.1650440343.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 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.5 at phobos.denx.de X-Virus-Status: Clean The call to xilinx_pm_request requires an array of a larger size. Signed-off-by: Michal Simek --- The same change was done for versal by https://lore.kernel.org/r/20220416181530.2311155-1-jorge@foundries.io --- drivers/soc/soc_xilinx_zynqmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/soc_xilinx_zynqmp.c b/drivers/soc/soc_xilinx_zynqmp.c index 7d33ce2163d8..a71115b17ccd 100644 --- a/drivers/soc/soc_xilinx_zynqmp.c +++ b/drivers/soc/soc_xilinx_zynqmp.c @@ -49,7 +49,7 @@ static const struct soc_ops soc_xilinx_zynqmp_ops = { static int soc_xilinx_zynqmp_probe(struct udevice *dev) { struct soc_xilinx_zynqmp_priv *priv = dev_get_priv(dev); - u32 ret_payload[4]; + u32 ret_payload[PAYLOAD_ARG_CNT]; int ret; priv->family = zynqmp_family;