Messages in this thread Patch in this message | | | From | Kees Cook <> | Subject | [PATCH v2 3/7] bug: Use WARN_ONCE() for CHECK_DATA_CORRUPTION() | Date | Tue, 4 Apr 2017 15:12:14 -0700 |
| |
Since users of CHECK_DATA_CORRUPTION() should be failing safe, the condition that triggers a WARN() may recur. This would mean a logging DoS of the system, so switch to WARN_ONCE() instead. (Those wanting per-instance notifications should already be building with CONFIG_BUG_ON_DATA_CORRUPTION so there is no change in that case.)
Signed-off-by: Kees Cook <keescook@chromium.org> --- include/linux/bug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/bug.h b/include/linux/bug.h index b6cfcb7f778f..c011438a7c6c 100644 --- a/include/linux/bug.h +++ b/include/linux/bug.h @@ -136,7 +136,7 @@ static inline __must_check bool check_data_corruption(bool v) { return v; } pr_err(fmt, ##__VA_ARGS__); \ BUG(); \ } else \ - WARN(1, fmt, ##__VA_ARGS__); \ + WARN_ONCE(1, fmt, ##__VA_ARGS__); \ } \ unlikely(corruption); \ })) -- 2.7.4
| |