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-next>] [day] [month] [year] [list]
Date: Tue, 22 Aug 2023 08:59:56 +0200
From: kornel.swierzy@...evity.com
To: davem@...emloft.net,
	edumazet@...gle.com,
	kuba@...nel.org,
	pabeni@...hat.com,
	netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Cc: Kornel Swierzy <kornel.swierzy@...evity.com>
Subject: [PATCH] Fix encoding of ethernet frame length for big endian platforms in QCA7000/7005 protocol header.

From: Kornel Swierzy <kornel.swierzy@...evity.com>

QCA7000 protocol requires that ethernet frame length is encoded
as u16 little endian value. Current implementation does not work
on big endian architectures.

Signed-off-by: Kornel Swierzy <kornel.swierzy@...evity.com>
---
 drivers/net/ethernet/qualcomm/qca_7k_common.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/qualcomm/qca_7k_common.c b/drivers/net/ethernet/qualcomm/qca_7k_common.c
index 6b511f05df61..7bb7ae85fcf7 100644
--- a/drivers/net/ethernet/qualcomm/qca_7k_common.c
+++ b/drivers/net/ethernet/qualcomm/qca_7k_common.c
@@ -30,19 +30,15 @@
 u16
 qcafrm_create_header(u8 *buf, u16 length)
 {
-	__le16 len;
-
 	if (!buf)
 		return 0;
 
-	len = cpu_to_le16(length);
-
 	buf[0] = 0xAA;
 	buf[1] = 0xAA;
 	buf[2] = 0xAA;
 	buf[3] = 0xAA;
-	buf[4] = len & 0xff;
-	buf[5] = (len >> 8) & 0xff;
+	buf[4] = length & 0xff;
+	buf[5] = (length >> 8) & 0xff;
 	buf[6] = 0;
 	buf[7] = 0;
 
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ