Re: [RFC PATCH] -fsanitize=pointer-overflow support (PR sanitizer/80998)

2017-07-04 Thread Jakub Jelinek
On Tue, Jun 20, 2017 at 10:18:20AM +0200, Richard Biener wrote: > > Ok (of course, will handle this separately from the rest). > > Yes. Note I didn't look at the actual patch (yet). I'd like to ping the -fsanitize=pointer-overflow patch (though if you're busy, it can certainly wait a few weeks).

Re: [RFC PATCH] -fsanitize=pointer-overflow support (PR sanitizer/80998)

2017-06-21 Thread Richard Biener
On Wed, 21 Jun 2017, Jakub Jelinek wrote: > On Tue, Jun 20, 2017 at 10:18:20AM +0200, Richard Biener wrote: > > > It would be an attempt to avoid sanitizing int foo (int *p) { return > > > p[10] + p[-5]; } > > > (when the offset is constant and small and we dereference it). > > > If there is no p

Re: [RFC PATCH] -fsanitize=pointer-overflow support (PR sanitizer/80998)

2017-06-21 Thread Richard Biener
On Wed, 21 Jun 2017, Jakub Jelinek wrote: > On Tue, Jun 20, 2017 at 09:41:43AM +0200, Richard Biener wrote: > > > 2) libcpp/line-map.c has this: > > > static int > > > location_adhoc_data_update (void **slot, void *data) > > > { > > > *((char **) slot) += *((int64_t *) data); > > > return 1; >

Re: [RFC PATCH] -fsanitize=pointer-overflow support (PR sanitizer/80998)

2017-06-21 Thread Jakub Jelinek
On Tue, Jun 20, 2017 at 09:41:43AM +0200, Richard Biener wrote: > > 2) libcpp/line-map.c has this: > > static int > > location_adhoc_data_update (void **slot, void *data) > > { > > *((char **) slot) += *((int64_t *) data); > > return 1; > > } > > where the (why int64_t always?, we really need j

Re: [RFC PATCH] -fsanitize=pointer-overflow support (PR sanitizer/80998)

2017-06-21 Thread Jakub Jelinek
On Tue, Jun 20, 2017 at 10:18:20AM +0200, Richard Biener wrote: > > It would be an attempt to avoid sanitizing int foo (int *p) { return p[10] > > + p[-5]; } > > (when the offset is constant and small and we dereference it). > > If there is no page mapped at NULL or at the highest page in the virt

Re: [RFC PATCH] -fsanitize=pointer-overflow support (PR sanitizer/80998)

2017-06-20 Thread Richard Biener
On Tue, 20 Jun 2017, Jakub Jelinek wrote: > On Tue, Jun 20, 2017 at 09:41:43AM +0200, Richard Biener wrote: > > On Mon, 19 Jun 2017, Jakub Jelinek wrote: > > > > > Hi! > > > > > > The following patch adds -fsanitize=pointer-overflow support, > > > which adds instrumentation (included in -fsaniti

Re: [RFC PATCH] -fsanitize=pointer-overflow support (PR sanitizer/80998)

2017-06-20 Thread Jakub Jelinek
On Tue, Jun 20, 2017 at 09:41:43AM +0200, Richard Biener wrote: > On Mon, 19 Jun 2017, Jakub Jelinek wrote: > > > Hi! > > > > The following patch adds -fsanitize=pointer-overflow support, > > which adds instrumentation (included in -fsanitize=undefined) that checks > > that pointer arithmetics do

Re: [RFC PATCH] -fsanitize=pointer-overflow support (PR sanitizer/80998)

2017-06-20 Thread Richard Biener
On Mon, 19 Jun 2017, Jakub Jelinek wrote: > Hi! > > The following patch adds -fsanitize=pointer-overflow support, > which adds instrumentation (included in -fsanitize=undefined) that checks > that pointer arithmetics doesn't wrap. If the offset on ptr p+ off when > treating > it as signed value

[RFC PATCH] -fsanitize=pointer-overflow support (PR sanitizer/80998)

2017-06-19 Thread Jakub Jelinek
Hi! The following patch adds -fsanitize=pointer-overflow support, which adds instrumentation (included in -fsanitize=undefined) that checks that pointer arithmetics doesn't wrap. If the offset on ptr p+ off when treating it as signed value is non-negative, we check whether the result is bigger (