summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAditya Kodukula <quic_akodukul@quicinc.com>2021-06-14 14:29:50 +0530
committerPaul Chen <chenpaul@google.com>2021-07-02 03:58:03 +0000
commit5e1fc6aec3ed581cb7c76b9e46a7367dce0058ff (patch)
tree766da9c144a2307593680dcece278383de3aa2bd
parenta8bc2d6efc720f812baab5e03ce12f2170223a38 (diff)
downloadqcacld-5e1fc6aec3ed581cb7c76b9e46a7367dce0058ff.tar.gz
Currently driver does not subtract the already filled length from the max available length when it copies the number of radios to the llstats result buffer which may lead to buffer overflow. To address this issue subtract already filled length from the max available length when driver copies the number of radios. Change-Id: Ie3b93121df603bd65250f0b0a49bb049d353211d CRs-Fixed: 2969637 Bug: 189164671 Signed-off-by: Aditya Kodukula <quic_akodukul@quicinc.com>
-rw-r--r--core/hdd/src/wlan_hdd_debugfs_llstat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/hdd/src/wlan_hdd_debugfs_llstat.c b/core/hdd/src/wlan_hdd_debugfs_llstat.c
index eb2ebd62b7..5c6ff5af6b 100644
--- a/core/hdd/src/wlan_hdd_debugfs_llstat.c
+++ b/core/hdd/src/wlan_hdd_debugfs_llstat.c
@@ -236,8 +236,8 @@ void hdd_debugfs_process_radio_stats(struct hdd_adapter *adapter,
buffer = ll_stats.result;
buffer += ll_stats.len;
- len = scnprintf(buffer, DEBUGFS_LLSTATS_BUF_SIZE,
- "\n\n===LL_STATS_RADIO: number of radios: %u===",
+ len = scnprintf(buffer, DEBUGFS_LLSTATS_BUF_SIZE - ll_stats.len,
+ "\n\n===LL_STATS_RADIO: number of radios: %u===",
num_radio);
for (i = 0; i < num_radio; i++) {