History

Merge tag 'trace-v5.16-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull tracing fixes from Steven Rostedt: "Three tracing fixes: - Allow compares of strings when using signed and unsigned characters - Fix kmemleak false positive for histogram entries - Handle negative numbers for user defined kretprobe data sizes" * tag 'trace-v5.16-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: kprobes: Limit max data_size of the kretprobe instances tracing: Fix a kmemleak false positive in tracing_map tracing/histograms: String compares should not care about signed values

Linus Torvalds committed 4 years ago

Commit 2b2c0f22 parents df36588 6bbfa444 files · +9 −1Browse files

Unified · Split

4 files
  1. include/linux/kprobes.h +2 −0
  2. kernel/kprobes.c +3 −0
  3. kernel/trace/trace_events_hist.c +1 −1
  4. kernel/trace/tracing_map.c +3 −0
include/linux/kprobes.h+2−0
@@ -153,6 +153,8 @@ struct kretprobe { · 152 unmodified lines
153153 struct kretprobe_holder *rph;
154154 };
155155
156+#define KRETPROBE_MAX_DATA_SIZE 4096
157+
156158 struct kretprobe_instance {
157159 union {
158160 struct freelist_node freelist;
kernel/kprobes.c+3−0
@@ -2086,6 +2086,9 @@ int register_kretprobe(struct kretprobe *rp) · 2085 unmodified lines
20862086 }
20872087 }
20882088
2089+ if (rp->data_size > KRETPROBE_MAX_DATA_SIZE)
2090+ return -E2BIG;
2091+
20892092 rp->kp.pre_handler = pre_handler_kretprobe;
20902093 rp->kp.post_handler = NULL;
20912094
kernel/trace/trace_events_hist.c+1−1
@@ -3757,7 +3757,7 @@ static int check_synth_field(struct synth_event *event, · 3756 unmodified lines
37573757
37583758 if (strcmp(field->type, hist_field->type) != 0) {
37593759 if (field->size != hist_field->size ||
3760− field->is_signed != hist_field->is_signed)
3760+ (!field->is_string && field->is_signed != hist_field->is_signed))
37613761 return -EINVAL;
37623762 }
37633763
kernel/trace/tracing_map.c+3−0
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 #include <linux/jhash.h>
1616 #include <linux/slab.h>
1717 #include <linux/sort.h>
18+#include <linux/kmemleak.h>
1819
1920 #include "tracing_map.h"
2021 #include "trace.h"
@@ -307,6 +308,7 @@ static void tracing_map_array_free(struct tracing_map_array *a) · 286 unmodified lines
307308 for (i = 0; i < a->n_pages; i++) {
308309 if (!a->pages[i])
309310 break;
311+ kmemleak_free(a->pages[i]);
310312 free_page((unsigned long)a->pages[i]);
311313 }
312314
@@ -342,6 +344,7 @@ static struct tracing_map_array *tracing_map_array_alloc(unsigned int n_elts, · 29 unmodified lines
342344 a->pages[i] = (void *)get_zeroed_page(GFP_KERNEL);
343345 if (!a->pages[i])
344346 goto free;
347+ kmemleak_alloc(a->pages[i], PAGE_SIZE, 1, GFP_KERNEL);
345348 }
346349 out:
347350 return a;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t