Modify

Opened 3 years ago

Last modified 20 months ago

#19913 reopened defect

Missing symbols since enabling SSP

Reported by: anonymous Owned by: developers
Priority: normal Milestone:
Component: base system Version: Trunk
Keywords: Cc:

Description

since enabling SSP I'm noticing the following symbols missing (asked interactively) when compiling trunk:

UCLIBC_HAS_SSP_COMPAT
SSP_QUICK_CANARY
PROPOLICE_BLOCK_ABRT
PROPOLICE_BLOCK_SEGV
UCLIBC_BUILD_SSP

Support for GCC stack smashing protector (UCLIBC_HAS_SSP) [Y/n/?] y
Support for gcc-3.x propolice smashing stack protector (UCLIBC_HAS_SSP_COMPAT) [N/y/?] (NEW)
Use simple guard values without accessing /dev/urandom (SSP_QUICK_CANARY) [N/y/?] (NEW)
Propolice protection blocking signal
  > 1. abort (PROPOLICE_BLOCK_ABRT) (NEW)
    2. segfault (PROPOLICE_BLOCK_SEGV) (NEW)
  choice[1-2?]:
Build uClibc with -fstack-protector (UCLIBC_BUILD_SSP) [N/y/?] (NEW)
Build uClibc with linker option -z RELRO (UCLIBC_BUILD_RELRO) [Y/n/?] y
Build uClibc with linker option -z NOW (UCLIBC_BUILD_NOW) [N/y/?] n
Build uClibc with noexecstack marking (UCLIBC_BUILD_NOEXECSTACK) [Y/n/?] y

Attachments (0)

Change History (11)

comment:1 Changed 3 years ago by anonymous

And then it still bombs:

true -Stripping_disabled -x -R .note -R .comment libc/libc_so.a
rm -f lib/libc.so lib/libc.so.0 lib/libuClibc-0.9.33.2.so
i486-openwrt-linux-uclibc-gcc -Wl,-EL -Wl,--sort-common -Wl,--sort-section=alignment -m32 -shared -Wl,--warn-common -Wl,--warn-once -Wl,-z,combreloc -Wl,-z,relro -Wl,-z,defs   -Wl,-init,__uClibc_init  -Wl,-soname=libc.so.0 -nostdlib -o lib/libuClibc-0.9.33.2.so  -Wl,--whole-archive libc/libc_so.a -Wl,--no-whole-archive ./lib/interp.os ./lib/ld-uClibc.so.0 ./lib/uclibc_nonshared.a /home/development/src/openwrt-trunk/openwrt/staging_dir/toolchain-i386_i486_gcc-4.8-linaro_uClibc-0.9.33.2/lib/gcc/i486-openwrt-linux-uclibc/4.8.3/libgcc_initial.a
libc/libc_so.a(wordexp.os): In function `exec_comm':
/home/development/src/openwrt-trunk/openwrt/build_dir/toolchain-i386_i486_gcc-4.8-linaro_uClibc-0.9.33.2/uClibc-0.9.33.2/libc/misc/wordexp/wordexp.c:798: undefined reference to `__stack_chk_guard'
collect2: error: ld returned 1 exit status
make[4]: *** [lib/libc.so] Error 1
make[4]: Leaving directory `/home/development/src/openwrt-trunk/openwrt/build_dir/toolchain-i386_i486_gcc-4.8-linaro_uClibc-0.9.33.2/uClibc-0.9.33.2'
make[3]: *** [/home/development/src/openwrt-trunk/openwrt/build_dir/toolchain-i386_i486_gcc-4.8-linaro_uClibc-0.9.33.2/uClibc-0.9.33.2/.built] Error 2
make[3]: Leaving directory `/home/development/src/openwrt-trunk/openwrt/toolchain/uClibc'
make[2]: *** [toolchain/uClibc/compile] Error 2
make[2]: Leaving directory `/home/development/src/openwrt-trunk/openwrt'
make[1]: *** [/home/development/src/openwrt-trunk/openwrt/staging_dir/toolchain-i386_i486_gcc-4.8-linaro_uClibc-0.9.33.2/stamp/.toolchain_install] Error 2
make[1]: Leaving directory `/home/development/src/openwrt-trunk/openwrt'
make: *** [world] Error 2

comment:2 Changed 3 years ago by anonymous

Problem remains after updating to latest trunk r46067

libc/misc/pthread/tsd.os libc/stdlib/system.oS
true -Stripping_disabled -x -R .note -R .comment libc/libc_so.a
rm -f lib/libc.so lib/libc.so.0 lib/libuClibc-0.9.33.2.so
i486-openwrt-linux-uclibc-gcc -Wl,-EL -Wl,--sort-common -Wl,--sort-section=alignment -m32 -shared -Wl,--warn-common -Wl,--warn-once -Wl,-z,combreloc -Wl,-z,relro -Wl,-z,defs   -Wl,-init,__uClibc_init  -Wl,-soname=libc.so.0 -nostdlib -o lib/libuClibc-0.9.33.2.so  -Wl,--whole-archive libc/libc_so.a -Wl,--no-whole-archive ./lib/interp.os ./lib/ld-uClibc.so.0 ./lib/uclibc_nonshared.a /home/development/src/openwrt-trunk/openwrt/staging_dir/toolchain-i386_i486_gcc-4.8-linaro_uClibc-0.9.33.2/lib/gcc/i486-openwrt-linux-uclibc/4.8.3/libgcc_initial.a
libc/libc_so.a(wordexp.os): In function `exec_comm':
/home/development/src/openwrt-trunk/openwrt/build_dir/toolchain-i386_i486_gcc-4.8-linaro_uClibc-0.9.33.2/uClibc-0.9.33.2/libc/misc/wordexp/wordexp.c:798: undefined reference to `__stack_chk_guard'
collect2: error: ld returned 1 exit status
make[4]: *** [lib/libc.so] Error 1
make[4]: Leaving directory `/home/development/src/openwrt-trunk/openwrt/build_dir/toolchain-i386_i486_gcc-4.8-linaro_uClibc-0.9.33.2/uClibc-0.9.33.2'
make[3]: *** [/home/development/src/openwrt-trunk/openwrt/build_dir/toolchain-i386_i486_gcc-4.8-linaro_uClibc-0.9.33.2/uClibc-0.9.33.2/.built] Error 2
make[3]: Leaving directory `/home/development/src/openwrt-trunk/openwrt/toolchain/uClibc'
make[2]: *** [toolchain/uClibc/compile] Error 2
make[2]: Leaving directory `/home/development/src/openwrt-trunk/openwrt'
make[1]: *** [/home/development/src/openwrt-trunk/openwrt/staging_dir/toolchain-i386_i486_gcc-4.8-linaro_uClibc-0.9.33.2/stamp/.toolchain_install] Error 2
make[1]: Leaving directory `/home/development/src/openwrt-trunk/openwrt'
make: *** [world] Error 2

comment:3 Changed 3 years ago by cyrus

  • Resolution set to worksforme
  • Status changed from new to closed

Sorry, cannot reproduce.
Here is what I tried:

make dirclean
rm .config
make menuconfig
Selected: Target x86
Selected: Use uClibc
make -j4

Toolchain builds successfully. Please try a make dirclean and rebuild your toolchain.

comment:4 Changed 3 years ago by anonymous

I did indeed do a "make dirclean" before every make attempt, since enabling SSP, but it still bombs out (using some config file I've been using for 1+ year).

I guess I'll have to look more into it, maybe some old uclibc settings interfere with it.

comment:5 Changed 3 years ago by anonymous

  • Resolution worksforme deleted
  • Status changed from closed to reopened

comment:6 Changed 3 years ago by anonymous

Sorry, I still get missing symbols and compilation errors (symbols with "NEW"):

extra/config/conf -o extra/Configs/Config.in
./.config:178:warning: override: reassigning to symbol UCLIBC_HAS_SSP
*
* Restart config...
*
*
* Security options
*
Build utilities as ET_DYN/PIE executables (UCLIBC_BUILD_PIE) [N/y/?] n
Include the arc4random() function (UCLIBC_HAS_ARC4RANDOM) [N/y/?] n
Support for GCC stack smashing protector (UCLIBC_HAS_SSP) [Y/n/?] y
  Support for gcc-3.x propolice smashing stack protector (UCLIBC_HAS_SSP_COMPAT) [N/y/?] (NEW)
   Use simple guard values without accessing /dev/urandom (SSP_QUICK_CANARY) [N/y/?] (NEW)
   Propolice protection blocking signal
  > 1. abort (PROPOLICE_BLOCK_ABRT) (NEW)
    2. segfault (PROPOLICE_BLOCK_SEGV) (NEW)
  choice[1-2?]:
   Build uClibc with -fstack-protector (UCLIBC_BUILD_SSP) [N/y/?] (NEW)
Build uClibc with linker option -z RELRO (UCLIBC_BUILD_RELRO) [Y/n/?] y
Build uClibc with linker option -z NOW (UCLIBC_BUILD_NOW) [N/y/?] n
Build uClibc with noexecstack marking (UCLIBC_BUILD_NOEXECSTACK) [Y/n/?] y
#
# configuration written to ./.config

If I define UCLIBC_BUILD_SSP=y, then it bombs later:

true -Stripping_disabled -x -R .note -R .comment libc/libc_so.a
rm -f lib/libc.so lib/libc.so.0 lib/libuClibc-0.9.33.2.so
i486-openwrt-linux-uclibc-gcc -Wl,-EL -Wl,--sort-common -Wl,--sort-section=alignment -m32 -shared -Wl,--warn-common -Wl,--warn-once -Wl,-z,combreloc -Wl,-z,relro -Wl,-z,defs   -Wl,-init,__uClibc_init  -Wl,-soname=libc.so.0 -nostdlib -o lib/libuClibc-0.9.33.2.so  -Wl,--whole-archive libc/libc_so.a -Wl,--no-whole-archive ./lib/interp.os ./lib/ld-uClibc.so.0 ./lib/uclibc_nonshared.a /home/development/src/openwrt-trunk/openwrt/staging_dir/toolchain-i386_i486_gcc-4.8-linaro_uClibc-0.9.33.2/lib/gcc/i486-openwrt-linux-uclibc/4.8.3/libgcc_initial.a
libc/libc_so.a(wordexp.os): In function `exec_comm':
/home/development/src/openwrt-trunk/openwrt/build_dir/toolchain-i386_i486_gcc-4.8-linaro_uClibc-0.9.33.2/uClibc-0.9.33.2/libc/misc/wordexp/wordexp.c:798: undefined reference to `__stack_chk_guard'
collect2: error: ld returned 1 exit status
make[4]: *** [lib/libc.so] Error 1
make[4]: Leaving directory `/home/development/src/openwrt-trunk/openwrt/build_dir/toolchain-i386_i486_gcc-4.8-linaro_uClibc-0.9.33.2/uClibc-0.9.33.2'
make[3]: *** [/home/development/src/openwrt-trunk/openwrt/build_dir/toolchain-i386_i486_gcc-4.8-linaro_uClibc-0.9.33.2/uClibc-0.9.33.2/.built] Error 2
make[3]: Leaving directory `/home/development/src/openwrt-trunk/openwrt/toolchain/uClibc'
make[2]: *** [toolchain/uClibc/compile] Error 2
make[2]: Leaving directory `/home/development/src/openwrt-trunk/openwrt'
make[1]: *** [/home/development/src/openwrt-trunk/openwrt/staging_dir/toolchain-i386_i486_gcc-4.8-linaro_uClibc-0.9.33.2/stamp/.toolchain_install] Error 2
make[1]: Leaving directory `/home/development/src/openwrt-trunk/openwrt'
make: *** [world] Error 2

comment:7 Changed 3 years ago by anonymous

Have you tried a make dirclean in order to completely rebuild the toolchain?

comment:8 Changed 3 years ago by anonymous

Yes, as I wrote above:

I did indeed do a "make dirclean" before every make attempt.

comment:9 Changed 3 years ago by anonymous

In the past few days I've tried many different combinations, even starting from scratch (wiping the entire installation, doing a "git clone ...", re-downloading all files etc) and doing -as suggested above- the

rm .config
make menuconfig
Selected: Target x86
Selected: Use uClibc

and I still get the same missing symbols.

PS: Until now SSP bombed at grub2, hopefully after today's commits it'll work.

comment:10 Changed 3 years ago by arokh

Yeah, missing symbols here as well. I fixed it like this:

diff --git a/toolchain/uClibc/config-0.9.33.2/common b/toolchain/uClibc/config-0.9.33.2/common
index b948d4b..0fa7f24 100644
--- a/toolchain/uClibc/config-0.9.33.2/common
+++ b/toolchain/uClibc/config-0.9.33.2/common
@@ -159,6 +159,10 @@ UCLIBC_HAS_SOCKET=y
 UCLIBC_HAS_SOFT_FLOAT=y
 # UCLIBC_HAS_SSP is not set
 # UCLIBC_HAS_SSP_COMPAT is not set
+# SSP_QUICK_CANARY is not set
+PROPOLICE_BLOCK_ABRT=y
+# PROPOLICE_BLOCK_SEGV is not set
+# UCLIBC_BUILD_SSP is not set
 UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
 # UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
 # UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set

comment:11 Changed 20 months ago by anonymous

@Comment 10, but isn't this disabling SSP?

Add Comment

Modify Ticket

Action
as reopened .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.