Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Aug 2020 20:15:04 +0000
From:      bugzilla-noreply@freebsd.org
To:        gecko@FreeBSD.org
Subject:   [Bug 239873] www/firefox and mail/thunderbird don't like the new ASLR "stackgap" feature
Message-ID:  <bug-239873-21738-jYD6aIxBKU@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-239873-21738@https.bugs.freebsd.org/bugzilla/>
References:  <bug-239873-21738@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D239873

--- Comment #3 from sigsys@gmail.com ---
(In reply to Thibault Payet from comment #2)
Same problem here.

Looks like the proccontrol stackgap toggle only affects the stack "guard pa=
ge"
(handled by vm_map_stack_locked() in sys/vm/vm_map.c), not the ASLR randomi=
zed
stackgap.

This patch makes it affect the ASLR stackgap too and that makes firefox work
with proccontrol.

diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index fe71acabe0b..56623f29d4e 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -2766,6 +2766,9 @@ __elfN(stackgap)(struct image_params *imgp, uintptr_t
*stack_base)

        if ((imgp->map_flags & MAP_ASLR) =3D=3D 0)
                return;
+       if ((imgp->proc->p_flag2 & P2_STKGAP_DISABLE) !=3D 0 ||
+           (imgp->proc->p_fctl0 & NT_FREEBSD_FCTL_STKGAP_DISABLE) !=3D 0)
+               return;
        pct =3D __elfN(aslr_stack_gap);
        if (pct =3D=3D 0)
                return;

Also if you mark firefox's binary with the new ELF feature flag to disable
stackgap like so:

# elfctl -e +stackgap /usr/local/bin/firefox

Then firefox just works without needing to start with it proccontrol.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-239873-21738-jYD6aIxBKU>