From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: [PATCH] linux: Do not allow slab caches to be merged Date: Sat, 06 Aug 2022 13:05:28 +0100 Message-ID: In-Reply-To: <2923c885-66ee-13a8-6197-c67ace8e7853@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6072963999581486374==" List-Id: --===============6072963999581486374== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello, Yes, please turn it on. It will protect other processes from being exploited = by an attacker who gained access to the system. Acked-by: Michael Tremer -Michael > On 6 Aug 2022, at 09:00, Peter M=C3=BCller wro= te: >=20 > Hello *, >=20 > any vetoes / endorsements of this? :-) >=20 > Thanks, and best regards, > Peter M=C3=BCller >=20 >> From the kernel documentation: >>=20 >>> For reduced kernel memory fragmentation, slab caches can be >>> merged when they share the same size and other characteristics. >>> This carries a risk of kernel heap overflows being able to >>> overwrite objects from merged caches (and more easily control >>> cache layout), which makes such heap attacks easier to exploit >>> by attackers. By keeping caches unmerged, these kinds of exploits >>> can usually only damage objects in the same cache. [...] >>=20 >> Thus, it is more sane to leave slab merging disabled. KSPP and ClipOS >> recommend this as well. >>=20 >> Signed-off-by: Peter M=C3=BCller >> --- >> config/kernel/kernel.config.aarch64-ipfire | 2 +- >> config/kernel/kernel.config.armv6l-ipfire | 2 +- >> config/kernel/kernel.config.riscv64-ipfire | 2 +- >> config/kernel/kernel.config.x86_64-ipfire | 2 +- >> 4 files changed, 4 insertions(+), 4 deletions(-) >>=20 >> diff --git a/config/kernel/kernel.config.aarch64-ipfire b/config/kernel/ke= rnel.config.aarch64-ipfire >> index 9232335ff..023c3d5aa 100644 >> --- a/config/kernel/kernel.config.aarch64-ipfire >> +++ b/config/kernel/kernel.config.aarch64-ipfire >> @@ -247,7 +247,7 @@ CONFIG_VM_EVENT_COUNTERS=3Dy >> # CONFIG_SLAB is not set >> CONFIG_SLUB=3Dy >> # CONFIG_SLOB is not set >> -CONFIG_SLAB_MERGE_DEFAULT=3Dy >> +# CONFIG_SLAB_MERGE_DEFAULT is not set >> CONFIG_SLAB_FREELIST_RANDOM=3Dy >> CONFIG_SLAB_FREELIST_HARDENED=3Dy >> CONFIG_SHUFFLE_PAGE_ALLOCATOR=3Dy >> diff --git a/config/kernel/kernel.config.armv6l-ipfire b/config/kernel/ker= nel.config.armv6l-ipfire >> index dc0aee51b..b4587826e 100644 >> --- a/config/kernel/kernel.config.armv6l-ipfire >> +++ b/config/kernel/kernel.config.armv6l-ipfire >> @@ -250,7 +250,7 @@ CONFIG_VM_EVENT_COUNTERS=3Dy >> # CONFIG_SLAB is not set >> CONFIG_SLUB=3Dy >> # CONFIG_SLOB is not set >> -CONFIG_SLAB_MERGE_DEFAULT=3Dy >> +# CONFIG_SLAB_MERGE_DEFAULT is not set >> CONFIG_SLAB_FREELIST_RANDOM=3Dy >> CONFIG_SLAB_FREELIST_HARDENED=3Dy >> CONFIG_SHUFFLE_PAGE_ALLOCATOR=3Dy >> diff --git a/config/kernel/kernel.config.riscv64-ipfire b/config/kernel/ke= rnel.config.riscv64-ipfire >> index 0801f4389..fb7cda4dd 100644 >> --- a/config/kernel/kernel.config.riscv64-ipfire >> +++ b/config/kernel/kernel.config.riscv64-ipfire >> @@ -230,7 +230,7 @@ CONFIG_VM_EVENT_COUNTERS=3Dy >> # CONFIG_SLAB is not set >> CONFIG_SLUB=3Dy >> # CONFIG_SLOB is not set >> -CONFIG_SLAB_MERGE_DEFAULT=3Dy >> +# CONFIG_SLAB_MERGE_DEFAULT is not set >> CONFIG_SLAB_FREELIST_RANDOM=3Dy >> CONFIG_SLAB_FREELIST_HARDENED=3Dy >> CONFIG_SHUFFLE_PAGE_ALLOCATOR=3Dy >> diff --git a/config/kernel/kernel.config.x86_64-ipfire b/config/kernel/ker= nel.config.x86_64-ipfire >> index 40975b5fc..d3792cbb7 100644 >> --- a/config/kernel/kernel.config.x86_64-ipfire >> +++ b/config/kernel/kernel.config.x86_64-ipfire >> @@ -270,7 +270,7 @@ CONFIG_VM_EVENT_COUNTERS=3Dy >> # CONFIG_SLAB is not set >> CONFIG_SLUB=3Dy >> # CONFIG_SLOB is not set >> -CONFIG_SLAB_MERGE_DEFAULT=3Dy >> +# CONFIG_SLAB_MERGE_DEFAULT is not set >> CONFIG_SLAB_FREELIST_RANDOM=3Dy >> CONFIG_SLAB_FREELIST_HARDENED=3Dy >> CONFIG_SHUFFLE_PAGE_ALLOCATOR=3Dy --===============6072963999581486374==--