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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 22 Apr 2014 18:02:39 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	hans.verkuil@...co.com, m.chehab@...sung.com,
	ext-eero.nurkkala@...ia.com, nils.faerber@...nelconcepts.de,
	joni.lapilainen@...il.com, freemangordon@....bg, sre@...g0.de,
	pali.rohar@...il.com, Greg KH <greg@...ah.com>, trivial@...nel.org,
	linux-media@...r.kernel.org
Cc:	kernel list <linux-kernel@...r.kernel.org>
Subject: [PATCH v3] [media] radio-bcm2048: fix wrong overflow check

From: Pali Rohár <pali.rohar@...il.com>

This patch fixes an off by one check in bcm2048_set_region().

Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
Signed-off-by: Pali Rohár <pali.rohar@...il.com>
Signed-off-by: Pavel Machek <pavel@....cz>
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
---
v2: Send it to the correct list.  Re-work the changelog.
v3: Correct subsystem prefix.

diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.c
index b2cd3a8..bbf236e 100644
--- a/drivers/staging/media/bcm2048/radio-bcm2048.c
+++ b/drivers/staging/media/bcm2048/radio-bcm2048.c
@@ -737,7 +737,7 @@ static int bcm2048_set_region(struct bcm2048_device *bdev, u8 region)
 	int err;
 	u32 new_frequency = 0;
 
-	if (region > ARRAY_SIZE(region_configs))
+	if (region >= ARRAY_SIZE(region_configs))
 		return -EINVAL;
 
 	mutex_lock(&bdev->mutex);

-- 

--
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