Both fail with a "too much recursion" error message during start up.
I'm guessing the feature confuses them about the depth of the stack somehow.
Tested on 12.0-STABLE r351060.
They both work fine with the stackgap sysctls set to 0.
And they both have been working fine with the other ASLR features on ever since this was committed to 12-STABLE BTW.
hm, according to https://wiki.freebsd.org/ASLR the base ntpd also doesn't like stackgap..
Do we know how to make it working by using
/usr/bin/proccontrol -m stackgap -s disable firefox
This command still get the too much recursion error.
Currently I could either disable aslr completely for firefox, or just globally not enabling stackgap and keep aslr.
(In reply to Thibault Payet from comment #2)
Same problem here.
Looks like the proccontrol stackgap toggle only affects the stack "guard page" (handled by vm_map_stack_locked() in sys/vm/vm_map.c), not the ASLR randomized 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
@@ -2766,6 +2766,9 @@ __elfN(stackgap)(struct image_params *imgp, uintptr_t *stack_base)
if ((imgp->map_flags & MAP_ASLR) == 0)
+ if ((imgp->proc->p_flag2 & P2_STKGAP_DISABLE) != 0 ||
+ (imgp->proc->p_fctl0 & NT_FREEBSD_FCTL_STKGAP_DISABLE) != 0)
pct = __elfN(aslr_stack_gap);
if (pct == 0)
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.