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-v5.3-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull tracing fixes from Steven Rostedt:
"Small fixes and minor cleanups for tracing:

- Make exported ftrace function not static

- Fix NULL pointer dereference in reading probes as they are created

- Fix NULL pointer dereference in k/uprobe clean up path

- Various documentation fixes"

* tag 'trace-v5.3-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
tracing: Correct kdoc formats
ftrace/x86: Remove mcount() declaration
tracing/probe: Fix null pointer dereference
tracing: Make exported ftrace_set_clr_event non-static
ftrace: Check for successful allocation of hash
ftrace: Check for empty hash and comment the race with registering probes
ftrace: Fix NULL pointer dereference in t_probe_next()

+35 -15
-1
arch/x86/include/asm/ftrace.h
··· 16 16 #define HAVE_FUNCTION_GRAPH_RET_ADDR_PTR 17 17 18 18 #ifndef __ASSEMBLY__ 19 - extern void mcount(void); 20 19 extern atomic_t modifying_ftrace_code; 21 20 extern void __fentry__(void); 22 21
+1
include/linux/trace_events.h
··· 548 548 549 549 #define is_signed_type(type) (((type)(-1)) < (type)1) 550 550 551 + int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set); 551 552 int trace_set_clr_event(const char *system, const char *event, int set); 552 553 553 554 /*
+17
kernel/trace/ftrace.c
··· 3095 3095 hnd = &iter->probe_entry->hlist; 3096 3096 3097 3097 hash = iter->probe->ops.func_hash->filter_hash; 3098 + 3099 + /* 3100 + * A probe being registered may temporarily have an empty hash 3101 + * and it's at the end of the func_probes list. 3102 + */ 3103 + if (!hash || hash == EMPTY_HASH) 3104 + return NULL; 3105 + 3098 3106 size = 1 << hash->size_bits; 3099 3107 3100 3108 retry: ··· 4328 4320 4329 4321 mutex_unlock(&ftrace_lock); 4330 4322 4323 + /* 4324 + * Note, there's a small window here that the func_hash->filter_hash 4325 + * may be NULL or empty. Need to be carefule when reading the loop. 4326 + */ 4331 4327 mutex_lock(&probe->ops.func_hash->regex_lock); 4332 4328 4333 4329 orig_hash = &probe->ops.func_hash->filter_hash; 4334 4330 old_hash = *orig_hash; 4335 4331 hash = alloc_and_copy_ftrace_hash(FTRACE_HASH_DEFAULT_BITS, old_hash); 4332 + 4333 + if (!hash) { 4334 + ret = -ENOMEM; 4335 + goto out; 4336 + } 4336 4337 4337 4338 ret = ftrace_match_records(hash, glob, strlen(glob)); 4338 4339
+14 -12
kernel/trace/trace.c
··· 1567 1567 1568 1568 /** 1569 1569 * update_max_tr_single - only copy one trace over, and reset the rest 1570 - * @tr - tracer 1571 - * @tsk - task with the latency 1572 - * @cpu - the cpu of the buffer to copy. 1570 + * @tr: tracer 1571 + * @tsk: task with the latency 1572 + * @cpu: the cpu of the buffer to copy. 1573 1573 * 1574 1574 * Flip the trace of a single CPU buffer between the @tr and the max_tr. 1575 1575 */ ··· 1767 1767 1768 1768 /** 1769 1769 * register_tracer - register a tracer with the ftrace system. 1770 - * @type - the plugin for the tracer 1770 + * @type: the plugin for the tracer 1771 1771 * 1772 1772 * Register a new plugin tracer. 1773 1773 */ ··· 2230 2230 /** 2231 2231 * tracing_record_taskinfo - record the task info of a task 2232 2232 * 2233 - * @task - task to record 2234 - * @flags - TRACE_RECORD_CMDLINE for recording comm 2235 - * - TRACE_RECORD_TGID for recording tgid 2233 + * @task: task to record 2234 + * @flags: TRACE_RECORD_CMDLINE for recording comm 2235 + * TRACE_RECORD_TGID for recording tgid 2236 2236 */ 2237 2237 void tracing_record_taskinfo(struct task_struct *task, int flags) 2238 2238 { ··· 2258 2258 /** 2259 2259 * tracing_record_taskinfo_sched_switch - record task info for sched_switch 2260 2260 * 2261 - * @prev - previous task during sched_switch 2262 - * @next - next task during sched_switch 2263 - * @flags - TRACE_RECORD_CMDLINE for recording comm 2264 - * TRACE_RECORD_TGID for recording tgid 2261 + * @prev: previous task during sched_switch 2262 + * @next: next task during sched_switch 2263 + * @flags: TRACE_RECORD_CMDLINE for recording comm 2264 + * TRACE_RECORD_TGID for recording tgid 2265 2265 */ 2266 2266 void tracing_record_taskinfo_sched_switch(struct task_struct *prev, 2267 2267 struct task_struct *next, int flags) ··· 3072 3072 3073 3073 /** 3074 3074 * trace_vbprintk - write binary msg to tracing buffer 3075 - * 3075 + * @ip: The address of the caller 3076 + * @fmt: The string format to write to the buffer 3077 + * @args: Arguments for @fmt 3076 3078 */ 3077 3079 int trace_vbprintk(unsigned long ip, const char *fmt, va_list args) 3078 3080 {
+1 -1
kernel/trace/trace_events.c
··· 787 787 return ret; 788 788 } 789 789 790 - static int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set) 790 + int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set) 791 791 { 792 792 char *event = NULL, *sub = NULL, *match; 793 793 int ret;
+2 -1
kernel/trace/trace_probe.c
··· 895 895 for (i = 0; i < tp->nr_args; i++) 896 896 traceprobe_free_probe_arg(&tp->args[i]); 897 897 898 - kfree(call->class->system); 898 + if (call->class) 899 + kfree(call->class->system); 899 900 kfree(call->name); 900 901 kfree(call->print_fmt); 901 902 }