Page MenuHomePhabricator

Restore visibility attribute for OpenBSD's stack guard
Needs ReviewPublic

Authored by sisnkemp on Jan 24 2017, 8:27 AM.



This diff is from Philip Guenther (
and got committed to the OpenBSD tree, see

This repairs my previous patch ( that
missed the fact that removing visibility diff results accesses to
the stack protector look like this:

two loads

movq __guard_local@GOTPCREL(%rip), %rbx
movq (%rbx), %rax

But better is one load only, which is what Philip's diff achieves
movq __guard_local(%rip), %rax

Diff Detail

Event Timeline

sisnkemp created this revision.Jan 24 2017, 8:27 AM
joerg added a subscriber: joerg.Jan 24 2017, 8:48 AM

Missing test case.

timshen edited edge metadata.EditedJan 25 2017, 3:51 PM

Though I don't know a way off my hand, it's indeed good to have a testcase for this.

brad added a subscriber: brad.Mar 16 2017, 6:43 PM

Any suggestions for a test case?

joerg added a comment.Sep 8 2017, 5:39 AM

Create a function that does check the guard variable and make sure that it has the correct visibility declaration and/or access.