Search Linux Wireless

Re: PRO/Wireless 4965 Intel WPA2,3 SSID connection problem #1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 25, 2022 at 09:44:17PM +0200, Ioannis Barkas wrote:

Hi
> /build/linux-JDy9aa/linux-5.19.0/drivers/net/wireless/intel/iwlegacy/4965-rs.c:671:18
> [  700.609078] shift exponent -1 is negative
> [  700.609088] CPU: 5 PID: 0 Comm: swapper/5 Tainted: P           O
>   5.19.0-21-generic #21-Ubuntu
> [  700.609099] Hardware name: Gigabyte Technology Co., Ltd.
> GA-880GMA-USB3/GA-880GMA-USB3, BIOS F4e 05/24/2012
> [  700.609105] Call Trace:
> [  700.609111]  <IRQ>
> [  700.609120]  show_stack+0x4e/0x61
> [  700.609139]  dump_stack_lvl+0x4a/0x6d
> [  700.609153]  dump_stack+0x10/0x18
> [  700.609163]  ubsan_epilogue+0x9/0x43
> [  700.609174]  __ubsan_handle_shift_out_of_bounds.cold+0x61/0xef
> [  700.609189]  ? __smp_call_single_queue+0x61/0xa0
> [  700.609203]  il4965_rs_get_adjacent_rate.constprop.0.cold+0x17/0x9c [iwl4965]

Could you test if below patch make this UBSAN error gone and card is working properly ?

Regards
Stanislaw

diff --git a/drivers/net/wireless/intel/iwlegacy/4965-rs.c b/drivers/net/wireless/intel/iwlegacy/4965-rs.c
index 718efb1aa1b0..2baefb7c152c 100644
--- a/drivers/net/wireless/intel/iwlegacy/4965-rs.c
+++ b/drivers/net/wireless/intel/iwlegacy/4965-rs.c
@@ -667,7 +667,7 @@ il4965_rs_get_adjacent_rate(struct il_priv *il, u8 idx, u16 rate_mask,
 		u32 mask;
 
 		/* Find the previous rate that is in the rate mask */
-		i = idx - 1;
+		i = max_t(int, idx - 1, 0);
 		for (mask = (1 << i); i >= 0; i--, mask >>= 1) {
 			if (rate_mask & mask) {
 				low = i;



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux