hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/include/linux/thread_info.h
....@@ -147,7 +147,7 @@
147147 WARN(1, "Buffer overflow detected (%d < %lu)!\n", size, count);
148148 }
149149
150
-static __always_inline bool
150
+static __always_inline __must_check bool
151151 check_copy_size(const void *addr, size_t bytes, bool is_source)
152152 {
153153 int sz = __compiletime_object_size(addr);
....@@ -160,6 +160,8 @@
160160 __bad_copy_to();
161161 return false;
162162 }
163
+ if (WARN_ON_ONCE(bytes > INT_MAX))
164
+ return false;
163165 check_object_size(addr, bytes, is_source);
164166 return true;
165167 }