Re: [PATCH] Fix for invalid sanitization of trailing byte in __builtin_strlen

2014-06-23 Thread Maxim Ostapenko
On 06/23/2014 10:11 PM, Jeff Law wrote: On 06/23/14 10:55, Maxim Ostapenko wrote: Hi, when I applied this patch (r211846), I made a little mistake in output test patterns. This patch fixes this. Tested on x86_64-unknown-linux-gnu. Ok to commit? OK. jeff Thanks, done in r211927. -Maxim

Re: [PATCH] Fix for invalid sanitization of trailing byte in __builtin_strlen

2014-06-23 Thread Jeff Law
On 06/23/14 10:55, Maxim Ostapenko wrote: Hi, when I applied this patch (r211846), I made a little mistake in output test patterns. This patch fixes this. Tested on x86_64-unknown-linux-gnu. Ok to commit? OK. jeff

Re: [PATCH] Fix for invalid sanitization of trailing byte in __builtin_strlen

2014-06-23 Thread Maxim Ostapenko
Hi, when I applied this patch (r211846), I made a little mistake in output test patterns. This patch fixes this. Tested on x86_64-unknown-linux-gnu. Ok to commit? -Maxim gcc/testsuite/ChangeLog: 2014-06-23 Max Ostapenko * c-c++-common/asan/strlen-overflow-1.c: Change match patterns. d

Re: [PATCH] Fix for invalid sanitization of trailing byte in __builtin_strlen

2014-06-20 Thread Maxim Ostapenko
On 06/20/2014 04:59 PM, Jakub Jelinek wrote: On Fri, Jun 20, 2014 at 04:55:43PM +0400, Maxim Ostapenko wrote: What about bootstrap though? Bootstrap in progress. +__SIZE_TYPE__ strlen (const char *p) { + /* Simulate error */ + if (p == a) +return 1; Why this? Can't you instead just u

Re: [PATCH] Fix for invalid sanitization of trailing byte in __builtin_strlen

2014-06-20 Thread Jakub Jelinek
On Fri, Jun 20, 2014 at 04:55:43PM +0400, Maxim Ostapenko wrote: > > What about bootstrap though? > > Bootstrap in progress. > > >> +__SIZE_TYPE__ strlen (const char *p) { > >> + /* Simulate error */ > >> + if (p == a) > >> +return 1; > > > Why this? Can't you instead just use __attribute

Re: [PATCH] Fix for invalid sanitization of trailing byte in __builtin_strlen

2014-06-20 Thread Maxim Ostapenko
> What about bootstrap though? Bootstrap in progress. >> +__SIZE_TYPE__ strlen (const char *p) { >> + /* Simulate error */ >> + if (p == a) >> +return 1; > Why this? Can't you instead just use __attribute__((no_sanitize_address, noinline)) > on it instead? Done. Ok to commit if boots

Re: [PATCH] Fix for invalid sanitization of trailing byte in __builtin_strlen

2014-06-20 Thread Yuri Gribov
On Fri, Jun 20, 2014 at 2:57 PM, Jakub Jelinek wrote: > On Fri, Jun 20, 2014 at 02:49:12PM +0400, Maxim Ostapenko wrote: >> This patch fixes invalid sanitization of trailing byte in __builtin_strlen ( >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61547). >> >> Tested on x86_64-unknown-linux-gnu,

Re: [PATCH] Fix for invalid sanitization of trailing byte in __builtin_strlen

2014-06-20 Thread Jakub Jelinek
On Fri, Jun 20, 2014 at 02:49:12PM +0400, Maxim Ostapenko wrote: > This patch fixes invalid sanitization of trailing byte in __builtin_strlen ( > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61547). > > Tested on x86_64-unknown-linux-gnu, no regressions. > + > +#include > + > +char a[2] = "0"; >

[PATCH] Fix for invalid sanitization of trailing byte in __builtin_strlen

2014-06-20 Thread Maxim Ostapenko
This patch fixes invalid sanitization of trailing byte in __builtin_strlen ( https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61547). Tested on x86_64-unknown-linux-gnu, no regressions. Ok to commit? -Maxim gcc/ChangeLog: 2014-06-20 Yury Gribov Max Ostapenko PR sanitizer/61547 * asan