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

Merge tag 'objtool-urgent-2026-03-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull objtool fixes from Ingo Molnar:
"Fix three more livepatching related build environment bugs, and a
false positive warning with Clang jump tables"

* tag 'objtool-urgent-2026-03-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
objtool: Fix Clang jump table detection
livepatch/klp-build: Fix inconsistent kernel version
objtool/klp: fix mkstemp() failure with long paths
objtool/klp: fix data alignment in __clone_symbol()

+11 -29
+4 -5
scripts/livepatch/klp-build
··· 285 285 # application from appending it with '+' due to a dirty git working tree. 286 286 set_kernelversion() { 287 287 local file="$SRC/scripts/setlocalversion" 288 - local localversion 288 + local kernelrelease 289 289 290 290 stash_file "$file" 291 291 292 - localversion="$(cd "$SRC" && make --no-print-directory kernelversion)" 293 - localversion="$(cd "$SRC" && KERNELVERSION="$localversion" ./scripts/setlocalversion)" 294 - [[ -z "$localversion" ]] && die "setlocalversion failed" 292 + kernelrelease="$(cd "$SRC" && make syncconfig &>/dev/null && make -s kernelrelease)" 293 + [[ -z "$kernelrelease" ]] && die "failed to get kernel version" 295 294 296 - sed -i "2i echo $localversion; exit 0" scripts/setlocalversion 295 + sed -i "2i echo $kernelrelease; exit 0" scripts/setlocalversion 297 296 } 298 297 299 298 get_patch_files() {
+2 -3
tools/objtool/check.c
··· 2184 2184 last = insn; 2185 2185 2186 2186 /* 2187 - * Store back-pointers for unconditional forward jumps such 2187 + * Store back-pointers for forward jumps such 2188 2188 * that find_jump_table() can back-track using those and 2189 2189 * avoid some potentially confusing code. 2190 2190 */ 2191 - if (insn->type == INSN_JUMP_UNCONDITIONAL && insn->jump_dest && 2192 - insn->offset > last->offset && 2191 + if (insn->jump_dest && 2193 2192 insn->jump_dest->offset > insn->offset && 2194 2193 !insn->jump_dest->first_jump_src) { 2195 2194
+3 -20
tools/objtool/elf.c
··· 16 16 #include <string.h> 17 17 #include <unistd.h> 18 18 #include <errno.h> 19 - #include <libgen.h> 20 19 #include <ctype.h> 21 20 #include <linux/align.h> 22 21 #include <linux/kernel.h> ··· 1188 1189 struct elf *elf_create_file(GElf_Ehdr *ehdr, const char *name) 1189 1190 { 1190 1191 struct section *null, *symtab, *strtab, *shstrtab; 1191 - char *dir, *base, *tmp_name; 1192 + char *tmp_name; 1192 1193 struct symbol *sym; 1193 1194 struct elf *elf; 1194 1195 ··· 1202 1203 1203 1204 INIT_LIST_HEAD(&elf->sections); 1204 1205 1205 - dir = strdup(name); 1206 - if (!dir) { 1207 - ERROR_GLIBC("strdup"); 1208 - return NULL; 1209 - } 1210 - 1211 - dir = dirname(dir); 1212 - 1213 - base = strdup(name); 1214 - if (!base) { 1215 - ERROR_GLIBC("strdup"); 1216 - return NULL; 1217 - } 1218 - 1219 - base = basename(base); 1220 - 1221 - tmp_name = malloc(256); 1206 + tmp_name = malloc(strlen(name) + 8); 1222 1207 if (!tmp_name) { 1223 1208 ERROR_GLIBC("malloc"); 1224 1209 return NULL; 1225 1210 } 1226 1211 1227 - snprintf(tmp_name, 256, "%s/%s.XXXXXX", dir, base); 1212 + sprintf(tmp_name, "%s.XXXXXX", name); 1228 1213 1229 1214 elf->fd = mkstemp(tmp_name); 1230 1215 if (elf->fd == -1) {
+2 -1
tools/objtool/klp-diff.c
··· 14 14 #include <objtool/util.h> 15 15 #include <arch/special.h> 16 16 17 + #include <linux/align.h> 17 18 #include <linux/objtool_types.h> 18 19 #include <linux/livepatch_external.h> 19 20 #include <linux/stringify.h> ··· 561 560 } 562 561 563 562 if (!is_sec_sym(patched_sym)) 564 - offset = sec_size(out_sec); 563 + offset = ALIGN(sec_size(out_sec), out_sec->sh.sh_addralign); 565 564 566 565 if (patched_sym->len || is_sec_sym(patched_sym)) { 567 566 void *data = NULL;