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] [day] [month] [year] [list]
Date:   Thu,  9 Mar 2017 21:15:19 +0100
From:   Adrien Descamps <adrien.descamps@...il.com>
To:     gregkh@...uxfoundation.org
Cc:     devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
        Adrien Descamps <adrien.descamps@...il.com>
Subject: [PATCH 2/2] Staging: wlan-ng: Fix endian error

sparse report fixed:
drivers/staging//wlan-ng//hfa384x_usb.c:3517:35: warning: restricted __be64 degrades to integer
drivers/staging//wlan-ng//hfa384x_usb.c:3517:33: warning: incorrect type in assignment (different base types)
drivers/staging//wlan-ng//hfa384x_usb.c:3517:33:    expected restricted __be64 [usertype] mactime
drivers/staging//wlan-ng//hfa384x_usb.c:3517:33:    got unsigned long long

Computation on the value should be done when in machine format, not in big endian format.

Signed-off-by: Adrien Descamps <adrien.descamps@...il.com>
---
Compile tested only
 drivers/staging/wlan-ng/hfa384x_usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
index 6484877..a812e55 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -3513,7 +3513,7 @@ static void hfa384x_int_rxmonitor(struct wlandevice *wlandev,
 
 		caphdr->version = htonl(P80211CAPTURE_VERSION);
 		caphdr->length = htonl(sizeof(struct p80211_caphdr));
-		caphdr->mactime = __cpu_to_be64(rxdesc->time) * 1000;
+		caphdr->mactime = __cpu_to_be64(rxdesc->time * 1000);
 		caphdr->hosttime = __cpu_to_be64(jiffies);
 		caphdr->phytype = htonl(4);	/* dss_dot11_b */
 		caphdr->channel = htonl(hw->sniff_channel);
-- 
2.1.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ