[PATCH] thread_info.h: include limits.h for INT_MAX
From: Randy Dunlap
Date: Thu May 13 2021 - 01:03:52 EST
Add header file <linux/limits.h> to make thread_info.h be
self-contained.
Fixes multiple occurrences of this error:
../include/linux/thread_info.h: In function ‘check_copy_size’:
../include/linux/thread_info.h:215:27: error: ‘INT_MAX’ undeclared (first use in this function)
if (WARN_ON_ONCE(bytes > INT_MAX))
^
Fixes: 6d13de1489b6 ("uaccess: disallow > INT_MAX copy sizes")
Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
Cc: Kees Cook <keescook@xxxxxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---
include/linux/thread_info.h | 1 +
1 file changed, 1 insertion(+)
--- mmotm-2021-0512-2146.orig/include/linux/thread_info.h
+++ mmotm-2021-0512-2146/include/linux/thread_info.h
@@ -10,6 +10,7 @@
#include <linux/types.h>
#include <linux/bug.h>
+#include <linux/limits.h>
#include <linux/restart_block.h>
#include <linux/errno.h>