klibc-bot for Ben Hutchings
2022-Aug-03 22:51 UTC
[klibc] [klibc:master] Kbuild: Properly disable executable stacks in static builds
Commit-ID: 2acbe15d7a8093cfa295aadc56707892e87a7eaf Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=2acbe15d7a8093cfa295aadc56707892e87a7eaf Author: Ben Hutchings <ben at decadent.org.uk> AuthorDate: Tue, 2 Aug 2022 22:47:14 +0200 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Thu, 4 Aug 2022 00:45:26 +0200 [klibc] Kbuild: Properly disable executable stacks in static builds I typo'd the variable name KLIBCSTACKFLAGS in the value of KLIBCCFLAGS, leaving the stack executable in statically linked executables. Fix that. Executables using a shared library did not have this problem, unless they included assembly language sources. C compilers generate the no-executable-stack header by default, and the interpreter definition that's statically linked into such executables was built with a correctly spelt KLIBCSTACKFLAGS as an extra option. Fixes: c562319cdba0 ("[klibc] Kbuild: Add a per-architecture option to ...") Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- scripts/Kbuild.klibc | 2 +- usr/klibc/Kbuild | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/Kbuild.klibc b/scripts/Kbuild.klibc index e88bc003..64da31ac 100644 --- a/scripts/Kbuild.klibc +++ b/scripts/Kbuild.klibc @@ -133,7 +133,7 @@ KLIBCDEFS += -D__KLIBC__=$(KLIBCMAJOR) \ -D_BITSIZE=$(KLIBCBITSIZE) KLIBCCPPFLAGS += $(KLIBCDEFS) KLIBCCFLAGS += $(KLIBCCPPFLAGS) $(KLIBCREQFLAGS) $(KLIBCARCHREQFLAGS) \ - $(KLIBCOPTFLAGS) $(KLIBCSTACKFLGS) $(KLIBCWARNFLAGS) + $(KLIBCOPTFLAGS) $(KLIBCSTACKFLAGS) $(KLIBCWARNFLAGS) KLIBCAFLAGS += -D__ASSEMBLY__ $(KLIBCCFLAGS) KLIBCSTRIPFLAGS += --strip-all -R .comment -R .note diff --git a/usr/klibc/Kbuild b/usr/klibc/Kbuild index 9ea55a23..5933f89a 100644 --- a/usr/klibc/Kbuild +++ b/usr/klibc/Kbuild @@ -186,7 +186,6 @@ quiet_cmd_interp = BUILD $@ cmd_interp = $(KLIBCCC) $(klibccflags) -D__ASSEMBLY__ \ -DLIBDIR=\"$(SHLIBDIR)\" \ -DSOHASH=\"$(SOLIBHASH)\" \ - $(KLIBCSTACKFLAGS) \ -c -o $@ $< $(INTERP_O): $(obj)/interp.S $(SOLIB).hash
Christophe Leroy
2022-Sep-15 10:06 UTC
[klibc] [klibc:master] Kbuild: Properly disable executable stacks in static builds
Hi Ben, Le 04/08/2022 ? 00:51, klibc-bot for Ben Hutchings a ?crit?:> Commit-ID: 2acbe15d7a8093cfa295aadc56707892e87a7eaf > Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=2acbe15d7a8093cfa295aadc56707892e87a7eaf > Author: Ben Hutchings <ben at decadent.org.uk> > AuthorDate: Tue, 2 Aug 2022 22:47:14 +0200 > Committer: Ben Hutchings <ben at decadent.org.uk> > CommitDate: Thu, 4 Aug 2022 00:45:26 +0200 > > [klibc] Kbuild: Properly disable executable stacks in static builds > > I typo'd the variable name KLIBCSTACKFLAGS in the value of > KLIBCCFLAGS, leaving the stack executable in statically linked > executables. Fix that. > > Executables using a shared library did not have this problem, unless > they included assembly language sources. C compilers generate the > no-executable-stack header by default, and the interpreter definition > that's statically linked into such executables was built with a > correctly spelt KLIBCSTACKFLAGS as an extra option. > > Fixes: c562319cdba0 ("[klibc] Kbuild: Add a per-architecture option to ...") > Signed-off-by: Ben Hutchings <ben at decadent.org.uk> >Do you have any planned date for the delivery of klibc 2.0.11 with the above fix ? Thanks Christophe