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 branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
modules, tracing: Remove stale struct marker signature from module_layout()
tracing/workqueue: Use %pf in workqueue trace events
tracing: Fix a comment and a trivial format issue in tracepoint.h
tracing: Fix failure path in ftrace_regex_open()
tracing: Fix failure path in ftrace_graph_write()
tracing: Check the return value of trace_get_user()
tracing: Fix off-by-one in trace_get_user()

+20 -19
+1 -1
include/linux/tracepoint.h
··· 36 36 #ifndef DECLARE_TRACE 37 37 38 38 #define TP_PROTO(args...) args 39 - #define TP_ARGS(args...) args 39 + #define TP_ARGS(args...) args 40 40 41 41 #ifdef CONFIG_TRACEPOINTS 42 42
+2 -2
include/trace/events/workqueue.h
··· 26 26 __entry->func = work->func; 27 27 ), 28 28 29 - TP_printk("thread=%s:%d func=%pF", __entry->thread_comm, 29 + TP_printk("thread=%s:%d func=%pf", __entry->thread_comm, 30 30 __entry->thread_pid, __entry->func) 31 31 ); 32 32 ··· 48 48 __entry->func = work->func; 49 49 ), 50 50 51 - TP_printk("thread=%s:%d func=%pF", __entry->thread_comm, 51 + TP_printk("thread=%s:%d func=%pf", __entry->thread_comm, 52 52 __entry->thread_pid, __entry->func) 53 53 ); 54 54
-1
kernel/module.c
··· 3091 3091 struct modversion_info *ver, 3092 3092 struct kernel_param *kp, 3093 3093 struct kernel_symbol *ks, 3094 - struct marker *marker, 3095 3094 struct tracepoint *tp) 3096 3095 { 3097 3096 }
+13 -10
kernel/trace/ftrace.c
··· 1621 1621 if (!ret) { 1622 1622 struct seq_file *m = file->private_data; 1623 1623 m->private = iter; 1624 - } else 1624 + } else { 1625 + trace_parser_put(&iter->parser); 1625 1626 kfree(iter); 1627 + } 1626 1628 } else 1627 1629 file->private_data = iter; 1628 1630 mutex_unlock(&ftrace_regex_lock); ··· 2204 2202 struct trace_parser *parser; 2205 2203 ssize_t ret, read; 2206 2204 2207 - if (!cnt || cnt < 0) 2205 + if (!cnt) 2208 2206 return 0; 2209 2207 2210 2208 mutex_lock(&ftrace_regex_lock); ··· 2218 2216 parser = &iter->parser; 2219 2217 read = trace_get_user(parser, ubuf, cnt, ppos); 2220 2218 2221 - if (trace_parser_loaded(parser) && 2219 + if (read >= 0 && trace_parser_loaded(parser) && 2222 2220 !trace_parser_cont(parser)) { 2223 2221 ret = ftrace_process_regex(parser->buffer, 2224 2222 parser->idx, enable); ··· 2554 2552 size_t cnt, loff_t *ppos) 2555 2553 { 2556 2554 struct trace_parser parser; 2557 - size_t read = 0; 2558 - ssize_t ret; 2555 + ssize_t read, ret; 2559 2556 2560 2557 if (!cnt || cnt < 0) 2561 2558 return 0; ··· 2563 2562 2564 2563 if (ftrace_graph_count >= FTRACE_GRAPH_MAX_FUNCS) { 2565 2564 ret = -EBUSY; 2566 - goto out; 2565 + goto out_unlock; 2567 2566 } 2568 2567 2569 2568 if (trace_parser_get_init(&parser, FTRACE_BUFF_MAX)) { 2570 2569 ret = -ENOMEM; 2571 - goto out; 2570 + goto out_unlock; 2572 2571 } 2573 2572 2574 2573 read = trace_get_user(&parser, ubuf, cnt, ppos); 2575 2574 2576 - if (trace_parser_loaded((&parser))) { 2575 + if (read >= 0 && trace_parser_loaded((&parser))) { 2577 2576 parser.buffer[parser.idx] = 0; 2578 2577 2579 2578 /* we allow only one expression at a time */ 2580 2579 ret = ftrace_set_func(ftrace_graph_funcs, &ftrace_graph_count, 2581 2580 parser.buffer); 2582 2581 if (ret) 2583 - goto out; 2582 + goto out_free; 2584 2583 } 2585 2584 2586 2585 ret = read; 2587 - out: 2586 + 2587 + out_free: 2588 2588 trace_parser_put(&parser); 2589 + out_unlock: 2589 2590 mutex_unlock(&graph_lock); 2590 2591 2591 2592 return ret;
+1 -1
kernel/trace/trace.c
··· 415 415 416 416 /* read the non-space input */ 417 417 while (cnt && !isspace(ch)) { 418 - if (parser->idx < parser->size) 418 + if (parser->idx < parser->size - 1) 419 419 parser->buffer[parser->idx++] = ch; 420 420 else { 421 421 ret = -EINVAL;
+3 -4
kernel/trace/trace_events.c
··· 232 232 size_t cnt, loff_t *ppos) 233 233 { 234 234 struct trace_parser parser; 235 - size_t read = 0; 236 - ssize_t ret; 235 + ssize_t read, ret; 237 236 238 - if (!cnt || cnt < 0) 237 + if (!cnt) 239 238 return 0; 240 239 241 240 ret = tracing_update_buffers(); ··· 246 247 247 248 read = trace_get_user(&parser, ubuf, cnt, ppos); 248 249 249 - if (trace_parser_loaded((&parser))) { 250 + if (read >= 0 && trace_parser_loaded((&parser))) { 250 251 int set = 1; 251 252 252 253 if (*parser.buffer == '!')