hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/include/linux/thread_info.h
....@@ -157,7 +157,7 @@
157157 WARN(1, "Buffer overflow detected (%d < %lu)!\n", size, count);
158158 }
159159
160
-static __always_inline bool
160
+static __always_inline __must_check bool
161161 check_copy_size(const void *addr, size_t bytes, bool is_source)
162162 {
163163 int sz = __compiletime_object_size(addr);
....@@ -170,6 +170,8 @@
170170 __bad_copy_to();
171171 return false;
172172 }
173
+ if (WARN_ON_ONCE(bytes > INT_MAX))
174
+ return false;
173175 check_object_size(addr, bytes, is_source);
174176 return true;
175177 }