qcacmn: Fix bss peer use after free in stats

wlan_vdev_get_bsspeer() return bss peer without taking the ref count
of the peer and thus if peer is deleted after wlan_vdev_get_bsspeer()
returns a valid peer, the caller will have stale entry of the peer.
Stale entry of peer can lead to Assert.

Use wlan_objmgr_vdev_try_get_bsspeer API for stats to get the BSS
peer which increment the refcount if peer is valid. With this the
peer won't be deleted till the caller release the ref count of the
peer.

Change-Id: I3690f1309cbc7643ed55d8e903814b06f9d8755f
CRs-Fixed: 2454080
这个提交包含在:
sheenam monga
2019-05-20 16:31:44 +05:30
提交者 nshrivas
父节点 5b8283fe08
当前提交 d74e1fdc5f
修改 3 个文件,包含 10 行新增4 行删除

查看文件

@@ -1406,7 +1406,9 @@ static inline void wlan_vdev_set_bsspeer(struct wlan_objmgr_vdev *vdev,
* wlan_vdev_get_bsspeer() - get bss peer
* @vdev: VDEV object
*
* API to get the BSS peer of VDEV
* API to get the BSS peer of VDEV, wlan_objmgr_vdev_try_get_bsspeer API
* preferred to use outside obj manager to take and handle ref count of
* bss_peer with ref debug ID.
*
* Return:
* @peer: BSS peer pointer