[Bug c/85310] optimization ignoring strlen() results

2018-04-09 Thread dvyukov at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85310 --- Comment #6 from Dmitry Vyukov --- It seems to me that compiler is fine here and we just have a bug in kernel code. Result of strlen called on char[16] can't possibly by >15 (without causing undefined behavior -- reading past the end of the ob

[Bug c/85310] optimization ignoring strlen() results

2018-04-09 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85310 --- Comment #5 from Andrew Pinski --- (In reply to Kees Cook from comment #4) > But it's optimizing away the check. That what undefined means. > If strlen() were suddenly acting like > strnlen(), that'd be one thing, but the return value from

[Bug c/85310] optimization ignoring strlen() results

2018-04-09 Thread kees at outflux dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85310 --- Comment #4 from Kees Cook --- But it's optimizing away the check. If strlen() were suddenly acting like strnlen(), that'd be one thing, but the return value from strlen() is being used by the memcpy() without the actual test in between. That'

[Bug c/85310] optimization ignoring strlen() results

2018-04-09 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85310 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c/85310] optimization ignoring strlen() results

2018-04-09 Thread kees at outflux dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85310 Kees Cook changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED Resolution|INVALID

[Bug c/85310] optimization ignoring strlen() results

2018-04-09 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85310 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---