hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/include/linux/thread_info.h
....@@ -110,17 +110,7 @@
110110 #define test_thread_flag(flag) \
111111 test_ti_thread_flag(current_thread_info(), flag)
112112
113
-#ifdef CONFIG_PREEMPT_LAZY
114
-#define tif_need_resched() (test_thread_flag(TIF_NEED_RESCHED) || \
115
- test_thread_flag(TIF_NEED_RESCHED_LAZY))
116
-#define tif_need_resched_now() (test_thread_flag(TIF_NEED_RESCHED))
117
-#define tif_need_resched_lazy() test_thread_flag(TIF_NEED_RESCHED_LAZY))
118
-
119
-#else
120
-#define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED)
121
-#define tif_need_resched_now() test_thread_flag(TIF_NEED_RESCHED)
122
-#define tif_need_resched_lazy() 0
123
-#endif
113
+#define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED)
124114
125115 #ifndef CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES
126116 static inline int arch_within_stack_frames(const void * const stack,
....@@ -157,7 +147,7 @@
157147 WARN(1, "Buffer overflow detected (%d < %lu)!\n", size, count);
158148 }
159149
160
-static __always_inline bool
150
+static __always_inline __must_check bool
161151 check_copy_size(const void *addr, size_t bytes, bool is_source)
162152 {
163153 int sz = __compiletime_object_size(addr);
....@@ -170,6 +160,8 @@
170160 __bad_copy_to();
171161 return false;
172162 }
163
+ if (WARN_ON_ONCE(bytes > INT_MAX))
164
+ return false;
173165 check_object_size(addr, bytes, is_source);
174166 return true;
175167 }