Skip to content

Commit a4bdf43

Browse files
Weiguo Hurkhuangtao
authored andcommitted
net: wireless: rockchip_wlan: realtek wifi: avoid illegal argument when called by ioctl SIOCDEVPRIVATE
Illegal argument will cause following kernel panic. Call trace: PHY_SetRFReg_8723B rtw_hal_write_rfreg rtw_wx_write_rf _rtw_ioctl_wext_private rtw_ioctl dev_ifsioc dev_ioctl References: CNVD-C-2020-259508 Signed-off-by: Weiguo Hu <hwg@rock-chips.com> Change-Id: Ia493d8276c1dd414c184a9b3eddb5d252bd85b98
1 parent bef697e commit a4bdf43

8 files changed

Lines changed: 25 additions & 1 deletion

File tree

drivers/net/wireless/rockchip_wlan/rtl8188eu/hal/rtl8188e/rtl8188e_phycfg.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,9 @@ PHY_SetRFReg8188E(
704704
u32 Original_Value, BitShift;
705705
/* _irqL irqL; */
706706

707+
if (eRFPath >= MAX_RF_PATH)
708+
return;
709+
707710
#if (DISABLE_BB_RF == 1)
708711
return;
709712
#endif

drivers/net/wireless/rockchip_wlan/rtl8188fu/hal/rtl8188f/rtl8188f_phycfg.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,9 @@ PHY_SetRFReg_8188F(
433433
{
434434
u32 Original_Value, BitShift;
435435

436+
if (eRFPath >= MAX_RF_PATH)
437+
return;
438+
436439
#if (DISABLE_BB_RF == 1)
437440
return;
438441
#endif

drivers/net/wireless/rockchip_wlan/rtl8189es/hal/rtl8188e/rtl8188e_phycfg.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,9 @@ PHY_SetRFReg8188E(
718718
u32 Original_Value, BitShift;
719719
//_irqL irqL;
720720

721+
if (eRFPath >= MAX_RF_PATH)
722+
return;
723+
721724
#if (DISABLE_BB_RF == 1)
722725
return;
723726
#endif

drivers/net/wireless/rockchip_wlan/rtl8189fs/hal/rtl8188f/rtl8188f_phycfg.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,9 @@ PHY_SetRFReg_8188F(
371371
{
372372
u32 Original_Value, BitShift;
373373

374+
if (eRFPath >= MAX_RF_PATH)
375+
return;
376+
374377
#if (DISABLE_BB_RF == 1)
375378
return;
376379
#endif

drivers/net/wireless/rockchip_wlan/rtl8723bs/hal/rtl8723b/rtl8723b_phycfg.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,9 @@ PHY_SetRFReg_8723B(
427427
{
428428
u32 Original_Value, BitShift;
429429

430+
if (eRFPath >= MAX_RF_PATH)
431+
return;
432+
430433
#if (DISABLE_BB_RF == 1)
431434
return;
432435
#endif

drivers/net/wireless/rockchip_wlan/rtl8723bu/hal/rtl8723b/rtl8723b_phycfg.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,9 @@ PHY_SetRFReg_8723B(
439439
{
440440
u32 Original_Value, BitShift;
441441

442+
if (eRFPath >= MAX_RF_PATH)
443+
return;
444+
442445
#if (DISABLE_BB_RF == 1)
443446
return;
444447
#endif

drivers/net/wireless/rockchip_wlan/rtl8723cs/hal/rtl8703b/rtl8703b_phycfg.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,9 @@ PHY_SetRFReg_8703B(
432432
{
433433
u32 Original_Value, BitShift;
434434

435+
if (eRFPath >= MAX_RF_PATH)
436+
return;
437+
435438
#if (DISABLE_BB_RF == 1)
436439
return;
437440
#endif

drivers/net/wireless/rockchip_wlan/rtl8723ds/hal/rtl8723d/rtl8723d_phycfg.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,9 @@ PHY_SetRFReg_8723D(
372372
{
373373
u32 Original_Value, BitShift;
374374

375+
if (eRFPath >= MAX_RF_PATH)
376+
return;
377+
375378
#if (DISABLE_BB_RF == 1)
376379
return;
377380
#endif
@@ -1191,4 +1194,4 @@ PHY_SetSwChnlBWMode8723D(
11911194

11921195
/* RTW_INFO("<==%s()\n",__FUNCTION__); */
11931196
}
1194-
1197+

0 commit comments

Comments
 (0)