Skip to contentSkip to conversation

thread_info.h: include limits.h for INT_MAX

PATCH New Randy Dunlap 1 participant 1 message May 13, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thread_info.h: include limits.h for INT_MAX

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")
Cc Kees Cook <[email protected]>
Cc Andrew Morton <[email protected]>
---
 include/linux/thread_info.h |    1 +
 1 file changed, 1 insertion(+)
include/linux/thread_info.h +1 -0
@@ -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>