.. | .. |
---|
110 | 110 | #define test_thread_flag(flag) \ |
---|
111 | 111 | test_ti_thread_flag(current_thread_info(), flag) |
---|
112 | 112 | |
---|
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 |
---|
114 | 124 | |
---|
115 | 125 | #ifndef CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES |
---|
116 | 126 | static inline int arch_within_stack_frames(const void * const stack, |
---|
.. | .. |
---|
147 | 157 | WARN(1, "Buffer overflow detected (%d < %lu)!\n", size, count); |
---|
148 | 158 | } |
---|
149 | 159 | |
---|
150 | | -static __always_inline bool |
---|
| 160 | +static __always_inline __must_check bool |
---|
151 | 161 | check_copy_size(const void *addr, size_t bytes, bool is_source) |
---|
152 | 162 | { |
---|
153 | 163 | int sz = __compiletime_object_size(addr); |
---|
.. | .. |
---|
160 | 170 | __bad_copy_to(); |
---|
161 | 171 | return false; |
---|
162 | 172 | } |
---|
| 173 | + if (WARN_ON_ONCE(bytes > INT_MAX)) |
---|
| 174 | + return false; |
---|
163 | 175 | check_object_size(addr, bytes, is_source); |
---|
164 | 176 | return true; |
---|
165 | 177 | } |
---|