mirror of https://gitee.com/openkylin/linux.git
perf/urgent fixes:
- Fix memory corruption in the annotation routines because of zero length symbols (asm ones) (Ravi Bangoria) - Fix printing garbage as an error message when re-running the lexer events matcher (Jiri Olsa) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEELb9bqkb7Te0zijNb1lAW81NSqkAFAlnzhA0ACgkQ1lAW81NS qkBZgBAAjmYQr/TS/+sGhPOiUIw1YuXTwz1NFi1Xh/WKJ6081/3Da/yMTyfvO6pg AEfTkBoF7SJnMWa7WBJ/rB4/Q2eZUYa2nj4Rawek8j6y7BpbybTjETN2y6wjMNFL W+AoOe6UR/k9VO9YwC1aVeBsC/cyAQKf0zP7j73L4DndJ/HOjyx8LW5u1ZWq3cOV mzd0O7wTl5cs6zkLYhhf2/6eQJmdil7XZJXC+E8L+6v7tML+iLqz6dkmjY2HVgVe A9hCufe+PqB8S6fZN0SnoyIE1Xrlqof4ZgK+KoPsohUaPYEHt4xZlYMhgLU2/rAU YbFpMKO9TvSw23GzloYhdSjXJHDrZ+0zvaKLTLkLHN5rwbBosOMWR/NH7EivGZIa TRB9jD+yz+ziZkuEO+fE5I6j3ToxItkqBeov2cpsdvKUDo3mFKy6KJz6MD/4S9ND jTY8Ibk+MrOYEXglrF89tC5PYxHMEbLDkgTdvYUzvY6tDzfJG8xTn8bxwsjtXryK uOcM9OHHRM6R6ZT8dd6N+YU7waToStfaVliguQpsYFjb49bn1ILqjkrqBlyd7FyW Qe3YELpHjij0nPeum9dQzW2gDPMq2J6Zt0f3sNj1cz+k6eLAv+iypTmYKI6gLMrq bo2RkeBb2ZqfOs4aqqavsEIJrZG+a/n45aMTuNx7WwlWgyKfW+s= =XSDl -----END PGP SIGNATURE----- Merge tag 'perf-urgent-for-mingo-4.14-20171027' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent Pull perf/urgent fixes from Arnaldo Carvalho de Melo: - Fix memory corruption in the annotation routines because of zero length symbols (asm ones) (Ravi Bangoria) - Fix printing garbage as an error message when re-running the lexer events matcher (Jiri Olsa) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
commit
4139433c9a
|
@ -606,9 +606,19 @@ static struct arch *arch__find(const char *name)
|
||||||
int symbol__alloc_hist(struct symbol *sym)
|
int symbol__alloc_hist(struct symbol *sym)
|
||||||
{
|
{
|
||||||
struct annotation *notes = symbol__annotation(sym);
|
struct annotation *notes = symbol__annotation(sym);
|
||||||
const size_t size = symbol__size(sym);
|
size_t size = symbol__size(sym);
|
||||||
size_t sizeof_sym_hist;
|
size_t sizeof_sym_hist;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Add buffer of one element for zero length symbol.
|
||||||
|
* When sample is taken from first instruction of
|
||||||
|
* zero length symbol, perf still resolves it and
|
||||||
|
* shows symbol name in perf report and allows to
|
||||||
|
* annotate it.
|
||||||
|
*/
|
||||||
|
if (size == 0)
|
||||||
|
size = 1;
|
||||||
|
|
||||||
/* Check for overflow when calculating sizeof_sym_hist */
|
/* Check for overflow when calculating sizeof_sym_hist */
|
||||||
if (size > (SIZE_MAX - sizeof(struct sym_hist)) / sizeof(struct sym_hist_entry))
|
if (size > (SIZE_MAX - sizeof(struct sym_hist)) / sizeof(struct sym_hist_entry))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -154,6 +154,10 @@ do { \
|
||||||
yycolumn += yyleng; \
|
yycolumn += yyleng; \
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
|
#define USER_REJECT \
|
||||||
|
yycolumn -= yyleng; \
|
||||||
|
REJECT
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%x mem
|
%x mem
|
||||||
|
@ -335,8 +339,8 @@ r{num_raw_hex} { return raw(yyscanner); }
|
||||||
{num_hex} { return value(yyscanner, 16); }
|
{num_hex} { return value(yyscanner, 16); }
|
||||||
|
|
||||||
{modifier_event} { return str(yyscanner, PE_MODIFIER_EVENT); }
|
{modifier_event} { return str(yyscanner, PE_MODIFIER_EVENT); }
|
||||||
{bpf_object} { if (!isbpf(yyscanner)) REJECT; return str(yyscanner, PE_BPF_OBJECT); }
|
{bpf_object} { if (!isbpf(yyscanner)) USER_REJECT; return str(yyscanner, PE_BPF_OBJECT); }
|
||||||
{bpf_source} { if (!isbpf(yyscanner)) REJECT; return str(yyscanner, PE_BPF_SOURCE); }
|
{bpf_source} { if (!isbpf(yyscanner)) USER_REJECT; return str(yyscanner, PE_BPF_SOURCE); }
|
||||||
{name} { return pmu_str_check(yyscanner); }
|
{name} { return pmu_str_check(yyscanner); }
|
||||||
"/" { BEGIN(config); return '/'; }
|
"/" { BEGIN(config); return '/'; }
|
||||||
- { return '-'; }
|
- { return '-'; }
|
||||||
|
|
Loading…
Reference in New Issue