tracing/uprobe: Fix to make trace_uprobe_filter alignment safe
Commit99c9a923e9
("tracing/uprobe: Fix double perf_event linking on multiprobe uprobe") moved trace_uprobe_filter on trace_probe_event. However, since it introduced a flexible data structure with char array and type casting, the alignment of trace_uprobe_filter can be broken. This changes the type of the array to trace_uprobe_filter data strucure to fix it. Link: http://lore.kernel.org/r/20200120124022.GA14897@hirez.programming.kicks-ass.net Link: http://lkml.kernel.org/r/157966340499.5107.10978352478952144902.stgit@devnote2 Fixes:99c9a923e9
("tracing/uprobe: Fix double perf_event linking on multiprobe uprobe") Suggested-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Este cometimento está contido em:

cometido por
Steven Rostedt (VMware)

ascendente
bf24daac8f
cometimento
b61387cb73
@@ -223,6 +223,12 @@ struct probe_arg {
|
||||
const struct fetch_type *type; /* Type of this argument */
|
||||
};
|
||||
|
||||
struct trace_uprobe_filter {
|
||||
rwlock_t rwlock;
|
||||
int nr_systemwide;
|
||||
struct list_head perf_events;
|
||||
};
|
||||
|
||||
/* Event call and class holder */
|
||||
struct trace_probe_event {
|
||||
unsigned int flags; /* For TP_FLAG_* */
|
||||
@@ -230,7 +236,7 @@ struct trace_probe_event {
|
||||
struct trace_event_call call;
|
||||
struct list_head files;
|
||||
struct list_head probes;
|
||||
char data[0];
|
||||
struct trace_uprobe_filter filter[0];
|
||||
};
|
||||
|
||||
struct trace_probe {
|
||||
@@ -323,7 +329,7 @@ static inline bool trace_probe_has_single_file(struct trace_probe *tp)
|
||||
}
|
||||
|
||||
int trace_probe_init(struct trace_probe *tp, const char *event,
|
||||
const char *group, size_t event_data_size);
|
||||
const char *group, bool alloc_filter);
|
||||
void trace_probe_cleanup(struct trace_probe *tp);
|
||||
int trace_probe_append(struct trace_probe *tp, struct trace_probe *to);
|
||||
void trace_probe_unlink(struct trace_probe *tp);
|
||||
|
Criar uma nova questão referindo esta
Bloquear um utilizador