Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 470608 - sys-libs/uclibc[-nptl] and [-ssp]: stack_guard not initialized which crashes (at least) on i386 w/-fstack-protector
Summary: sys-libs/uclibc[-nptl] and [-ssp]: stack_guard not initialized which crashes ...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: Embedded Gentoo Team
URL:
Whiteboard:
Keywords:
: 267335 (view as bug list)
Depends on:
Blocks: 455236 467306 uclibc-porting
  Show dependency tree
 
Reported: 2013-05-19 06:49 UTC by SpanKY
Modified: 2018-10-14 12:04 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SpanKY gentoo-dev 2013-05-19 06:49:47 UTC
when you build uClibc with USE=-ssp, the stack_guard pointer is not initialized (left at 0).  on i386, gcc attempts to deref that pointer directly when you use the -fstack-protector flag:
00000000 <main>:
   0:   55                      push   %ebp
   1:   89 e5                   mov    %esp,%ebp
   3:   83 e4 f0                and    $0xfffffff0,%esp
   6:   83 ec 20                sub    $0x20,%esp
   9:   65 a1 14 00 00 00       mov    %gs:0x14,%eax

offset 0x14 in the thread mem area on i386 is the uintptr_t stack_guard.

uClibc will initialize that only when built with USE=ssp, and only with the newer nptl port (USE=nptl).  so if you're using USE=-nptl (linuxthreads) or USE=-ssp, this will cause crashes.

probably need to update the code to at least point the stack_guard to a dummy location when built w/USE=-ssp.
Comment 1 Anthony Basile gentoo-dev 2013-09-12 20:26:11 UTC
*** Bug 267335 has been marked as a duplicate of this bug. ***
Comment 2 Pacho Ramos gentoo-dev 2018-10-08 12:01:17 UTC
is this affecting uclibc-ng too?
Comment 3 Anthony Basile gentoo-dev 2018-10-13 09:10:07 UTC
(In reply to Pacho Ramos from comment #2)
> is this affecting uclibc-ng too?

nope
Comment 4 Pacho Ramos gentoo-dev 2018-10-13 09:20:23 UTC
Maybe this (and other similar bug reports) could be closed then :)

In my case I noticed this when reviewing bug 467306
Comment 5 Anthony Basile gentoo-dev 2018-10-14 12:04:33 UTC
(In reply to Pacho Ramos from comment #4)
> Maybe this (and other similar bug reports) could be closed then :)
> 
> In my case I noticed this when reviewing bug 467306

sys-libs/uclibc has been removed from the tree, replaced by sys-libs/uclibc-ng