Skip to content

Commit 8066178

Browse files
committed
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()
2 parents 7fdeb23 + fddca7d commit 8066178

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

arch/arm64/kernel/asm-offsets.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ int main(void)
213213
DEFINE(FGRET_REGS_X7, offsetof(struct fgraph_ret_regs, regs[7]));
214214
DEFINE(FGRET_REGS_FP, offsetof(struct fgraph_ret_regs, fp));
215215
DEFINE(FGRET_REGS_SIZE, sizeof(struct fgraph_ret_regs));
216+
#endif
216217
#ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
217218
DEFINE(FTRACE_OPS_DIRECT_CALL, offsetof(struct ftrace_ops, direct_call));
218-
#endif
219219
#endif
220220
return 0;
221221
}

kernel/trace/trace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8146,7 +8146,7 @@ static const struct file_operations tracing_err_log_fops = {
81468146
.open = tracing_err_log_open,
81478147
.write = tracing_err_log_write,
81488148
.read = seq_read,
8149-
.llseek = seq_lseek,
8149+
.llseek = tracing_lseek,
81508150
.release = tracing_err_log_release,
81518151
};
81528152

kernel/trace/trace_boot.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ trace_boot_set_instance_options(struct trace_array *tr, struct xbc_node *node)
3131

3232
/* Common ftrace options */
3333
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) {
3535
pr_err("String is too long: %s\n", p);
3636
continue;
3737
}
@@ -87,7 +87,7 @@ trace_boot_enable_events(struct trace_array *tr, struct xbc_node *node)
8787
const char *p;
8888

8989
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) {
9191
pr_err("String is too long: %s\n", p);
9292
continue;
9393
}
@@ -486,15 +486,15 @@ trace_boot_init_one_event(struct trace_array *tr, struct xbc_node *gnode,
486486

487487
p = xbc_node_find_value(enode, "filter", NULL);
488488
if (p && *p != '\0') {
489-
if (strscpy(buf, p, ARRAY_SIZE(buf)) == -E2BIG)
489+
if (strscpy(buf, p, ARRAY_SIZE(buf)) < 0)
490490
pr_err("filter string is too long: %s\n", p);
491491
else if (apply_event_filter(file, buf) < 0)
492492
pr_err("Failed to apply filter: %s\n", buf);
493493
}
494494

495495
if (IS_ENABLED(CONFIG_HIST_TRIGGERS)) {
496496
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)
498498
pr_err("action string is too long: %s\n", p);
499499
else if (trigger_process_regex(file, buf) < 0)
500500
pr_err("Failed to apply an action: %s\n", p);

0 commit comments

Comments
 (0)