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

Pull tracing fix from Steven Rostedt:
"Fix the histogram logic from possibly crashing the kernel

Working on the histogram code, I found that if you dereference a char
pointer in a trace event that happens to point to user space, it can
crash the kernel, as it does no checks of that pointer. I have code
coming that will do this better, so just remove this ability to treat
character pointers in trace events as stings in the histogram"

* tag 'trace-v5.14-5' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
tracing: Do not reference char * as a string in histograms

+3 -3
+3 -3
kernel/trace/trace_events_hist.c
··· 1689 1689 if (WARN_ON_ONCE(!field)) 1690 1690 goto out; 1691 1691 1692 - if (is_string_field(field)) { 1692 + /* Pointers to strings are just pointers and dangerous to dereference */ 1693 + if (is_string_field(field) && 1694 + (field->filter_type != FILTER_PTR_STRING)) { 1693 1695 flags |= HIST_FIELD_FL_STRING; 1694 1696 1695 1697 hist_field->size = MAX_FILTER_STR_VAL; ··· 4497 4495 field = key_field->field; 4498 4496 if (field->filter_type == FILTER_DYN_STRING) 4499 4497 size = *(u32 *)(rec + field->offset) >> 16; 4500 - else if (field->filter_type == FILTER_PTR_STRING) 4501 - size = strlen(key); 4502 4498 else if (field->filter_type == FILTER_STATIC_STRING) 4503 4499 size = field->size; 4504 4500