Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp715295imj; Wed, 13 Feb 2019 16:22:10 -0800 (PST) X-Google-Smtp-Source: AHgI3IYWP8VjNx5GANnnmp2PIqslr4krkNBz+ubZeQBdU2H+KBgtGu/nk1abLS3Fv4PHIBalNFnz X-Received: by 2002:a63:d30a:: with SMTP id b10mr884512pgg.279.1550103730565; Wed, 13 Feb 2019 16:22:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550103730; cv=none; d=google.com; s=arc-20160816; b=rvOxpk0hoPVh+lB/eTOuYC1zDNEY3dUhGb6LD1WQevheTJCga3WyFGBxKh3GwD6Uw0 7PtuXohIxSS4UGQyD1n534pfCo82buweYTO4H3vPOfjlGelx92eqeEl1heeywX95xGUp p4XLUq/cUD7qknXhegZ4kAnfkrftWKy1tolzmyBf++g1ShRiyOvN+CPoFZA2pvx+N8bz w6AMVARtKa51Y0uEU1HwCgLYvijxWWh7HxBXq8LIazZVuAIU46tTMtYxw9rsJEXURf44 dfCoC4QlBygnZ0kHUCBl72ui787o9txK35/ikhjm0yphssuTxRAKSobgKg6wK39ij4ua BtEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=O1OqGTSW7UQPs/lg8O1OOz7sBL/ECbrQZ7rQBNBEoc8=; b=nWkK0EMcdIpGEmwNPVAPqGGVRxScuSuXF9ofKFTe76Q6Q9HtP0jsxpTYmSVUML7c6j 3VcKjtJ4d94hTPo2On0elRNSXfiXm6a6sAu9a0SUhuO+SRqOdl9Q+2EvVhHtpSYl0Aye TgtWsMRdW0jVB8LD83ZbeOOQOcVx1hSNNsxD9iAtf/X1HpDYzFZhm+yQtg1SedGsbKwn OGRpfNkbxNHze/5wIe73VrE1JMsf+xrwsgeQ4HDcMoRsUcivbFgdigs5QCT7t45NKev0 kbGGnTbRpzzI8s+zzZnirKij6rcF3UGdh2MzoxEYRAKu53otHbe6mr5Idk6qKb2aEV7O mqoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="nob/FBB2"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g6si777175pgc.55.2019.02.13.16.21.54; Wed, 13 Feb 2019 16:22:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="nob/FBB2"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436517AbfBMSrR (ORCPT + 99 others); Wed, 13 Feb 2019 13:47:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:45796 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436495AbfBMSrP (ORCPT ); Wed, 13 Feb 2019 13:47:15 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4CA2C222D1; Wed, 13 Feb 2019 18:47:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550083634; bh=1v25Y9X85X7jAFHkNoKd8EHqUH3uTQh4cbFbrLJJCOk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nob/FBB2AU0LJo13vI9wwWYRgbR91mINSqtrIAiDs6FLS5tODP0LezhliFQ/2RO7B MfkfygV/D17dqih4cYnbNU7edhSUei8p9gNFcMghKKJCeWiPsYAAqrfrR3CgstzqP5 f9VJaWgUniLXyhr4LwrCoybE0aPYz6Bk8YgWikEo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Sudeep Holla Subject: [PATCH 4.20 13/50] misc: vexpress: Off by one in vexpress_syscfg_exec() Date: Wed, 13 Feb 2019 19:38:18 +0100 Message-Id: <20190213183656.884554372@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190213183655.747168774@linuxfoundation.org> References: <20190213183655.747168774@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dan Carpenter commit f8a70d8b889f180e6860cb1f85fed43d37844c5a upstream. The > comparison should be >= to prevent reading beyond the end of the func->template[] array. (The func->template array is allocated in vexpress_syscfg_regmap_init() and it has func->num_templates elements.) Fixes: 974cc7b93441 ("mfd: vexpress: Define the device as MFD cells") Signed-off-by: Dan Carpenter Acked-by: Sudeep Holla Signed-off-by: Greg Kroah-Hartman --- drivers/misc/vexpress-syscfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/misc/vexpress-syscfg.c +++ b/drivers/misc/vexpress-syscfg.c @@ -61,7 +61,7 @@ static int vexpress_syscfg_exec(struct v int tries; long timeout; - if (WARN_ON(index > func->num_templates)) + if (WARN_ON(index >= func->num_templates)) return -EINVAL; command = readl(syscfg->base + SYS_CFGCTRL);