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, 25 Oct 2016 17:41:52 +0100
From:   Kieran Bingham <kieran@...uared.org.uk>
To:     Wolfram Sang <wsa@...-dreams.de>, Lee Jones <lee.jones@...aro.org>,
        Kieran Bingham <kieran@...uared.org.uk>
Cc:     linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org,
        Javier Martinez Canillas <javier@....samsung.com>,
        sameo@...ux.intel.com
Subject: [PATCHv6 08/11] i2c: match vendorless strings on the internal string length

If a user provides a shortened string to match a device to the sysfs i2c
interface it will match on the first string that contains that string
prefix.

for example:
  echo a 0x68 > /sys/bus/i2c/devices/i2c-2/new_device

will match as3711, as3722, and ak8975 incorrectly.

Signed-off-by: Kieran Bingham <kieran@...gham.xyz>
---
 drivers/i2c/i2c-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 01bce56f733a..50c9cfdb87b7 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1708,7 +1708,7 @@ i2c_of_match_device_strip_vendor(const struct of_device_id *matches,
 		else
 			name++;
 
-		if (!strncasecmp(client->name, name, strlen(client->name)))
+		if (!strncasecmp(client->name, name, strlen(name)))
 			return matches;
 	}
 
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ