[Bug 252549] statically linked threaded binaries have executable thread stacks

[email protected]
Newsgroups gmane.os.freebsd.devel.threading
Message-ID <[email protected]/bugzilla/>
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252549

            Bug ID: 252549
           Summary: statically linked threaded binaries have executable
                    thread stacks
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: threads
          Assignee: [email protected]
          Reporter: [email protected]

The stack created by pthread_create in a statically linked binary has RWX
protection, regardless of the binary's desired stack (via PT_GNU_STACK).
Initial stack has expected protection.

See https://reviews.freebsd.org/D28050 for the discovery of this issue.

lib/libc/gen/dlfcn.c provides a weak _rtld_get_stack_prot for statically linked
binaries:

#pragma weak _rtld_get_stack_prot
int
_rtld_get_stack_prot(void)
{

        return (PROT_EXEC | PROT_READ | PROT_WRITE);
}

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-threads
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.