summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAnurag Chouhan <achouhan@codeaurora.org>2018-09-19 13:15:13 +0530
committerAnurag Chouhan <achouhan@codeaurora.org>2018-09-20 11:58:08 +0530
commit708d96ef1bc028e36cb6cfc51dad1b1384629637 (patch)
treeff76e486086f6295286598e5c25e7a8af6858aca /include
parent727593cbf7ebb6782b2b3b45a951cc8ccc03a788 (diff)
wcnss: Fix buffer overflow in wcnss_prealloc_get
There is potential integer truncation in the wcnss_prealloc_get api. size_t is 8 byte on x64 platform and "unsigned int" is 4 byte. To avoid this integer truncation, pass size as size_t instead of unsigned int. CRs-Fixed: 2269610 Change-Id: I14b274dd7cad98b55fdce1aaa27783272231afde Signed-off-by: Anurag Chouhan <achouhan@codeaurora.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/wcnss_wlan.h2
-rw-r--r--include/net/cnss_prealloc.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/wcnss_wlan.h b/include/linux/wcnss_wlan.h
index 7389fff7da51..06c652cfb6af 100644
--- a/include/linux/wcnss_wlan.h
+++ b/include/linux/wcnss_wlan.h
@@ -119,7 +119,7 @@ int wcnss_get_wlan_mac_address(char mac_addr[WLAN_MAC_ADDR_SIZE]);
void wcnss_allow_suspend(void);
void wcnss_prevent_suspend(void);
int wcnss_hardware_type(void);
-void *wcnss_prealloc_get(unsigned int size);
+void *wcnss_prealloc_get(size_t size);
int wcnss_prealloc_put(void *ptr);
void wcnss_reset_fiq(bool clk_chk_en);
void wcnss_suspend_notify(void);
diff --git a/include/net/cnss_prealloc.h b/include/net/cnss_prealloc.h
index 734b4b69ecbb..39d080a8b184 100644
--- a/include/net/cnss_prealloc.h
+++ b/include/net/cnss_prealloc.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -15,7 +15,7 @@
#define WCNSS_PRE_ALLOC_GET_THRESHOLD (4*1024)
-extern void *wcnss_prealloc_get(unsigned int size);
+extern void *wcnss_prealloc_get(size_t size);
extern int wcnss_prealloc_put(void *ptr);
extern int wcnss_pre_alloc_reset(void);
void wcnss_prealloc_check_memory_leak(void);