Re: [PATCH 1/2] tools lib symbol: Use strtoul instead of hex2u64 in kallsyms__parse
On Mon, Jan 29, 2018 at 9:18 AM, Jiri Olsawrote: > On Fri, Jan 26, 2018 at 07:27:06PM +0200, Andy Shevchenko wrote: >> On Fri, Jan 26, 2018 at 7:22 PM, Andy Shevchenko >> wrote: >> > https://patchwork.kernel.org/patch/4087681/ >> >> Even second attempt including recent ping left without consideration. >> >> http://lkml.iu.edu/hypermail/linux/kernel/1407.0/02791.html > > I see, sry we overlooked it.. could you please repost it? Done. -- With Best Regards, Andy Shevchenko
Re: [PATCH 1/2] tools lib symbol: Use strtoul instead of hex2u64 in kallsyms__parse
On Mon, Jan 29, 2018 at 9:18 AM, Jiri Olsa wrote: > On Fri, Jan 26, 2018 at 07:27:06PM +0200, Andy Shevchenko wrote: >> On Fri, Jan 26, 2018 at 7:22 PM, Andy Shevchenko >> wrote: >> > https://patchwork.kernel.org/patch/4087681/ >> >> Even second attempt including recent ping left without consideration. >> >> http://lkml.iu.edu/hypermail/linux/kernel/1407.0/02791.html > > I see, sry we overlooked it.. could you please repost it? Done. -- With Best Regards, Andy Shevchenko
Re: [PATCH 1/2] tools lib symbol: Use strtoul instead of hex2u64 in kallsyms__parse
On Fri, Jan 26, 2018 at 07:27:06PM +0200, Andy Shevchenko wrote: > On Fri, Jan 26, 2018 at 7:22 PM, Andy Shevchenko >wrote: > > On Fri, Jan 19, 2018 at 6:11 PM, Jiri Olsa wrote: > >> Current kallsyms__parse uses hex2u64, which gives > >> no indication of error. Using strtoul to checkup > >> on failed attempt to parse the number and stop the > >> rest of the kallsyms__parse processing early. > > > >> + start = strtoul(line, , 16); > >> + if (line == endptr) > >> + continue; > >> + > >> + len = endptr - line + 1; > >> > >> - len++; > >> if (len + 2 >= line_len) > >> continue; > > > > https://patchwork.kernel.org/patch/4087681/ > > Even second attempt including recent ping left without consideration. > > http://lkml.iu.edu/hypermail/linux/kernel/1407.0/02791.html I see, sry we overlooked it.. could you please repost it? thanks, jirka
Re: [PATCH 1/2] tools lib symbol: Use strtoul instead of hex2u64 in kallsyms__parse
On Fri, Jan 26, 2018 at 07:27:06PM +0200, Andy Shevchenko wrote: > On Fri, Jan 26, 2018 at 7:22 PM, Andy Shevchenko > wrote: > > On Fri, Jan 19, 2018 at 6:11 PM, Jiri Olsa wrote: > >> Current kallsyms__parse uses hex2u64, which gives > >> no indication of error. Using strtoul to checkup > >> on failed attempt to parse the number and stop the > >> rest of the kallsyms__parse processing early. > > > >> + start = strtoul(line, , 16); > >> + if (line == endptr) > >> + continue; > >> + > >> + len = endptr - line + 1; > >> > >> - len++; > >> if (len + 2 >= line_len) > >> continue; > > > > https://patchwork.kernel.org/patch/4087681/ > > Even second attempt including recent ping left without consideration. > > http://lkml.iu.edu/hypermail/linux/kernel/1407.0/02791.html I see, sry we overlooked it.. could you please repost it? thanks, jirka
Re: [PATCH 1/2] tools lib symbol: Use strtoul instead of hex2u64 in kallsyms__parse
On Fri, Jan 26, 2018 at 7:22 PM, Andy Shevchenkowrote: > On Fri, Jan 19, 2018 at 6:11 PM, Jiri Olsa wrote: >> Current kallsyms__parse uses hex2u64, which gives >> no indication of error. Using strtoul to checkup >> on failed attempt to parse the number and stop the >> rest of the kallsyms__parse processing early. > >> + start = strtoul(line, , 16); >> + if (line == endptr) >> + continue; >> + >> + len = endptr - line + 1; >> >> - len++; >> if (len + 2 >= line_len) >> continue; > > https://patchwork.kernel.org/patch/4087681/ Even second attempt including recent ping left without consideration. http://lkml.iu.edu/hypermail/linux/kernel/1407.0/02791.html -- With Best Regards, Andy Shevchenko
Re: [PATCH 1/2] tools lib symbol: Use strtoul instead of hex2u64 in kallsyms__parse
On Fri, Jan 26, 2018 at 7:22 PM, Andy Shevchenko wrote: > On Fri, Jan 19, 2018 at 6:11 PM, Jiri Olsa wrote: >> Current kallsyms__parse uses hex2u64, which gives >> no indication of error. Using strtoul to checkup >> on failed attempt to parse the number and stop the >> rest of the kallsyms__parse processing early. > >> + start = strtoul(line, , 16); >> + if (line == endptr) >> + continue; >> + >> + len = endptr - line + 1; >> >> - len++; >> if (len + 2 >= line_len) >> continue; > > https://patchwork.kernel.org/patch/4087681/ Even second attempt including recent ping left without consideration. http://lkml.iu.edu/hypermail/linux/kernel/1407.0/02791.html -- With Best Regards, Andy Shevchenko
Re: [PATCH 1/2] tools lib symbol: Use strtoul instead of hex2u64 in kallsyms__parse
On Fri, Jan 19, 2018 at 6:11 PM, Jiri Olsawrote: > Current kallsyms__parse uses hex2u64, which gives > no indication of error. Using strtoul to checkup > on failed attempt to parse the number and stop the > rest of the kallsyms__parse processing early. > + start = strtoul(line, , 16); > + if (line == endptr) > + continue; > + > + len = endptr - line + 1; > > - len++; > if (len + 2 >= line_len) > continue; https://patchwork.kernel.org/patch/4087681/ -- With Best Regards, Andy Shevchenko
Re: [PATCH 1/2] tools lib symbol: Use strtoul instead of hex2u64 in kallsyms__parse
On Fri, Jan 19, 2018 at 6:11 PM, Jiri Olsa wrote: > Current kallsyms__parse uses hex2u64, which gives > no indication of error. Using strtoul to checkup > on failed attempt to parse the number and stop the > rest of the kallsyms__parse processing early. > + start = strtoul(line, , 16); > + if (line == endptr) > + continue; > + > + len = endptr - line + 1; > > - len++; > if (len + 2 >= line_len) > continue; https://patchwork.kernel.org/patch/4087681/ -- With Best Regards, Andy Shevchenko
Re: [PATCH 1/2] tools lib symbol: Use strtoul instead of hex2u64 in kallsyms__parse
On Fri, Jan 19, 2018 at 05:11:02PM +0100, Jiri Olsa wrote: > Current kallsyms__parse uses hex2u64, which gives > no indication of error. Using strtoul to checkup > on failed attempt to parse the number and stop the > rest of the kallsyms__parse processing early. > > Link: http://lkml.kernel.org/n/tip-djqwni3p6lgctf6o7xhhw...@git.kernel.org > Signed-off-by: Jiri OlsaAcked-by: Namhyung Kim Thanks, Namhyung > --- > tools/lib/symbol/kallsyms.c | 8 ++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/tools/lib/symbol/kallsyms.c b/tools/lib/symbol/kallsyms.c > index 914cb8e3d40b..dd5bb1dfd2b6 100644 > --- a/tools/lib/symbol/kallsyms.c > +++ b/tools/lib/symbol/kallsyms.c > @@ -29,6 +29,7 @@ int kallsyms__parse(const char *filename, void *arg, > int line_len, len; > char symbol_type; > char *symbol_name; > + char *endptr; > > line_len = getline(, , file); > if (line_len < 0 || !line) > @@ -36,9 +37,12 @@ int kallsyms__parse(const char *filename, void *arg, > > line[--line_len] = '\0'; /* \n */ > > - len = hex2u64(line, ); > + start = strtoul(line, , 16); > + if (line == endptr) > + continue; > + > + len = endptr - line + 1; > > - len++; > if (len + 2 >= line_len) > continue; > > -- > 2.13.6 >
Re: [PATCH 1/2] tools lib symbol: Use strtoul instead of hex2u64 in kallsyms__parse
On Fri, Jan 19, 2018 at 05:11:02PM +0100, Jiri Olsa wrote: > Current kallsyms__parse uses hex2u64, which gives > no indication of error. Using strtoul to checkup > on failed attempt to parse the number and stop the > rest of the kallsyms__parse processing early. > > Link: http://lkml.kernel.org/n/tip-djqwni3p6lgctf6o7xhhw...@git.kernel.org > Signed-off-by: Jiri Olsa Acked-by: Namhyung Kim Thanks, Namhyung > --- > tools/lib/symbol/kallsyms.c | 8 ++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/tools/lib/symbol/kallsyms.c b/tools/lib/symbol/kallsyms.c > index 914cb8e3d40b..dd5bb1dfd2b6 100644 > --- a/tools/lib/symbol/kallsyms.c > +++ b/tools/lib/symbol/kallsyms.c > @@ -29,6 +29,7 @@ int kallsyms__parse(const char *filename, void *arg, > int line_len, len; > char symbol_type; > char *symbol_name; > + char *endptr; > > line_len = getline(, , file); > if (line_len < 0 || !line) > @@ -36,9 +37,12 @@ int kallsyms__parse(const char *filename, void *arg, > > line[--line_len] = '\0'; /* \n */ > > - len = hex2u64(line, ); > + start = strtoul(line, , 16); > + if (line == endptr) > + continue; > + > + len = endptr - line + 1; > > - len++; > if (len + 2 >= line_len) > continue; > > -- > 2.13.6 >
[PATCH 1/2] tools lib symbol: Use strtoul instead of hex2u64 in kallsyms__parse
Current kallsyms__parse uses hex2u64, which gives no indication of error. Using strtoul to checkup on failed attempt to parse the number and stop the rest of the kallsyms__parse processing early. Link: http://lkml.kernel.org/n/tip-djqwni3p6lgctf6o7xhhw...@git.kernel.org Signed-off-by: Jiri Olsa--- tools/lib/symbol/kallsyms.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/lib/symbol/kallsyms.c b/tools/lib/symbol/kallsyms.c index 914cb8e3d40b..dd5bb1dfd2b6 100644 --- a/tools/lib/symbol/kallsyms.c +++ b/tools/lib/symbol/kallsyms.c @@ -29,6 +29,7 @@ int kallsyms__parse(const char *filename, void *arg, int line_len, len; char symbol_type; char *symbol_name; + char *endptr; line_len = getline(, , file); if (line_len < 0 || !line) @@ -36,9 +37,12 @@ int kallsyms__parse(const char *filename, void *arg, line[--line_len] = '\0'; /* \n */ - len = hex2u64(line, ); + start = strtoul(line, , 16); + if (line == endptr) + continue; + + len = endptr - line + 1; - len++; if (len + 2 >= line_len) continue; -- 2.13.6
[PATCH 1/2] tools lib symbol: Use strtoul instead of hex2u64 in kallsyms__parse
Current kallsyms__parse uses hex2u64, which gives no indication of error. Using strtoul to checkup on failed attempt to parse the number and stop the rest of the kallsyms__parse processing early. Link: http://lkml.kernel.org/n/tip-djqwni3p6lgctf6o7xhhw...@git.kernel.org Signed-off-by: Jiri Olsa --- tools/lib/symbol/kallsyms.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/lib/symbol/kallsyms.c b/tools/lib/symbol/kallsyms.c index 914cb8e3d40b..dd5bb1dfd2b6 100644 --- a/tools/lib/symbol/kallsyms.c +++ b/tools/lib/symbol/kallsyms.c @@ -29,6 +29,7 @@ int kallsyms__parse(const char *filename, void *arg, int line_len, len; char symbol_type; char *symbol_name; + char *endptr; line_len = getline(, , file); if (line_len < 0 || !line) @@ -36,9 +37,12 @@ int kallsyms__parse(const char *filename, void *arg, line[--line_len] = '\0'; /* \n */ - len = hex2u64(line, ); + start = strtoul(line, , 16); + if (line == endptr) + continue; + + len = endptr - line + 1; - len++; if (len + 2 >= line_len) continue; -- 2.13.6