Commit fd1e716
committed
wifi: cfg80211: fix double free for link_sinfo in nl80211_station_dump()
JIRA: https://issues.redhat.com/browse/RHEL-114891
commit 9a44b5e
Author: Sarika Sharma <quic_sarishar@quicinc.com>
Date: Mon Jul 14 14:14:05 2025 +0530
wifi: cfg80211: fix double free for link_sinfo in nl80211_station_dump()
Currently, the link_sinfo structure is being freed twice in
nl80211_dump_station(), once after the send_station() call and again
in the error handling path. This results in a double free of both
link_sinfo and link_sinfo->pertid, which might lead to undefined
behavior or kernel crashes.
Hence, fix by ensuring cfg80211_sinfo_release_content() is only
invoked once during execution of nl80211_station_dump().
Fixes: 49e4722 ("wifi: cfg80211: allocate memory for link_station info structure")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/81f30515-a83d-4b05-a9d1-e349969df9e9@sabinyo.mountain/
Reported-by: syzbot+4ba6272678aa468132c8@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/68655325.a70a0220.5d25f.0316.GAE@google.com
Signed-off-by: Sarika Sharma <quic_sarishar@quicinc.com>
Link: https://patch.msgid.link/20250714084405.178066-1-quic_sarishar@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>1 parent 60adfec commit fd1e716
1 file changed
+9
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7456 | 7456 | | |
7457 | 7457 | | |
7458 | 7458 | | |
| 7459 | + | |
7459 | 7460 | | |
7460 | 7461 | | |
7461 | 7462 | | |
| |||
7484 | 7485 | | |
7485 | 7486 | | |
7486 | 7487 | | |
| 7488 | + | |
7487 | 7489 | | |
7488 | 7490 | | |
7489 | 7491 | | |
| |||
7496 | 7498 | | |
7497 | 7499 | | |
7498 | 7500 | | |
| 7501 | + | |
| 7502 | + | |
| 7503 | + | |
| 7504 | + | |
| 7505 | + | |
7499 | 7506 | | |
7500 | 7507 | | |
7501 | 7508 | | |
| |||
7510 | 7517 | | |
7511 | 7518 | | |
7512 | 7519 | | |
7513 | | - | |
| 7520 | + | |
| 7521 | + | |
7514 | 7522 | | |
7515 | 7523 | | |
7516 | 7524 | | |
| |||
0 commit comments