Project

General

Profile

Feature #5788

Want support for GCC's stack protector in libc

Added by Andrew Stormont over 5 years ago. Updated about 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2015-04-03
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

Building code with the -fstack-protector option is more difficult than it needs to be. One way to make it easier would be to drop the need for libssp_nonshared.a by implementing __stack_chk_fail and __stack_chk_guard in libc.


Related issues

Related to illumos gate - Feature #5922: Want support for building with -fstack-protectorClosed2015-05-13

Actions

History

#1

Updated by Andrew Stormont about 5 years ago

  • Related to Feature #5922: Want support for building with -fstack-protector added
#2

Updated by Dan McDonald about 5 years ago

Interesting. I've started using gcc51 in OmniOS's bloody for building non-ON bits. Does libc's lack of support here cause a problem?

Downloading any recent (as of this comment) OmniOS bloody should have gcc51-built omnios-build userland bits in it. I'd appreciate knowing if there are any interaction problems.

#3

Updated by Andrew Stormont about 5 years ago

It kind of does cause problems. If you pass -fstack-protector when compiling libssp gets linked in automatically, but if you are building objects separately and then do the final link with ld libssp does not get linked in, and you get unresolved symbol errors. The solution is to make sure that -lssp is passed when linking with ld. Linux (and BSD, afaik) include SSP support directly in libc so there's no need to futz with the separate libssp library.

#4

Updated by Dan McDonald about 5 years ago

The "on by default in newer gcc" from a similar bug had me concerned. I see no libssp linkages in omnios-build built tools, so perhaps 5.1.0 doesn't add -fstack-protector by default.

#5

Updated by Andrew Stormont about 5 years ago

I haven't seen it either. It must be disabled on Solaris/illumos, probably due to the issues I mentioned above.

#6

Updated by Andrew Stormont about 5 years ago

I suppose adding some filter symbols to libc should be good enough.

EDIT: Never mind. That won't help.

Also available in: Atom PDF