[Bug target/94158] Expanded strlen causes out-of-bounds read on AMD64 target

2020-03-12 Thread par...@cyber-itl.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94158 --- Comment #7 from Parker Thompson --- (In reply to Jakub Jelinek from comment #6) > GCC assumes pointers returned by malloc are at least MALLOC_ABI_ALIGNMENT > bytes aligned. That is because: > "The pointer returned if the allocation succeeds

[Bug target/94158] Expanded strlen causes out-of-bounds read on AMD64 target

2020-03-12 Thread par...@cyber-itl.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94158 --- Comment #3 from Parker Thompson --- (In reply to Andrew Pinski from comment #2) > Also aligned_alloc normally does not allow alignment of 1. > > So GCC is doing the correct thing. The replacement of strdup here is just to illustrate the iss

[Bug target/94158] New: Expanded strlen causes out-of-bounds read on AMD64 target

2020-03-12 Thread par...@cyber-itl.org
Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: par...@cyber-itl.org Target Milestone: --- On AMD64/Linux, When strlen() is expanded, if the argument to strlen comes from a source like strdup() or other functions returning allocator