Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'kmalloc_obj-v7.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull kmalloc_obj fixes from Kees Cook:

- Fix pointer-to-array allocation types for ubd and kcsan

- Force size overflow helpers to __always_inline

- Bump __builtin_counted_by_ref to Clang 22.1 from 22.0 (Nathan Chancellor)

* tag 'kmalloc_obj-v7.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
kcsan: test: Adjust "expect" allocation type for kmalloc_obj
overflow: Make sure size helpers are always inlined
init/Kconfig: Adjust fixed clang version for __builtin_counted_by_ref
ubd: Use pointer-to-pointers for io_thread_req arrays

+11 -11
+5 -5
arch/um/drivers/ubd_kern.c
··· 69 69 }; 70 70 71 71 72 - static struct io_thread_req * (*irq_req_buffer)[]; 72 + static struct io_thread_req **irq_req_buffer; 73 73 static struct io_thread_req *irq_remainder; 74 74 static int irq_remainder_size; 75 75 76 - static struct io_thread_req * (*io_req_buffer)[]; 76 + static struct io_thread_req **io_req_buffer; 77 77 static struct io_thread_req *io_remainder; 78 78 static int io_remainder_size; 79 79 ··· 398 398 399 399 static int bulk_req_safe_read( 400 400 int fd, 401 - struct io_thread_req * (*request_buffer)[], 401 + struct io_thread_req **request_buffer, 402 402 struct io_thread_req **remainder, 403 403 int *remainder_size, 404 404 int max_recs ··· 465 465 &irq_remainder, &irq_remainder_size, 466 466 UBD_REQ_BUFFER_SIZE)) >= 0) { 467 467 for (i = 0; i < len / sizeof(struct io_thread_req *); i++) 468 - ubd_end_request((*irq_req_buffer)[i]); 468 + ubd_end_request(irq_req_buffer[i]); 469 469 } 470 470 471 471 if (len < 0 && len != -EAGAIN) ··· 1512 1512 } 1513 1513 1514 1514 for (count = 0; count < n/sizeof(struct io_thread_req *); count++) { 1515 - struct io_thread_req *req = (*io_req_buffer)[count]; 1515 + struct io_thread_req *req = io_req_buffer[count]; 1516 1516 int i; 1517 1517 1518 1518 io_count++;
+4 -4
include/linux/overflow.h
··· 42 42 * both the type-agnostic benefits of the macros while also being able to 43 43 * enforce that the return value is, in fact, checked. 44 44 */ 45 - static inline bool __must_check __must_check_overflow(bool overflow) 45 + static __always_inline bool __must_check __must_check_overflow(bool overflow) 46 46 { 47 47 return unlikely(overflow); 48 48 } ··· 327 327 * with any overflow causing the return value to be SIZE_MAX. The 328 328 * lvalue must be size_t to avoid implicit type conversion. 329 329 */ 330 - static inline size_t __must_check size_mul(size_t factor1, size_t factor2) 330 + static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2) 331 331 { 332 332 size_t bytes; 333 333 ··· 346 346 * with any overflow causing the return value to be SIZE_MAX. The 347 347 * lvalue must be size_t to avoid implicit type conversion. 348 348 */ 349 - static inline size_t __must_check size_add(size_t addend1, size_t addend2) 349 + static __always_inline size_t __must_check size_add(size_t addend1, size_t addend2) 350 350 { 351 351 size_t bytes; 352 352 ··· 367 367 * argument may be SIZE_MAX (or the result with be forced to SIZE_MAX). 368 368 * The lvalue must be size_t to avoid implicit type conversion. 369 369 */ 370 - static inline size_t __must_check size_sub(size_t minuend, size_t subtrahend) 370 + static __always_inline size_t __must_check size_sub(size_t minuend, size_t subtrahend) 371 371 { 372 372 size_t bytes; 373 373
+1 -1
init/Kconfig
··· 153 153 config CC_HAS_BROKEN_COUNTED_BY_REF 154 154 bool 155 155 # https://github.com/llvm/llvm-project/issues/182575 156 - default y if CC_IS_CLANG && CLANG_VERSION < 220000 156 + default y if CC_IS_CLANG && CLANG_VERSION < 220100 157 157 158 158 config CC_HAS_MULTIDIMENSIONAL_NONSTRING 159 159 def_bool $(success,echo 'char tag[][4] __attribute__((__nonstring__)) = { };' | $(CC) $(CLANG_FLAGS) -x c - -c -o /dev/null -Werror)
+1 -1
kernel/kcsan/kcsan_test.c
··· 168 168 if (!report_available()) 169 169 return false; 170 170 171 - expect = kmalloc_obj(observed.lines); 171 + expect = (typeof(expect))kmalloc_obj(observed.lines); 172 172 if (WARN_ON(!expect)) 173 173 return false; 174 174