mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux
synced 2025-09-22 16:39:32 +10:00
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 -----BEGIN PGP SIGNATURE----- iIoEABYIADIWIQRRSw7ePDh/lE+zeZMp5XQQmuv6qgUCYagqyxQccm9zdGVkdEBn b29kbWlzLm9yZwAKCRAp5XQQmuv6qlCuAP45eI+DN2P+HxlnuWq7bLt/HYcOucit nALTZ4OIux8kqgEAss4wSTcUIefOQHi3PiMXgJmyXheTbeBUk/ecInDoZAQ= =P6C/ -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
2b2c0f24ba
@ -153,6 +153,8 @@ struct kretprobe {
|
|||||||
struct kretprobe_holder *rph;
|
struct kretprobe_holder *rph;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define KRETPROBE_MAX_DATA_SIZE 4096
|
||||||
|
|
||||||
struct kretprobe_instance {
|
struct kretprobe_instance {
|
||||||
union {
|
union {
|
||||||
struct freelist_node freelist;
|
struct freelist_node freelist;
|
||||||
|
@ -2086,6 +2086,9 @@ int register_kretprobe(struct kretprobe *rp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rp->data_size > KRETPROBE_MAX_DATA_SIZE)
|
||||||
|
return -E2BIG;
|
||||||
|
|
||||||
rp->kp.pre_handler = pre_handler_kretprobe;
|
rp->kp.pre_handler = pre_handler_kretprobe;
|
||||||
rp->kp.post_handler = NULL;
|
rp->kp.post_handler = NULL;
|
||||||
|
|
||||||
|
@ -3757,7 +3757,7 @@ static int check_synth_field(struct synth_event *event,
|
|||||||
|
|
||||||
if (strcmp(field->type, hist_field->type) != 0) {
|
if (strcmp(field->type, hist_field->type) != 0) {
|
||||||
if (field->size != hist_field->size ||
|
if (field->size != hist_field->size ||
|
||||||
field->is_signed != hist_field->is_signed)
|
(!field->is_string && field->is_signed != hist_field->is_signed))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#include <linux/jhash.h>
|
#include <linux/jhash.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/sort.h>
|
#include <linux/sort.h>
|
||||||
|
#include <linux/kmemleak.h>
|
||||||
|
|
||||||
#include "tracing_map.h"
|
#include "tracing_map.h"
|
||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
@ -307,6 +308,7 @@ static void tracing_map_array_free(struct tracing_map_array *a)
|
|||||||
for (i = 0; i < a->n_pages; i++) {
|
for (i = 0; i < a->n_pages; i++) {
|
||||||
if (!a->pages[i])
|
if (!a->pages[i])
|
||||||
break;
|
break;
|
||||||
|
kmemleak_free(a->pages[i]);
|
||||||
free_page((unsigned long)a->pages[i]);
|
free_page((unsigned long)a->pages[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -342,6 +344,7 @@ static struct tracing_map_array *tracing_map_array_alloc(unsigned int n_elts,
|
|||||||
a->pages[i] = (void *)get_zeroed_page(GFP_KERNEL);
|
a->pages[i] = (void *)get_zeroed_page(GFP_KERNEL);
|
||||||
if (!a->pages[i])
|
if (!a->pages[i])
|
||||||
goto free;
|
goto free;
|
||||||
|
kmemleak_alloc(a->pages[i], PAGE_SIZE, 1, GFP_KERNEL);
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
return a;
|
return a;
|
||||||
|
Loading…
Reference in New Issue
Block a user