summaryrefslogtreecommitdiff
path: root/qdf
diff options
context:
space:
mode:
authorDustin Brown <dustinb@codeaurora.org>2018-02-07 13:44:25 -0800
committersnandini <snandini@codeaurora.org>2018-02-12 11:22:41 -0800
commit2d237dde749495c0e80d8efdb90cb8ade23fdab8 (patch)
tree2278567dd85d08bdbe7a0e9dac910e46ec0e6b6f /qdf
parent0d6245c0ac89caa43749e45a35a6d8345f49b76e (diff)
downloadqca-wfi-host-cmn-2d237dde749495c0e80d8efdb90cb8ade23fdab8.tar.gz
qcacmn: Avoid stack trace when PANIC_ON_BUG is off
PANIC_ON_BUG controls whether QDF_BUG panics the system on a failed assertion. This config flag should be disabled for all end user production builds. However, when PANIC_ON_BUG is disabled, QDF_BUG will still print the call stack that resulted in the failed assertion. This call stack can leak sensitive kernel address information, and should not be printed for end user production builds. When PANIC_ON_BUG is disabled, avoid printing the current stack trace to dmesg. Change-Id: I8c83d3690c606f8ffa91cf931e45543ed6e6437a CRs-Fixed: 2186096
Diffstat (limited to 'qdf')
-rw-r--r--qdf/linux/src/i_qdf_trace.h23
1 files changed, 7 insertions, 16 deletions
diff --git a/qdf/linux/src/i_qdf_trace.h b/qdf/linux/src/i_qdf_trace.h
index d727d705b..aecc44b7d 100644
--- a/qdf/linux/src/i_qdf_trace.h
+++ b/qdf/linux/src/i_qdf_trace.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -117,29 +117,20 @@ static inline void qdf_trace_msg(QDF_MODULE_ID module, QDF_TRACE_LEVEL level,
#endif
#ifdef PANIC_ON_BUG
-
-#define QDF_BUG(_condition) \
- do { \
- if (!(_condition)) { \
- pr_err("QDF BUG in %s Line %d\n", \
- __func__, __LINE__); \
- BUG_ON(1); \
- } \
- } while (0)
-
+#define __qdf_do_bug() BUG_ON(1)
#else
+#define __qdf_do_bug()
+#endif
#define QDF_BUG(_condition) \
do { \
if (!(_condition)) { \
- pr_err("QDF BUG in %s Line %d\n", \
- __func__, __LINE__); \
- WARN_ON(1); \
+ pr_err("QDF BUG in %s Line %d: Failed assertion '" \
+ #_condition "'\n", __func__, __LINE__); \
+ __qdf_do_bug();\
} \
} while (0)
-#endif
-
#ifdef KSYM_SYMBOL_LEN
#define __QDF_SYMBOL_LEN KSYM_SYMBOL_LEN
#else