Commit Graph

529 Commits

Author SHA1 Message Date
Arne Fitzenreiter
54364fac8c kernel: update riscv64 config and rootfiles
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2023-02-21 10:15:36 +00:00
Michael Tremer
39f94ee8eb Drop support for armv6l (and armv7hl)
This removes support for building IPFire for 32 bit ARM architectures.

This has been decided in August 2022 with six months notice as there are
not very many users and hardware is generally not available any more.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2023-02-10 09:26:37 +00:00
Peter Müller
1296cdc40b linux: Align kernel configurations after merging 6.1 branch
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2023-01-18 23:09:22 +00:00
Arne Fitzenreiter
3e066f550b kernel: update rootfiles and config
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2023-01-15 09:19:25 +00:00
Arne Fitzenreiter
6535255270 kernel: update to 6.1.3
the kernel-6.1.x series should be the next lts series...
2023-01-08 10:08:33 +00:00
Peter Müller
5f2d660967 linux: Align ARM rootfiles and configurations
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2023-01-05 10:11:01 +00:00
Peter Müller
f46f939827 linux: Update configuration files and x86_64 rootfile
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2023-01-04 21:26:43 +00:00
Peter Müller
6647dd5c5c linux: Disable the latent entropy plugin
It does not generate cryptographically secure entropy.

Backported from IPFire 3.x as 6aea180b26906f001611dcc0c54f494818069d8c.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Acked-by: Michael Tremer <michael.tremer@ipfire.org>
2023-01-03 16:11:56 +00:00
Peter Müller
00efe232b7 linux: Disable syscalls that allows processes to r/w other processes' memory
Backported from IPFire 3.x as 48931178ff83911c5bbc86194dea694845ae1608.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Acked-by: Michael Tremer <michael.tremer@ipfire.org>
2023-01-03 16:11:20 +00:00
Peter Müller
a5fbbcf464 linux: Disable some character devices that do not make sense
Inspired by IPFire 3.x (commit 472fb5fa6b1f77a2166407a8936fda6c8cbdb80b).

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Acked-by: Michael Tremer <michael.tremer@ipfire.org>
2023-01-03 16:10:53 +00:00
Peter Müller
440e2c2e68 linux: Disable all sorts of useless Device Mapper targets
This patch also compiles all sorts of device mapper stuff as modules.

Backported from IPFire 3.x as 6fe31a44d07d8705ca7713c449ccbb3dbb9684a0.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Acked-by: Michael Tremer <michael.tremer@ipfire.org>
2023-01-03 16:10:28 +00:00
Peter Müller
0186d8d0e1 linux: Disable ACPI configfs support
This is disabled in IPFire 3.x, and projects such as grsecurity
recommend doing so for security reasons as well. Also, skimming through
our source code, there is no point where this ACPI configfs would have
been explicitly mounted, which leads to the assumption that we never
used it anyway.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Acked-by: Michael Tremer <michael.tremer@ipfire.org>
2023-01-03 16:09:25 +00:00
Peter Müller
41d58ef4f3 linux: Enable Landlock support
From the kernel's documentation:

> Landlock is a sandboxing mechanism that enables processes to restrict
> themselves (and their future children) by gradually enforcing
> tailored access control policies. A Landlock security policy is a
> set of access rights (e.g. open a file in read-only, make a
> directory, etc.) tied to a file hierarchy. Such policy can be
> configured and enforced by any processes for themselves using the
> dedicated system calls: landlock_create_ruleset(),
> landlock_add_rule(), and landlock_restrict_self().

There is no harm in enabling this security feature, so applications
supporting Landlock can benefit from it.

Rolled forward from https://patchwork.ipfire.org/project/ipfire/patch/d7ac0caf-5a7c-bcca-6293-16c773523942@ipfire.org/
to submit all kernel-related changes as a single patchset.

Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Acked-by: Michael Tremer <michael.tremer@ipfire.org>
2023-01-03 16:09:02 +00:00
Peter Müller
7a39018219 linux: Wipe all memory when rebooting on EFI
Backported from IPFire 3.x as 49242a5661a550b370fff56f893df0983700ef32.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Acked-by: Michael Tremer <michael.tremer@ipfire.org>
2023-01-03 16:08:38 +00:00
Peter Müller
0548bad00a linux: Disable the entire PCMCIA/CardBus subsystem
Backported from IPFire 3.x as 3d9d44ddaec6b32eaa5c0fc6470ec61d23e61f92.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Acked-by: Michael Tremer <michael.tremer@ipfire.org>
2023-01-03 16:08:03 +00:00
Peter Müller
63b3a6edb3 linux: Update to 5.15.85
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2023-01-03 16:07:48 +00:00
Mathew McBride
8399123461 linux: enable options for NXP Layerscape
This change enables support for NXP's QorIQ/Layerscape platforms,
specifically the Traverse Technologies Ten64 (LS1088A).

Signed-off-by: Mathew McBride <matt@traverse.com.au>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
2022-10-04 14:45:19 +00:00
Peter Müller
16eb2d5379 linux: Enable seccomp filter on ARM
Since last time we checked, the kernel's security features on ARM have
improved notably (see CONFIG_RANDOMIZE_BASE discussion). This patch
therefore proposes to give the seccomp filter on both 32- and 64-bit ARM
another try, since it provides significant security benefit to
applications using it.

Due to operational constraints, rootfile changes have been omitted, and
will be conducted, should this patch be approved.

Note to future self: Once this patch is approved, applications using
seccomp (OpenSSH, Tor) need to be updated/shipped on ARM.

Fixes: #12366
Fixes: #12370
Cc: Arne Fitzenreiter <arne.fitzenreiter@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-10-03 21:57:47 +00:00
Peter Müller
25a3d87645 linux: Remove user-space probe support
From the kernels' documentation:

> Uprobes is the user-space counterpart to kprobes: they
> enable instrumentation applications (such as 'perf probe')
> to establish unintrusive probes in user-space binaries and
> libraries, by executing handler functions when the probes
> are hit by user-space applications.
>
> ( These probes come in the form of single-byte breakpoints,
> managed by the kernel and kept transparent to the probed
> application. )

To the best of the authors' understanding, no application on IPFire
needs this functionality, and given its abuse potential, we should
probably not enable it.

As expected, strace functionality is not impaired by this.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-10-03 16:52:09 +00:00
Peter Müller
abb185bf5a linux: Align configurations and rootfiles for ARM
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-09-21 13:36:59 +00:00
Peter Müller
d33651d74f linux: Prepare CONFIG_DEBUG_FS disabling on non-x86_64 architectures
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-09-20 14:30:28 +00:00
Peter Müller
ae185d6f9d linux: Update to 5.15.68
Please refer to https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.15.68
for the changelog of this release. Due to the lack of local build
hardware, ARM rootfile and configuration changes have been omitted.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-09-20 10:33:19 +00:00
Peter Müller
12d339e725 kernel: Disable CONFIG_DEBUG_FS
According to the kernel's documentation,

> debugfs is a virtual file system that kernel developers use to put
> debugging files into. Enable this option to be able to read and
> write to these files.

There is no legitimate reason why one has to do so on an IPFire machine.
Further, the vast debugging options (i.e. related to various drivers)
have never been enabled, limiting the use of this virtual file system
even further.

This patch therefore proposes to disable it entirely, since its
potential security impact outweights its benefits. Due to operational
constraints, changes to ARM kernel configurations will be made if this
patch is approved for x86_64.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
2022-09-20 10:33:11 +00:00
Peter Müller
fe803a3f89 Revert "linux: Enable randstruct on ARM as well"
This reverts commit f38e8a35c2.

(Thank you, Arne!)
2022-08-09 10:43:05 +00:00
Peter Müller
26a91db187 Revert "Revert "linux: Do not allow slab caches to be merged""
This reverts commit 1695af3862.

https://lists.ipfire.org/pipermail/development/2022-August/014112.html
2022-08-09 09:29:42 +00:00
Peter Müller
4865b7f6b8 Revert "Revert "kernel: update to 5.15.59""
This reverts commit f25f1b55af.
2022-08-08 13:17:30 +00:00
Peter Müller
5a18ee55e6 Revert "linux: Randomize layout of sensitive kernel structures"
This reverts commit 4c46e7f818.
2022-08-08 13:17:19 +00:00
Peter Müller
f25f1b55af Revert "kernel: update to 5.15.59"
This reverts commit 43df4a0373.
2022-08-08 10:10:35 +00:00
Peter Müller
1695af3862 Revert "linux: Do not allow slab caches to be merged"
This reverts commit 06b4164dfe.
2022-08-08 10:10:17 +00:00
Peter Müller
06b4164dfe linux: Do not allow slab caches to be merged
From the kernel documentation:

> 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. [...]

Thus, it is more sane to leave slab merging disabled. KSPP and ClipOS
recommend this as well.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Acked-by: Michael Tremer <michael.tremer@ipfire.org>
2022-08-06 13:51:02 +00:00
Arne Fitzenreiter
43df4a0373 kernel: update to 5.15.59
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
2022-08-06 07:45:02 +00:00
Peter Müller
f38e8a35c2 linux: Enable randstruct on ARM as well
My fault, again. :-/

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-08-04 12:38:01 +00:00
Peter Müller
494d2b4bf3 linux: Update ARM kernel configuration files
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-08-04 12:32:43 +00:00
Peter Müller
4c46e7f818 linux: Randomize layout of sensitive kernel structures
To quote from the kernel documentation:

> If you say Y here, the layouts of structures that are entirely
> function pointers (and have not been manually annotated with
> __no_randomize_layout), or structures that have been explicitly
> marked with __randomize_layout, will be randomized at compile-time.
> This can introduce the requirement of an additional information
> exposure vulnerability for exploits targeting these structure
> types.
>
> Enabling this feature will introduce some performance impact,
> slightly increase memory usage, and prevent the use of forensic
> tools like Volatility against the system (unless the kernel
> source tree isn't cleaned after kernel installation).
>
> The seed used for compilation is located at
> scripts/gcc-plgins/randomize_layout_seed.h. It remains after
> a make clean to allow for external modules to be compiled with
> the existing seed and will be removed by a make mrproper or
> make distclean.
>
> Note that the implementation requires gcc 4.7 or newer.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Acked-by: Michael Tremer <michael.tremer@ipfire.org>
2022-08-03 10:59:03 +00:00
Peter Müller
38a5d03f59 linux: Enable PCI passthrough for QEMU
Fixes: #12754
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
2022-08-03 10:57:05 +00:00
Peter Müller
d8d6b12403 linux: Do not enable dangerous legacy DRM drivers
https://lists.ipfire.org/pipermail/development/2022-July/013886.html

This leaves current Nvidia Nouveau support untouched.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
2022-08-03 10:55:21 +00:00
Peter Müller
7caecf45fb linux: Give CONFIG_RANDOMIZE_BASE on aarch64 another try
Quoted from https://capsule8.com/blog/kernel-configuration-glossary/:

> Significance: Critical
>
> In support of Kernel Address Space Layout Randomization (KASLR) this randomizes
> the physical address at which the kernel image is decompressed and the virtual
> address where the kernel image is mapped as a security feature that deters
> exploit attempts relying on knowledge of the location of kernel code internals.

We tried to enable this back in 2020, and failed. Since then, things
may have been improved, so let's give this low-hanging fruit another
try.

Fixes: #12363
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-08-01 10:20:20 +00:00
Peter Müller
ef3ca7d6da linux: Update kernel configuration for x86_64
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-07-30 11:03:53 +00:00
Peter Müller
5591a68c05 linux: Enable Intel DMA Remapping Devices by default on x86_64
If available, the kernel will enable IOMMU (a/k/a DMA remapping) by
default on boot. To tools making use of that, particularly hypervisors,
this provides better security without any downsides.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-07-28 13:35:20 +00:00
Peter Müller
0664b1720d linux: Amend upstream patch to harden mount points of /dev
This patch, which has been merged into the mainline Linux kernel, but
not yet backported to the 5.15.x tree, precisely addresses our
situation: IPFire does not use systemd, but CONFIG_DEVTMPFS_MOUNT.

The only explanation I have for bug #12889 arising _now_ is that some
component (dracut, maybe) changed its behaviour regarding remounting of
already mounted special file systems. As current dracut won't (re)mount
any file system already found to be mounted, this means that the mount
options decided by the kernel remained untouched for /dev, hence being
weak in terms of options hardening possible.

As CONFIG_DEVTMPFS_SAFE would not show up in "make menuconfig", changes
to kernel configurations have been simulated.

Fixes: #12889
Cc: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-06-25 22:20:48 +00:00
Peter Müller
df9ebc6bbe linux: Align kernel configurations on ARM
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-06-23 07:42:27 +00:00
Peter Müller
02882db302 kernel: Align x86_64 rootfile for kernel update
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-06-17 16:27:42 +00:00
Peter Müller
c0c8a08992 linux: Run make oldconfig for x86_64
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-06-13 20:42:07 +00:00
Peter Müller
1fad035a1f Kernel: Mitigate Straight-Line-Speculation on x86_64
See https://lwn.net/Articles/877845/ for the rationale behind this. The
feature is currently only available on the x86_64 platform.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
2022-06-13 15:39:35 +00:00
Peter Müller
883e29630c Kernel: Disable support for RPC dprintk debugging
This is solely needed for debugging of NFS issues. Due to the attack
surface it introduces, grsecurity recommends to disable it; as we do not
have a strict necessity for this feature, it is best to follow that
recommendation for security reasons.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
2022-06-13 15:39:23 +00:00
Peter Müller
9b28e9d02b Kernel: Enable YAMA support
See https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html for
the upstream rationale. Enabling YAMA gives us the benefit of additional
hardening options available, without any obvious downsides.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
2022-06-13 15:39:08 +00:00
Arne Fitzenreiter
9fa01e4276 kernel: update to 5.15.35
in kernel 5.15.32 the driver for ATH9K wlan cards is unstable.
This is one of the most used cards so we need this update before
releasing core167 final.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2022-04-22 12:48:32 +00:00
Peter Müller
250f6efc38 kernel: Do not enforce "integrity" mode of LSM
LSM was found to render firmware flashing unusable, and patching out LSM
functionality for all features needed (such as /dev/io, direct memory
access and probably raw PCI access for older cards), this would
effectively render much of LSM's functionality useless as well.

For the time being, we do ship LSM, but do not enforce any protection
mode. Users hence can run it in "integrity" or even "confidentiality"
mode by custom commands; hopefully, we will be able to revert this
change at a future point.

Acked-by: Arne Fitzenreiter <arne.fitzenreiter@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-04-21 19:30:42 +00:00
Arne Fitzenreiter
1d563665ed kernel: run make oldconfig
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2022-04-08 00:27:47 +02:00
Peter Müller
8e1a464d12 Kernel: Enable LSM support and set security level to "integrity"
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
2022-04-06 20:04:04 +00:00