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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 7 Feb 2013 15:32:07 +0800
From:	fangxiaozhi 00110321 <fangxiaozhi@...wei.com>
To:	<linux-usb@...r.kernel.org>
CC:	<linux-kernel@...r.kernel.org>, <zihan@...wei.com>,
	<Lin.Lei@...wei.com>, <greg@...ah.com>, <neil.yi@...wei.com>,
	<wangyuhua@...wei.com>, <huqiao36@...wei.com>, <balbi@...com>,
	<mdharm-usb@...-eyed-alien.net>, <sebastian@...akpoint.cc>
Subject: [PATCH 1/1]linux-usb: fix the idProduct value to be compatible
 with current CPU in initializers.c


From: fangxiaozhi <huananhu@...wei.com>

1. The idProduct is little endian, so make sure its value to be compatible with the current CPU. Make no break on big endian processors.

Signed-off-by: fangxiaozhi <huananhu@...wei.com>
--------------------------------------------------------------------
diff -uprN linux-3.8-rc6_orig/drivers/usb/storage/initializers.c linux-3.8-rc6/drivers/usb/storage/initializers.c
--- linux-3.8-rc6_orig/drivers/usb/storage/initializers.c	2013-02-06 14:48:51.564355283 +0800
+++ linux-3.8-rc6/drivers/usb/storage/initializers.c	2013-02-07 15:29:59.929482630 +0800
@@ -147,7 +147,7 @@ static int usb_stor_huawei_dongles_pid(s
 	int idProduct;
 
 	idesc = &us->pusb_intf->cur_altsetting->desc;
-	idProduct = us->pusb_dev->descriptor.idProduct;
+	idProduct = le16_to_cpu(us->pusb_dev->descriptor.idProduct);
 	/* The first port is CDROM,
 	 * means the dongle in the single port mode,
 	 * and a switch command is required to be sent. */
@@ -169,7 +169,7 @@ int usb_stor_huawei_init(struct us_data
 	int result = 0;
 
 	if (usb_stor_huawei_dongles_pid(us)) {
-		if (us->pusb_dev->descriptor.idProduct >= 0x1446)
+		if (le16_to_cpu(us->pusb_dev->descriptor.idProduct) >= 0x1446)
 			result = usb_stor_huawei_scsi_init(us);
 		else
 			result = usb_stor_huawei_feature_init(us);

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