summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHouston Hoffman <hhoffman@codeaurora.org>2016-11-09 15:50:25 -0800
committerqcabuildsw <qcabuildsw@localhost>2016-11-10 20:07:29 -0800
commit02167774c8aa3f90ee5fcb924221921827d4a58a (patch)
treef33928016dfb8bd670c6df085a66a0f1c6a8bbae
parent3dea4f485f3b87f89118b33f1ca75762635789a7 (diff)
qcacld-3.0: Use static contexts when checking magic of stack memory
The kernel is unmapping the virtual address of memory allocated on the stack. To avoid kernel page fault when delayed handlers try to check the out of scope structures magic value for liveness, make the contexts static. A better solution is under development but will need more testing. Below hdd functions are taken care of: hdd_get_bpf_offload hdd_get_tsm_stats wlan_hdd_get_link_status wlan_hdd_get_rssi wlan_hdd_get_snr wlan_hdd_get_linkspeed_for_peermac wlan_hdd_get_class_astats wlan_hdd_get_temperature Change-Id: I9b6decba1087e2d30f1572cc9d020b2b0cb5cec4 CRs-Fixed: 1087903
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.c2
-rw-r--r--core/hdd/src/wlan_hdd_ioctl.c4
-rw-r--r--core/hdd/src/wlan_hdd_wext.c10
3 files changed, 8 insertions, 8 deletions
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index fb95d3be3e45..9c5d3bc2b7c3 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -6437,7 +6437,7 @@ nla_put_failure:
static int hdd_get_bpf_offload(hdd_context_t *hdd_ctx)
{
unsigned long rc;
- struct hdd_bpf_context *context;
+ static struct hdd_bpf_context *context;
QDF_STATUS status;
int ret;
diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c
index b12f4cba749c..683b17a8c5f3 100644
--- a/core/hdd/src/wlan_hdd_ioctl.c
+++ b/core/hdd/src/wlan_hdd_ioctl.c
@@ -198,7 +198,7 @@ QDF_STATUS hdd_get_tsm_stats(hdd_adapter_t *adapter,
QDF_STATUS hstatus;
QDF_STATUS vstatus = QDF_STATUS_SUCCESS;
unsigned long rc;
- struct statsContext context;
+ static struct statsContext context;
hdd_context_t *hdd_ctx = NULL;
if (NULL == adapter) {
@@ -2422,7 +2422,7 @@ static int wlan_hdd_get_link_status(hdd_adapter_t *adapter)
hdd_station_ctx_t *pHddStaCtx =
WLAN_HDD_GET_STATION_CTX_PTR(adapter);
- struct statsContext context;
+ static struct statsContext context;
QDF_STATUS hstatus;
unsigned long rc;
diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c
index ff756b89f10b..cffa762b6476 100644
--- a/core/hdd/src/wlan_hdd_wext.c
+++ b/core/hdd/src/wlan_hdd_wext.c
@@ -1222,7 +1222,7 @@ static void hdd_get_snr_cb(int8_t snr, uint32_t staId, void *pContext)
*/
QDF_STATUS wlan_hdd_get_rssi(hdd_adapter_t *pAdapter, int8_t *rssi_value)
{
- struct statsContext context;
+ static struct statsContext context;
hdd_context_t *pHddCtx;
hdd_station_ctx_t *pHddStaCtx;
QDF_STATUS hstatus;
@@ -1308,7 +1308,7 @@ QDF_STATUS wlan_hdd_get_rssi(hdd_adapter_t *pAdapter, int8_t *rssi_value)
*/
QDF_STATUS wlan_hdd_get_snr(hdd_adapter_t *pAdapter, int8_t *snr)
{
- struct statsContext context;
+ static struct statsContext context;
hdd_context_t *pHddCtx;
hdd_station_ctx_t *pHddStaCtx;
QDF_STATUS hstatus;
@@ -1455,7 +1455,7 @@ QDF_STATUS wlan_hdd_get_linkspeed_for_peermac(hdd_adapter_t *pAdapter,
struct qdf_mac_addr macAddress) {
QDF_STATUS status;
unsigned long rc;
- struct linkspeedContext context;
+ static struct linkspeedContext context;
tSirLinkSpeedInfo *linkspeed_req;
if (NULL == pAdapter) {
@@ -3649,7 +3649,7 @@ QDF_STATUS wlan_hdd_get_class_astats(hdd_adapter_t *pAdapter)
hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
QDF_STATUS hstatus;
unsigned long rc;
- struct statsContext context;
+ static struct statsContext context;
if (NULL == pAdapter) {
hdd_err("pAdapter is NULL");
@@ -5138,7 +5138,7 @@ static void hdd_get_temperature_cb(int temperature, void *pContext)
int wlan_hdd_get_temperature(hdd_adapter_t *pAdapter, int *temperature)
{
QDF_STATUS status;
- struct statsContext tempContext;
+ static struct statsContext tempContext;
unsigned long rc;
ENTER();