Skip to content

staging: rtl8723bs: fix several memory-safety bugs

Yi Cong linux-staging linux-wireless lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 1 replyIn review
  2. v24 patches 2 repliesSuperseded
  3. v14 patches 2 repliesSuperseded

Changes in v3 from the cover letter

- Add tag "Assisted-by" for each patch.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4staging: rtl8723bs: free HalData with vfree, not kfreedrivers/staging/rtl8723bs/os_dep/sdio_intf.c+1 -10 replies
2/4staging: rtl8723bs: fix double free when register_netdev() failsdrivers/staging/rtl8723bs/os_dep/os_intfs.c+2 -120 replies
3/4staging: rtl8723bs: fix NULL deref in c2h_wk_callback() on alloc failuredrivers/staging/rtl8723bs/core/rtw_cmd.c+2 -10 replies
4/4staging: rtl8723bs: fix NULL deref on bcmc station lookup in defrag pathdrivers/staging/rtl8723bs/core/rtw_recv.c+4 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/4] staging: rtl8723bs: fix several memory-safety bugs

From: Yi Cong <[email protected]>

This small series fixes four memory-safety / resource-management bugs in the rtl8723bs SDIO staging driver.

v3:
- Add tag "Assisted-by" for each patch.

v2:
- Remove some redundant comments in patch 2 and patch 3.

v1:
- https://lore.kernel.org/all/[email protected]/

All four are tagged:

Fixes 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")

1/4 - kfree() used on a vzalloc() allocation (HalData) in the probe
error path.
2/4 - double free / UAF when register_netdev() fails: the error label
frees objects that the caller also frees.
3/4 - NULL deref in c2h_wk_callback() when the re-read allocation under
memory pressure fails.
4/4 - NULL deref on a bcmc station lookup in the 802.11 defrag path,
reachable from a fragment with an unknown transmitter address.

Yi Cong (4):
staging: rtl8723bs: free HalData with vfree, not kfree
staging: rtl8723bs: fix double free when register_netdev() fails
staging: rtl8723bs: fix NULL deref in c2h_wk_callback() on alloc
failure
staging: rtl8723bs: fix NULL deref on bcmc station lookup in defrag
path

 drivers/staging/rtl8723bs/core/rtw_cmd.c     |  3 ++-
 drivers/staging/rtl8723bs/core/rtw_recv.c    |  5 ++++-
 drivers/staging/rtl8723bs/os_dep/os_intfs.c  | 14 ++------------
 drivers/staging/rtl8723bs/os_dep/sdio_intf.c |  2 +-
 4 files changed, 9 insertions(+), 15 deletions(-)
Signature · 1 line
2.25.1