Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b838810 authored by Lincoln Tran's avatar Lincoln Tran
Browse files

qcacld-3.0: Reject TDLS cmd if still in progress

Reject any incoming get_all_peers TDLS command if there are any
currently in progress.

The later commands will only be processed once the earlier commands
finish, since they are processed sequentially. However, once a
command finishes, the memory allocated for it from userspace is freed
up. Each command is passed the same address so the later commands will
end up writing to a freed address. To avoid this, reject incoming
requests if there are any still in progress.

Change-Id: I6970e3b73c6ce5afc921edaaf477825928800342
CRs-Fixed: 3150044
parent 19b1b43d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
@@ -734,6 +735,11 @@ int wlan_cfg80211_tdls_get_all_peers(struct wlan_objmgr_vdev *vdev,

	tdls_priv = osif_priv->osif_tdls;

	if (!completion_done(&tdls_priv->tdls_user_cmd_comp)) {
		osif_err("TDLS user cmd still in progress, reject this one");
		return -EBUSY;
	}

	wlan_cfg80211_update_tdls_peers_rssi(vdev);

	reinit_completion(&tdls_priv->tdls_user_cmd_comp);