hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/include/linux/thread_info.h
....@@ -110,7 +110,17 @@
110110 #define test_thread_flag(flag) \
111111 test_ti_thread_flag(current_thread_info(), flag)
112112
113
-#define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED)
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
114124
115125 #ifndef CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES
116126 static inline int arch_within_stack_frames(const void * const stack,
....@@ -147,7 +157,7 @@
147157 WARN(1, "Buffer overflow detected (%d < %lu)!\n", size, count);
148158 }
149159
150
-static __always_inline bool
160
+static __always_inline __must_check bool
151161 check_copy_size(const void *addr, size_t bytes, bool is_source)
152162 {
153163 int sz = __compiletime_object_size(addr);
....@@ -160,6 +170,8 @@
160170 __bad_copy_to();
161171 return false;
162172 }
173
+ if (WARN_ON_ONCE(bytes > INT_MAX))
174
+ return false;
163175 check_object_size(addr, bytes, is_source);
164176 return true;
165177 }