Commit Graph

513 Commits

Author SHA1 Message Date
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
Peter Müller
11925d6f9f Kernel: Enable SVA support for both Intel and AMD CPUs
Since running virtual machines is one of our legitimate use cases, it
makes sense to provide Qemu with the ability of taking advantage of
IOMMU support for safer virtuall memory allocation, if available.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Acked-by: Michael Tremer <michael.tremer@ipfire.org>
2022-04-04 19:59:46 +00:00
Peter Müller
4f4422cc1c Kernel: Do not automatically load TTY line disciplines, only if necessary
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-04-04 19:59:39 +00:00
Peter Müller
bf2d8cb8a0 Kernel: Disable support for tracing block I/O actions
This is not needed on IPFire systems, and grsecurity recommends to turn
this off.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
2022-04-04 19:59:15 +00:00
Peter Müller
26ca63592d Kernel: Set CONFIG_ARCH_MMAP_RND_BITS to 32 bits
This follows a recommendation by ClipOS, making ASLR bypassing attempts
harder.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
2022-04-04 19:59:08 +00:00
Michael Tremer
5c1a1094ed kernel: Add a basic configuration for riscv64
This kernel configuration is a copy of our kernel configuration for
x86_64 on which I ran "make olddefconfig" which will set any unknown
values to their defaults.

This exists so that we have some kernel (which I did not try to boot) to
complete the build process.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-02-22 19:41:39 +00:00
Arne Fitzenreiter
f978b433e6 kernel: aarch64: enable armv8 optimized crypto
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2022-02-11 17:36:01 +00:00
Arne Fitzenreiter
59ec91c171 kernel: update to 5.15.22
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2022-02-09 12:17:53 +00:00
Arne Fitzenreiter
70c57ed33e kernel: update to 5.15.21
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2022-02-06 14:09:43 +00:00
Arne Fitzenreiter
d68f875d61 kernel: enable support for compressed firmwares
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2022-01-28 14:44:03 +00:00
Arne Fitzenreiter
e385c965fa kernel: aarch64 enable KVM support
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2022-01-28 11:24:44 +00:00
Arne Fitzenreiter
c18dda556b kernel: update to 5.15.16
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2022-01-21 10:06:22 +00:00
Michael Tremer
6cf219c427 Drop support for i586
This patch removes support for i586 according to the decision being
taken over a year ago.

It removes the architecture from the build system and removes all
required hacks and other quirks that have been necessary before.

There is no need to ship any changed files to the remaining
architectures as the removed code branches have not been used.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-12-04 23:27:26 +01:00
Arne Fitzenreiter
65067248d1 kernel: update to 5.15.6
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-12-02 11:34:38 +01:00
Arne Fitzenreiter
ef972dcf7a kernel: update arm config and rootfile (oldconfig)
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-11-29 09:14:33 +00:00
Arne Fitzenreiter
d4a6dc4270 kernel: update to 5.15.3
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-11-21 10:56:26 +00:00
Arne Fitzenreiter
521e8aa99d kernel: aarch64 enable ath5k wlan driver
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-11-20 23:38:06 +00:00