Skip to contentSkip to conversation

sudo: don't use hardening flags on host tools

PATCH New Gustavo Zacarias 3 participants 3 messages Sep 20, 2014 – Sep 21, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 sudo: don't use hardening flags on host tools

Don't use hardening (SSP_CFLAGS & PIE_CFLAGS) flags on host tools since the host compiler may differ wildly from the tests run on the cross compiler and they might not work. Fixes:
http://autobuild.buildroot.net/results/b10/b1091bd04ab988744548b74fb48c64bf291fed2f/

---
 ...udo-0002-drop-sspcflags-piecflags-for-host.patch | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 package/sudo/sudo-0002-drop-sspcflags-piecflags-for-host.patch
package/sudo/sudo-0002-drop-sspcflags-piecflags-for-host.patch new file +21 -0
new file mode 100644
index 0000000..9f09656
@@ -0,0 +1,21 @@
+Don't use SSP_CFLAGS and PIE_CFLAGS for host tools.
+http://www.sudo.ws/bugs/show_bug.cgi?id=662
+
+Signed-off-by: Gustavo Zacarias <[email protected]>
+
+diff -Nura sudo-1.8.10p3.orig/compat/Makefile.in sudo-1.8.10p3/compat/Makefile.in
+--- sudo-1.8.10p3.orig/compat/Makefile.in	2014-03-07 18:51:19.000000000 -0300
++++ sudo-1.8.10p3/compat/Makefile.in	2014-09-20 07:29:30.913108029 -0300
+@@ -96,10 +96,10 @@
+ 	./mksigname > $@
+ 
+ mksiglist: $(srcdir)/mksiglist.c $(srcdir)/mksiglist.h $(incdir)/missing.h $(top_builddir)/config.h
+-	$(CC) $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/mksiglist.c -o $@
++	$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/mksiglist.c -o $@
+ 
+ mksigname: $(srcdir)/mksigname.c $(srcdir)/mksigname.h $(incdir)/missing.h $(top_builddir)/config.h
+-	$(CC) $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/mksigname.c -o $@
++	$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/mksigname.c -o $@
+ 
+ fnm_test: fnm_test.o libreplace.la
+ 	$(LIBTOOL) --mode=link $(CC) -o $@ fnm_test.o libreplace.la $(PIE_LDFLAGS) $(SSP_LDFLAGS)
Signature · 1 line
1.8.5.5
#1 lore raw

PATCH v2 1/1 sudo: don't use hardening flags on host tools

Gustavo, All,

On 2014-09-20 08:09 -0300, Gustavo Zacarias spake thusly:

Quoted 6 lines

Don't use hardening (SSP_CFLAGS & PIE_CFLAGS) flags on host tools since the host compiler may differ wildly from the tests run on the cross compiler and they might not work. Fixes:
http://autobuild.buildroot.net/results/b10/b1091bd04ab988744548b74fb48c64bf291fed2f/

Regards,
Yann E. MORIN.

Quoted 39 lines
---
 ...udo-0002-drop-sspcflags-piecflags-for-host.patch | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 package/sudo/sudo-0002-drop-sspcflags-piecflags-for-host.patch
package/sudo/sudo-0002-drop-sspcflags-piecflags-for-host.patch new file +21 -0
new file mode 100644
index 0000000..9f09656
@@ -0,0 +1,21 @@
+Don't use SSP_CFLAGS and PIE_CFLAGS for host tools.
+http://www.sudo.ws/bugs/show_bug.cgi?id=662
+
+Signed-off-by: Gustavo Zacarias <[email protected]>
+
+diff -Nura sudo-1.8.10p3.orig/compat/Makefile.in sudo-1.8.10p3/compat/Makefile.in
+--- sudo-1.8.10p3.orig/compat/Makefile.in	2014-03-07 18:51:19.000000000 -0300
++++ sudo-1.8.10p3/compat/Makefile.in	2014-09-20 07:29:30.913108029 -0300
+@@ -96,10 +96,10 @@
+ 	./mksigname > $@
+ 
+ mksiglist: $(srcdir)/mksiglist.c $(srcdir)/mksiglist.h $(incdir)/missing.h $(top_builddir)/config.h
+-	$(CC) $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/mksiglist.c -o $@
++	$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/mksiglist.c -o $@
+ 
+ mksigname: $(srcdir)/mksigname.c $(srcdir)/mksigname.h $(incdir)/missing.h $(top_builddir)/config.h
+-	$(CC) $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/mksigname.c -o $@
++	$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/mksigname.c -o $@
+ 
+ fnm_test: fnm_test.o libreplace.la
+ 	$(LIBTOOL) --mode=link $(CC) -o $@ fnm_test.o libreplace.la $(PIE_LDFLAGS) $(SSP_LDFLAGS)
Signature · 6 lines
1.8.5.5

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH v2 1/1 sudo: don't use hardening flags on host tools

In reply to Gustavo Zacarias

Dear Gustavo Zacarias,

Quoted 10 lines · Gustavo Zacarias

Don't use hardening (SSP_CFLAGS & PIE_CFLAGS) flags on host tools since the host compiler may differ wildly from the tests run on the cross compiler and they might not work. Fixes:
http://autobuild.buildroot.net/results/b10/b1091bd04ab988744548b74fb48c64bf291fed2f/

---
 ...udo-0002-drop-sspcflags-piecflags-for-host.patch | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 package/sudo/sudo-0002-drop-sspcflags-piecflags-for-host.patch

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com