lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Fri, 22 Feb 2013 09:05:50 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	Ohad Ben-Cohen <ohad@...ery.com>
Cc:	open list <linux-kernel@...r.kernel.org>,
	kernel-janitors@...r.kernel.org
Subject: [patch] remoteproc: off by one in rproc_virtio_new_vringh()

It should be >= ARRAY_SIZE() instead of > ARRAY_SIZE() because it
is an index.

Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>

diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/remoteproc_virtio.c
index dba33ff..b5e3af5 100644
--- a/drivers/remoteproc/remoteproc_virtio.c
+++ b/drivers/remoteproc/remoteproc_virtio.c
@@ -208,7 +208,7 @@ rproc_virtio_new_vringh(struct virtio_device *vdev, unsigned index,
 	struct vringh *vrh;
 	int err;
 
-	if (index > ARRAY_SIZE(rvdev->vring)) {
+	if (index >= ARRAY_SIZE(rvdev->vring)) {
 		dev_err(&rvdev->vdev.dev, "bad vring index: %d\n", index);
 		return NULL;
 	}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ