Re: [PATCH 1/4] Makefile: add -fno-builtin-stpcpy

2020-08-18 Thread Kees Cook
On Mon, Aug 17, 2020 at 03:02:09PM -0700, Nick Desaulniers wrote: > LLVM implemented a recent "libcall optimization" that lowers calls to > `sprintf(dest, "%s", str)` where the return value is used to > `stpcpy(dest, str) - dest`. This generally avoids the machinery involved > in parsing format str

Re: [PATCH 1/4] Makefile: add -fno-builtin-stpcpy

2020-08-18 Thread Kees Cook
On Mon, Aug 17, 2020 at 03:31:26PM -0700, H. Peter Anvin wrote: > On 2020-08-17 15:02, Nick Desaulniers wrote: > > LLVM implemented a recent "libcall optimization" that lowers calls to > > `sprintf(dest, "%s", str)` where the return value is used to > > `stpcpy(dest, str) - dest`. This generally av

Re: [PATCH 1/4] Makefile: add -fno-builtin-stpcpy

2020-08-18 Thread Greg KH
On Tue, Aug 18, 2020 at 09:29:39AM +0200, Ard Biesheuvel wrote: > On Tue, 18 Aug 2020 at 09:25, Greg KH wrote: > > > > On Tue, Aug 18, 2020 at 09:10:01AM +0200, Ard Biesheuvel wrote: > > > On Tue, 18 Aug 2020 at 00:02, Nick Desaulniers > > > wrote: > > > > > > > > LLVM implemented a recent "libc

Re: [PATCH 1/4] Makefile: add -fno-builtin-stpcpy

2020-08-18 Thread Ard Biesheuvel
On Tue, 18 Aug 2020 at 09:25, Greg KH wrote: > > On Tue, Aug 18, 2020 at 09:10:01AM +0200, Ard Biesheuvel wrote: > > On Tue, 18 Aug 2020 at 00:02, Nick Desaulniers > > wrote: > > > > > > LLVM implemented a recent "libcall optimization" that lowers calls to > > > `sprintf(dest, "%s", str)` where

Re: [PATCH 1/4] Makefile: add -fno-builtin-stpcpy

2020-08-18 Thread Greg KH
On Tue, Aug 18, 2020 at 09:10:01AM +0200, Ard Biesheuvel wrote: > On Tue, 18 Aug 2020 at 00:02, Nick Desaulniers > wrote: > > > > LLVM implemented a recent "libcall optimization" that lowers calls to > > `sprintf(dest, "%s", str)` where the return value is used to > > `stpcpy(dest, str) - dest`.

Re: [PATCH 1/4] Makefile: add -fno-builtin-stpcpy

2020-08-18 Thread Ard Biesheuvel
On Tue, 18 Aug 2020 at 00:02, Nick Desaulniers wrote: > > LLVM implemented a recent "libcall optimization" that lowers calls to > `sprintf(dest, "%s", str)` where the return value is used to > `stpcpy(dest, str) - dest`. This generally avoids the machinery involved > in parsing format strings. Thi

Re: [PATCH 1/4] Makefile: add -fno-builtin-stpcpy

2020-08-17 Thread Nick Desaulniers
On Mon, Aug 17, 2020 at 3:31 PM H. Peter Anvin wrote: > > On 2020-08-17 15:02, Nick Desaulniers wrote: > > LLVM implemented a recent "libcall optimization" that lowers calls to > > `sprintf(dest, "%s", str)` where the return value is used to > > `stpcpy(dest, str) - dest`. This generally avoids th

Re: [PATCH 1/4] Makefile: add -fno-builtin-stpcpy

2020-08-17 Thread H. Peter Anvin
On 2020-08-17 15:02, Nick Desaulniers wrote: > LLVM implemented a recent "libcall optimization" that lowers calls to > `sprintf(dest, "%s", str)` where the return value is used to > `stpcpy(dest, str) - dest`. This generally avoids the machinery involved > in parsing format strings. This optimizati

[PATCH 1/4] Makefile: add -fno-builtin-stpcpy

2020-08-17 Thread Nick Desaulniers
LLVM implemented a recent "libcall optimization" that lowers calls to `sprintf(dest, "%s", str)` where the return value is used to `stpcpy(dest, str) - dest`. This generally avoids the machinery involved in parsing format strings. This optimization was introduced into clang-12. Because the kernel d