Lorenzo Bianconi
0184ede0ec
wifi: mac8021: fix possible oob access in ieee80211_get_rate_duration
...
[ Upstream commit 3e8f7abcc3473bc9603323803aeaed4ffcc3a2ab ]
Fix possible out-of-bound access in ieee80211_get_rate_duration routine
as reported by the following UBSAN report:
UBSAN: array-index-out-of-bounds in net/mac80211/airtime.c:455:47
index 15 is out of range for type 'u16 [12]'
CPU: 2 PID: 217 Comm: kworker/u32:10 Not tainted 6.1.0-060100rc3-generic
Hardware name: Acer Aspire TC-281/Aspire TC-281, BIOS R01-A2 07/18/2017
Workqueue: mt76 mt76u_tx_status_data [mt76_usb]
Call Trace:
<TASK>
show_stack+0x4e/0x61
dump_stack_lvl+0x4a/0x6f
dump_stack+0x10/0x18
ubsan_epilogue+0x9/0x43
__ubsan_handle_out_of_bounds.cold+0x42/0x47
ieee80211_get_rate_duration.constprop.0+0x22f/0x2a0 [mac80211]
? ieee80211_tx_status_ext+0x32e/0x640 [mac80211]
ieee80211_calc_rx_airtime+0xda/0x120 [mac80211]
ieee80211_calc_tx_airtime+0xb4/0x100 [mac80211]
mt76x02_send_tx_status+0x266/0x480 [mt76x02_lib]
mt76x02_tx_status_data+0x52/0x80 [mt76x02_lib]
mt76u_tx_status_data+0x67/0xd0 [mt76_usb]
process_one_work+0x225/0x400
worker_thread+0x50/0x3e0
? process_one_work+0x400/0x400
kthread+0xe9/0x110
? kthread_complete_and_exit+0x20/0x20
ret_from_fork+0x22/0x30
Fixes: db3e1c40cf2f ("mac80211: Import airtime calculation code from mt76")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-08 11:23:56 +01:00
..
2021-04-10 13:36:08 +02:00
2020-02-24 10:36:03 +01:00
2021-04-10 13:36:08 +02:00
2021-12-22 09:30:54 +01:00
2022-03-19 13:44:44 +01:00
2022-12-08 11:23:56 +01:00
2022-10-26 13:25:19 +02:00
2022-06-09 10:21:22 +02:00
2020-02-24 10:35:57 +01:00
2020-02-24 10:35:57 +01:00
2020-07-31 09:24:24 +02:00
2020-03-29 21:25:29 -07:00
2021-02-07 15:37:15 +01:00
2021-02-10 09:29:16 +01:00
2021-12-22 09:30:50 +01:00
2020-05-31 11:27:03 +02:00
2020-07-31 09:24:23 +02:00
2022-09-08 11:11:40 +02:00
2022-10-17 17:26:07 +02:00
2021-09-18 13:40:28 +02:00
2021-02-17 11:02:25 +01:00
2021-06-03 09:00:29 +02:00
2021-06-03 09:00:29 +02:00
2022-12-02 17:39:57 +01:00
2020-10-08 10:40:57 +02:00
2021-03-04 11:37:32 +01:00
2022-12-02 17:39:57 +01:00
2020-09-28 14:36:53 +02:00
2021-10-06 15:55:52 +02:00
2020-08-27 14:12:15 +02:00
2020-05-31 11:26:39 +02:00
2022-10-17 17:26:07 +02:00
2020-09-28 13:18:53 +02:00
2021-02-10 09:29:16 +01:00
2020-04-24 11:30:13 +02:00
2019-10-11 10:31:45 +02:00
2019-10-11 10:31:45 +02:00
2020-05-26 20:17:35 -07:00
2019-10-11 10:31:45 +02:00
2020-11-12 11:25:09 +01:00
2020-11-12 11:24:43 +01:00
2022-10-15 07:55:56 +02:00
2020-10-08 10:40:57 +02:00
2022-10-17 17:26:07 +02:00
2021-02-13 13:55:04 +01:00
2022-09-08 11:11:40 +02:00
2021-12-22 09:30:50 +01:00
2020-11-12 11:23:58 +01:00
2020-07-31 09:24:23 +02:00
2020-01-15 09:52:12 +01:00
2020-09-18 12:16:16 +02:00
2021-10-06 15:55:51 +02:00
2022-10-17 17:26:07 +02:00
2020-12-30 11:53:50 +01:00
2020-02-07 12:40:34 +01:00
2020-02-07 12:40:34 +01:00
2022-07-21 21:20:00 +02:00
2021-10-06 15:55:48 +02:00