From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter =?utf-8?q?M=C3=BCller?= To: development@lists.ipfire.org Subject: Re: [PATCH] sysctl: improve KASLR effectiveness for mmap Date: Thu, 04 Jul 2019 19:28:00 +0000 Message-ID: <6844e46c-3368-84bc-d116-905c1e883dc6@ipfire.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2499055073467919531==" List-Id: --===============2499055073467919531== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello Michael, > Hi, >=20 > LOL. =E2=80=9CEffectiveness=E2=80=9D of the KASLR. Do we even have this ena= bled? Yes. Words failed me here - and 8 Bits do not leave _that_ much possibilities= ... Thanks, and best regards, Peter M=C3=BCller >=20 > -Michael >=20 >> On 4 Jul 2019, at 20:15, Peter M=C3=BCller wr= ote: >> >> By feeding more random bits into mmap allocation, the >> effectiveness of KASLR will be improved, making attacks >> trying to bypass address randomisation more difficult. >> >> Changed sysctl values are: >> >> vm.mmap_rnd_bits =3D 32 (default: 28) >> vm.mmap_rnd_compat_bits =3D 16 (default: 8) >> >> Signed-off-by: Peter M=C3=BCller >> --- >> config/etc/sysctl.conf | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/config/etc/sysctl.conf b/config/etc/sysctl.conf >> index 9a943fffa..5a67f1795 100644 >> --- a/config/etc/sysctl.conf >> +++ b/config/etc/sysctl.conf >> @@ -45,6 +45,10 @@ kernel.kptr_restrict =3D 2 >> # Avoid kernel memory address exposures via dmesg. >> kernel.dmesg_restrict =3D 1 >> >> +# Improve KASLR effectiveness for mmap >> +vm.mmap_rnd_bits =3D 32 >> +vm.mmap_rnd_compat_bits =3D 16 >> + >> # Minimal preemption granularity for CPU-bound tasks: >> # (default: 1 msec# (1 + ilog(ncpus)), units: nanoseconds) >> kernel.sched_min_granularity_ns =3D 10000000 >> --=20 >> 2.16.4 >> >=20 --=20 The road to Hades is easy to travel. -- Bion of Borysthenes --===============2499055073467919531==--