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] linux: Do not allow slab caches to be merged Date: Sat, 06 Aug 2022 08:00:01 +0000 Message-ID: <2923c885-66ee-13a8-6197-c67ace8e7853@ipfire.org> In-Reply-To: <8bb7718c-1f3b-1882-c081-4b3d31dcda9f@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6574765159153633995==" List-Id: --===============6574765159153633995== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello *, any vetoes / endorsements of this? :-) Thanks, and best regards, Peter M=C3=BCller > 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/ker= nel.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/kern= el.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/ker= nel.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/kern= el.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 --===============6574765159153633995==--