]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
stack_protector: Add tunable to bypass random cookies
authorcem <cem@FreeBSD.org>
Tue, 16 Apr 2019 18:47:20 +0000 (18:47 +0000)
committercem <cem@FreeBSD.org>
Tue, 16 Apr 2019 18:47:20 +0000 (18:47 +0000)
commitfbf32f5f72710273ee599bf2ceedd5169232198e
treeb277720399ed0eb50a95788164ee8b95c6709845
parentdec0f8b5924d762f785125231e4adfed7296b614
stack_protector: Add tunable to bypass random cookies

This is a stopgap measure to unbreak installer/VM/embedded boot issues
introduced (or at least exposed by) in r346250.

Add the new tunable, "security.stack_protect.permit_nonrandom_cookies," in
order to continue boot with insecure non-random stack cookies if the random
device is unavailable.

For now, enable it by default.  This is NOT safe.  It will be disabled by
default in a future revision.

There is follow-on work planned to use fast random sources (e.g., RDRAND on
x86 and DARN on Power) to seed when the early entropy file cannot be
provided, for whatever reason.  Please see D19928.

Some better hacks may be used to make the non-random __stack_chk_guard
slightly less predictable (from delphij@ and mjg@); those suggestions are
left for a future revision.  I think it may also be plausible to move stack
guard initialization far later in the boot process; potentially it could be
moved all the way to just before userspace is started.

Reported by: many
Reviewed by: delphij, emaste, imp (all w/ caveat: this is a stopgap fix)
Security: yes
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D19927
UPDATING
sys/kern/stack_protector.c