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

Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull core fixes from Ingo Molnar:
"A handful of objtool updates, plus a documentation addition for
__ab_c_size()"

* 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
objtool: Fix whitelist documentation typo
objtool: Fix function fallthrough detection
objtool: Don't use ignore flag for fake jumps
overflow.h: Add comment documenting __ab_c_size()

+14 -7
+6 -2
include/linux/overflow.h
··· 284 284 return bytes; 285 285 } 286 286 287 - static inline __must_check size_t __ab_c_size(size_t n, size_t size, size_t c) 287 + /* 288 + * Compute a*b+c, returning SIZE_MAX on overflow. Internal helper for 289 + * struct_size() below. 290 + */ 291 + static inline __must_check size_t __ab_c_size(size_t a, size_t b, size_t c) 288 292 { 289 293 size_t bytes; 290 294 291 - if (check_mul_overflow(n, size, &bytes)) 295 + if (check_mul_overflow(a, b, &bytes)) 292 296 return SIZE_MAX; 293 297 if (check_add_overflow(bytes, c, &bytes)) 294 298 return SIZE_MAX;
+1 -1
tools/objtool/Documentation/stack-validation.txt
··· 306 306 307 307 - To skip validation of a file, add 308 308 309 - OBJECT_FILES_NON_STANDARD_filename.o := n 309 + OBJECT_FILES_NON_STANDARD_filename.o := y 310 310 311 311 to the Makefile. 312 312
+7 -4
tools/objtool/check.c
··· 28 28 #include <linux/hashtable.h> 29 29 #include <linux/kernel.h> 30 30 31 + #define FAKE_JUMP_OFFSET -1 32 + 31 33 struct alternative { 32 34 struct list_head list; 33 35 struct instruction *insn; ··· 570 568 insn->type != INSN_JUMP_UNCONDITIONAL) 571 569 continue; 572 570 573 - if (insn->ignore) 571 + if (insn->ignore || insn->offset == FAKE_JUMP_OFFSET) 574 572 continue; 575 573 576 574 rela = find_rela_by_dest_range(insn->sec, insn->offset, ··· 747 745 clear_insn_state(&fake_jump->state); 748 746 749 747 fake_jump->sec = special_alt->new_sec; 750 - fake_jump->offset = -1; 748 + fake_jump->offset = FAKE_JUMP_OFFSET; 751 749 fake_jump->type = INSN_JUMP_UNCONDITIONAL; 752 750 fake_jump->jump_dest = list_next_entry(last_orig_insn, list); 753 - fake_jump->ignore = true; 751 + fake_jump->func = orig_insn->func; 754 752 } 755 753 756 754 if (!special_alt->new_len) { ··· 1959 1957 return 1; 1960 1958 } 1961 1959 1962 - func = insn->func ? insn->func->pfunc : NULL; 1960 + if (insn->func) 1961 + func = insn->func->pfunc; 1963 1962 1964 1963 if (func && insn->ignore) { 1965 1964 WARN_FUNC("BUG: why am I validating an ignored function?",