diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-26 13:13:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-26 13:13:54 -0400 |
commit | 4187e7e9f1294afdcb3be5d00aa74412a1c2ded8 (patch) | |
tree | 1d4b3447cb2a7407d97e51ee5c48069d6b92c9e3 /kernel | |
parent | 5bb241b325d7d91bc4ec0b394f31dffb17fe7978 (diff) | |
parent | 115e8a288252ef748f34f8b7c1115c563d702eda (diff) |
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()
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/module.c | 1 | ||||
-rw-r--r-- | kernel/trace/ftrace.c | 23 | ||||
-rw-r--r-- | kernel/trace/trace.c | 2 | ||||
-rw-r--r-- | kernel/trace/trace_events.c | 7 |
4 files changed, 17 insertions, 16 deletions
diff --git a/kernel/module.c b/kernel/module.c index 5a29397ca4b6..fe748a86d452 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -3091,7 +3091,6 @@ void module_layout(struct module *mod, | |||
3091 | struct modversion_info *ver, | 3091 | struct modversion_info *ver, |
3092 | struct kernel_param *kp, | 3092 | struct kernel_param *kp, |
3093 | struct kernel_symbol *ks, | 3093 | struct kernel_symbol *ks, |
3094 | struct marker *marker, | ||
3095 | struct tracepoint *tp) | 3094 | struct tracepoint *tp) |
3096 | { | 3095 | { |
3097 | } | 3096 | } |
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index a142579765bf..46592feab5a6 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -1621,8 +1621,10 @@ ftrace_regex_open(struct inode *inode, struct file *file, int enable) | |||
1621 | if (!ret) { | 1621 | if (!ret) { |
1622 | struct seq_file *m = file->private_data; | 1622 | struct seq_file *m = file->private_data; |
1623 | m->private = iter; | 1623 | m->private = iter; |
1624 | } else | 1624 | } else { |
1625 | trace_parser_put(&iter->parser); | ||
1625 | kfree(iter); | 1626 | kfree(iter); |
1627 | } | ||
1626 | } else | 1628 | } else |
1627 | file->private_data = iter; | 1629 | file->private_data = iter; |
1628 | mutex_unlock(&ftrace_regex_lock); | 1630 | mutex_unlock(&ftrace_regex_lock); |
@@ -2202,7 +2204,7 @@ ftrace_regex_write(struct file *file, const char __user *ubuf, | |||
2202 | struct trace_parser *parser; | 2204 | struct trace_parser *parser; |
2203 | ssize_t ret, read; | 2205 | ssize_t ret, read; |
2204 | 2206 | ||
2205 | if (!cnt || cnt < 0) | 2207 | if (!cnt) |
2206 | return 0; | 2208 | return 0; |
2207 | 2209 | ||
2208 | mutex_lock(&ftrace_regex_lock); | 2210 | mutex_lock(&ftrace_regex_lock); |
@@ -2216,7 +2218,7 @@ ftrace_regex_write(struct file *file, const char __user *ubuf, | |||
2216 | parser = &iter->parser; | 2218 | parser = &iter->parser; |
2217 | read = trace_get_user(parser, ubuf, cnt, ppos); | 2219 | read = trace_get_user(parser, ubuf, cnt, ppos); |
2218 | 2220 | ||
2219 | if (trace_parser_loaded(parser) && | 2221 | if (read >= 0 && trace_parser_loaded(parser) && |
2220 | !trace_parser_cont(parser)) { | 2222 | !trace_parser_cont(parser)) { |
2221 | ret = ftrace_process_regex(parser->buffer, | 2223 | ret = ftrace_process_regex(parser->buffer, |
2222 | parser->idx, enable); | 2224 | parser->idx, enable); |
@@ -2552,8 +2554,7 @@ ftrace_graph_write(struct file *file, const char __user *ubuf, | |||
2552 | size_t cnt, loff_t *ppos) | 2554 | size_t cnt, loff_t *ppos) |
2553 | { | 2555 | { |
2554 | struct trace_parser parser; | 2556 | struct trace_parser parser; |
2555 | size_t read = 0; | 2557 | ssize_t read, ret; |
2556 | ssize_t ret; | ||
2557 | 2558 | ||
2558 | if (!cnt || cnt < 0) | 2559 | if (!cnt || cnt < 0) |
2559 | return 0; | 2560 | return 0; |
@@ -2562,29 +2563,31 @@ ftrace_graph_write(struct file *file, const char __user *ubuf, | |||
2562 | 2563 | ||
2563 | if (ftrace_graph_count >= FTRACE_GRAPH_MAX_FUNCS) { | 2564 | if (ftrace_graph_count >= FTRACE_GRAPH_MAX_FUNCS) { |
2564 | ret = -EBUSY; | 2565 | ret = -EBUSY; |
2565 | goto out; | 2566 | goto out_unlock; |
2566 | } | 2567 | } |
2567 | 2568 | ||
2568 | if (trace_parser_get_init(&parser, FTRACE_BUFF_MAX)) { | 2569 | if (trace_parser_get_init(&parser, FTRACE_BUFF_MAX)) { |
2569 | ret = -ENOMEM; | 2570 | ret = -ENOMEM; |
2570 | goto out; | 2571 | goto out_unlock; |
2571 | } | 2572 | } |
2572 | 2573 | ||
2573 | read = trace_get_user(&parser, ubuf, cnt, ppos); | 2574 | read = trace_get_user(&parser, ubuf, cnt, ppos); |
2574 | 2575 | ||
2575 | if (trace_parser_loaded((&parser))) { | 2576 | if (read >= 0 && trace_parser_loaded((&parser))) { |
2576 | parser.buffer[parser.idx] = 0; | 2577 | parser.buffer[parser.idx] = 0; |
2577 | 2578 | ||
2578 | /* we allow only one expression at a time */ | 2579 | /* we allow only one expression at a time */ |
2579 | ret = ftrace_set_func(ftrace_graph_funcs, &ftrace_graph_count, | 2580 | ret = ftrace_set_func(ftrace_graph_funcs, &ftrace_graph_count, |
2580 | parser.buffer); | 2581 | parser.buffer); |
2581 | if (ret) | 2582 | if (ret) |
2582 | goto out; | 2583 | goto out_free; |
2583 | } | 2584 | } |
2584 | 2585 | ||
2585 | ret = read; | 2586 | ret = read; |
2586 | out: | 2587 | |
2588 | out_free: | ||
2587 | trace_parser_put(&parser); | 2589 | trace_parser_put(&parser); |
2590 | out_unlock: | ||
2588 | mutex_unlock(&graph_lock); | 2591 | mutex_unlock(&graph_lock); |
2589 | 2592 | ||
2590 | return ret; | 2593 | return ret; |
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 411af37f4be4..45068269ebb1 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -415,7 +415,7 @@ int trace_get_user(struct trace_parser *parser, const char __user *ubuf, | |||
415 | 415 | ||
416 | /* read the non-space input */ | 416 | /* read the non-space input */ |
417 | while (cnt && !isspace(ch)) { | 417 | while (cnt && !isspace(ch)) { |
418 | if (parser->idx < parser->size) | 418 | if (parser->idx < parser->size - 1) |
419 | parser->buffer[parser->idx++] = ch; | 419 | parser->buffer[parser->idx++] = ch; |
420 | else { | 420 | else { |
421 | ret = -EINVAL; | 421 | ret = -EINVAL; |
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 6f03c8a1105e..d128f65778e6 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -232,10 +232,9 @@ ftrace_event_write(struct file *file, const char __user *ubuf, | |||
232 | size_t cnt, loff_t *ppos) | 232 | size_t cnt, loff_t *ppos) |
233 | { | 233 | { |
234 | struct trace_parser parser; | 234 | struct trace_parser parser; |
235 | size_t read = 0; | 235 | ssize_t read, ret; |
236 | ssize_t ret; | ||
237 | 236 | ||
238 | if (!cnt || cnt < 0) | 237 | if (!cnt) |
239 | return 0; | 238 | return 0; |
240 | 239 | ||
241 | ret = tracing_update_buffers(); | 240 | ret = tracing_update_buffers(); |
@@ -247,7 +246,7 @@ ftrace_event_write(struct file *file, const char __user *ubuf, | |||
247 | 246 | ||
248 | read = trace_get_user(&parser, ubuf, cnt, ppos); | 247 | read = trace_get_user(&parser, ubuf, cnt, ppos); |
249 | 248 | ||
250 | if (trace_parser_loaded((&parser))) { | 249 | if (read >= 0 && trace_parser_loaded((&parser))) { |
251 | int set = 1; | 250 | int set = 1; |
252 | 251 | ||
253 | if (*parser.buffer == '!') | 252 | if (*parser.buffer == '!') |