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:   Wed, 26 May 2021 10:23:39 -0700
From:   Tony Nguyen <anthony.l.nguyen@...el.com>
To:     davem@...emloft.net, kuba@...nel.org
Cc:     Jesse Brandeburg <jesse.brandeburg@...el.com>,
        netdev@...r.kernel.org, sassmann@...hat.com,
        anthony.l.nguyen@...el.com,
        Dvora Fuxbrumer <dvorax.fuxbrumer@...ux.intel.com>,
        Dave Switzer <david.switzer@...el.com>
Subject: [PATCH net-next 04/11] igb/igc: use strongly typed pointer

From: Jesse Brandeburg <jesse.brandeburg@...el.com>

The igb and igc driver both use a trick of creating a local type
pointer on the stack to ease dealing with a receive descriptor in
64 bit chunks for printing.  Sparse however was not taken into
account and receive descriptors are always in little endian
order, so just make the unions use __le64 instead of u64.

No functional change.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@...el.com>
Tested-by: Dvora Fuxbrumer <dvorax.fuxbrumer@...ux.intel.com>
Tested-by: Dave Switzer <david.switzer@...el.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@...el.com>
---
Warning Detail:
  CHECK   .../igb/igb_main.c
.../igb/igb_main.c:442:25: warning: cast to restricted __le64
.../igb/igb_main.c:442:25: warning: cast to restricted __le64
.../igb/igb_main.c:522:33: warning: cast to restricted __le64
.../igb/igb_main.c:522:33: warning: cast to restricted __le64
.../igb/igb_main.c:528:33: warning: cast to restricted __le64
.../igb/igb_main.c:528:33: warning: cast to restricted __le64
  CHECK   .../igc/igc_dump.c
.../igc/igc_dump.c:192:40: warning: cast to restricted __le64
.../igc/igc_dump.c:193:37: warning: cast to restricted __le64
.../igc/igc_dump.c:275:45: warning: cast to restricted __le64
.../igc/igc_dump.c:276:45: warning: cast to restricted __le64
.../igc/igc_dump.c:281:45: warning: cast to restricted __le64
.../igc/igc_dump.c:282:45: warning: cast to restricted __le64
---
 drivers/net/ethernet/intel/igb/igb_main.c | 2 +-
 drivers/net/ethernet/intel/igc/igc_dump.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 038a9fd1af44..cf91e3624a89 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -356,7 +356,7 @@ static void igb_dump(struct igb_adapter *adapter)
 	struct igb_reg_info *reginfo;
 	struct igb_ring *tx_ring;
 	union e1000_adv_tx_desc *tx_desc;
-	struct my_u0 { u64 a; u64 b; } *u0;
+	struct my_u0 { __le64 a; __le64 b; } *u0;
 	struct igb_ring *rx_ring;
 	union e1000_adv_rx_desc *rx_desc;
 	u32 staterr;
diff --git a/drivers/net/ethernet/intel/igc/igc_dump.c b/drivers/net/ethernet/intel/igc/igc_dump.c
index 495bed47ed0a..c09c95cc5f70 100644
--- a/drivers/net/ethernet/intel/igc/igc_dump.c
+++ b/drivers/net/ethernet/intel/igc/igc_dump.c
@@ -112,7 +112,7 @@ static void igc_regdump(struct igc_hw *hw, struct igc_reg_info *reginfo)
 void igc_rings_dump(struct igc_adapter *adapter)
 {
 	struct net_device *netdev = adapter->netdev;
-	struct my_u0 { u64 a; u64 b; } *u0;
+	struct my_u0 { __le64 a; __le64 b; } *u0;
 	union igc_adv_tx_desc *tx_desc;
 	union igc_adv_rx_desc *rx_desc;
 	struct igc_ring *tx_ring;
-- 
2.26.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ