mac: kern.nx is not present in 10.14.5 et seq, but NX is always enabled

This updates the comment from d3859d91fde0, which referred to 10.14.4 as
the OS version where kern.nx stoppoed working. Testing indicates that
kern.nx works in 10.13.6 17G12034 and 10.14.4 18E226. It does not work
in 10.14.5 18F132 or 10.15.4 19E266.

Bug: crashpad:295
Change-Id: Id2f222700fb626de707d60980fedbd79e62990e6
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2127566
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Mark Mentovai 2020-03-30 11:48:38 -04:00 committed by Commit Bot
parent af62d7fcf6
commit 61a4f3d7d6

View File

@ -350,12 +350,12 @@ bool SystemSnapshotMac::NXEnabled() const {
if (ReadIntSysctlByName_NoLog("kern.nx", &value) != 0) {
{
// Support for the kern.nx sysctlbyname is compiled out of production
// kernels on macOS 10.14.4 and later, although its available in
// kernels on macOS 10.14.5 and later, although its available in
// development and debug kernels. Compare 10.14.3
// xnu-4903.241.1/bsd/kern/kern_sysctl.c to 10.15.0
// xnu-6153.11.26/bsd/kern/kern_sysctl.c (10.14.4 xnu source is not yet
// available). In newer production kernels, NX is always enabled. See
// 10.15.0 xnu-6153.11.26/osfmk/x86_64/pmap.c nx_enabled.
// xnu-6153.11.26/bsd/kern/kern_sysctl.c (10.14.4 and 10.14.5 xnu source
// are not yet available). In newer production kernels, NX is always
// enabled. See 10.15.0 xnu-6153.11.26/osfmk/x86_64/pmap.c nx_enabled.
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_14
const bool nx_always_enabled = true;
#else // DT >= 10.14