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 'trace-v6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace

Pull tracing fixes from Steven Rostedt:

- Fix bad git merge of #endif in arm64 code

A merge of the arm64 tree caused #endif to go into the wrong place

- Fix crash on lseek of write access to tracefs/error_log

Opening error_log as write only, and then doing an lseek() causes a
kernel panic, because the lseek() handle expects a "seq_file" to
exist (which is not done on write only opens). Use tracing_lseek()
that tests for this instead of calling the default seq lseek handler.

- Check for negative instead of -E2BIG for error on strscpy() returns

Instead of testing for -E2BIG from strscpy(), to be more robust,
check for less than zero, which will make sure it catches any error
that strscpy() may someday return.

* tag 'trace-v6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
tracing/boot: Test strscpy() against less than zero for error
arm64: ftrace: fix build error with CONFIG_FUNCTION_GRAPH_TRACER=n
tracing: Fix null pointer dereference in tracing_err_log_open()

+6 -6
+1 -1
arch/arm64/kernel/asm-offsets.c
··· 213 213 DEFINE(FGRET_REGS_X7, offsetof(struct fgraph_ret_regs, regs[7])); 214 214 DEFINE(FGRET_REGS_FP, offsetof(struct fgraph_ret_regs, fp)); 215 215 DEFINE(FGRET_REGS_SIZE, sizeof(struct fgraph_ret_regs)); 216 + #endif 216 217 #ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS 217 218 DEFINE(FTRACE_OPS_DIRECT_CALL, offsetof(struct ftrace_ops, direct_call)); 218 - #endif 219 219 #endif 220 220 return 0; 221 221 }
+1 -1
kernel/trace/trace.c
··· 8146 8146 .open = tracing_err_log_open, 8147 8147 .write = tracing_err_log_write, 8148 8148 .read = seq_read, 8149 - .llseek = seq_lseek, 8149 + .llseek = tracing_lseek, 8150 8150 .release = tracing_err_log_release, 8151 8151 }; 8152 8152
+4 -4
kernel/trace/trace_boot.c
··· 31 31 32 32 /* Common ftrace options */ 33 33 xbc_node_for_each_array_value(node, "options", anode, p) { 34 - if (strscpy(buf, p, ARRAY_SIZE(buf)) == -E2BIG) { 34 + if (strscpy(buf, p, ARRAY_SIZE(buf)) < 0) { 35 35 pr_err("String is too long: %s\n", p); 36 36 continue; 37 37 } ··· 87 87 const char *p; 88 88 89 89 xbc_node_for_each_array_value(node, "events", anode, p) { 90 - if (strscpy(buf, p, ARRAY_SIZE(buf)) == -E2BIG) { 90 + if (strscpy(buf, p, ARRAY_SIZE(buf)) < 0) { 91 91 pr_err("String is too long: %s\n", p); 92 92 continue; 93 93 } ··· 486 486 487 487 p = xbc_node_find_value(enode, "filter", NULL); 488 488 if (p && *p != '\0') { 489 - if (strscpy(buf, p, ARRAY_SIZE(buf)) == -E2BIG) 489 + if (strscpy(buf, p, ARRAY_SIZE(buf)) < 0) 490 490 pr_err("filter string is too long: %s\n", p); 491 491 else if (apply_event_filter(file, buf) < 0) 492 492 pr_err("Failed to apply filter: %s\n", buf); ··· 494 494 495 495 if (IS_ENABLED(CONFIG_HIST_TRIGGERS)) { 496 496 xbc_node_for_each_array_value(enode, "actions", anode, p) { 497 - if (strscpy(buf, p, ARRAY_SIZE(buf)) == -E2BIG) 497 + if (strscpy(buf, p, ARRAY_SIZE(buf)) < 0) 498 498 pr_err("action string is too long: %s\n", p); 499 499 else if (trigger_process_regex(file, buf) < 0) 500 500 pr_err("Failed to apply an action: %s\n", p);