Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1369136yba; Tue, 2 Apr 2019 07:39:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwx2uOqMUmbSIzywJ4ZsWMrkzTWGjRnRKXnnbSWVdnQIwEG7qVFE5cdyDcCupXJQMBwMaNT X-Received: by 2002:a63:9a4a:: with SMTP id e10mr64828531pgo.366.1554215984117; Tue, 02 Apr 2019 07:39:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554215984; cv=none; d=google.com; s=arc-20160816; b=I0l1YJWnehwdQUHroZlJlze8EZVdTd2ej0exwkbEwgWEqxUwvKJdBTlMO/OoQ/e7Ge 437xhH1fZXGbcBhk9JnM6fpzW059KecGO7wJUdOi2M3iQT2klsN/nuoo/mevBOT/l92a dhXcj6xIDjOTulbhKCs5il9C/lbh5BXNRDvaLu+GfKSDNU7lKxBG2rMddN1d6xOnxXpC sOxkDODW/e6/sxkMIxDZuNfDCjCQ68mC6FPyeojSsW/myprkj5TufJbn0NY213QbysEw vMfYH/MZDk7Tj3TwBH2PmG6FcZnQdE2wER7CQk5F6mzmDS7WkTTQrBKbt7bxRBhkECKv mwHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=33p7ukxxnvUyz04cY22Upu9LWUSYinfnTnI3ZmNy4CE=; b=QJISfmR+Au0lBWEuuBAUWeYjM8haED7KQK+nzjMH91i/sVUEiz23n16pTuVnNksHea QZW8av9W3IAdubv0o+zoA3ZRuzSt75uuWs/yScTjpLmYSfKG5DyQFtAlwJDOBt7DZ2Wk 71VXWZl46nR2XNiOUZQ4oDbOb6yNWOf8jBDOyxQgp75S3weD7bPB1xifTKKJrOa6QDlh 6dDsjw71gwBHUeGPUh3J3/GhJAqU/D9J/4E69+b2jb01fwjJ8Nr54G6CQ4snhwtOXZ+J yMtlhnD2JG0CmNvVa6qI9MQglb1CRebm237p2IQ1zm0Yr4OixqDCgtpFJV/viCpf5tlL bLjw== ARC-Authentication-Results: i=1; mx.google.com; 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 w4si11339089pgr.253.2019.04.02.07.39.28; Tue, 02 Apr 2019 07:39:44 -0700 (PDT) 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; 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 S1731555AbfDBNkN (ORCPT + 99 others); Tue, 2 Apr 2019 09:40:13 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:42840 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731165AbfDBNkB (ORCPT ); Tue, 2 Apr 2019 09:40:01 -0400 Received: from [167.98.27.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hBJdv-0002nK-NZ; Tue, 02 Apr 2019 14:39:59 +0100 Received: from ben by deadeye with local (Exim 4.92) (envelope-from ) id 1hBJdu-0004sS-Lt; Tue, 02 Apr 2019 14:39:58 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, Denis Kirjanov , "Greg Kroah-Hartman" , "Dan Carpenter" , "Sudeep Holla" Date: Tue, 02 Apr 2019 14:38:27 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 25/99] misc: vexpress: Off by one in vexpress_syscfg_exec() In-Reply-To: X-SA-Exim-Connect-IP: 167.98.27.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.65-rc1 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 Signed-off-by: Ben Hutchings --- 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);