diff options
| author | Eric Biggers <ebiggers@kernel.org> | 2026-06-22 16:48:03 -0700 |
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2026-07-05 13:27:15 +0800 |
| commit | 2f204fe718f5bf519013cc2536ad7bb2cbb51661 (patch) | |
| tree | 1bc90d994eb90f94aff90aae59b3a01e4a50db33 /drivers | |
| parent | 7e28b0a5c4b7d075b98ce6d8f5290a9d3deb5b92 (diff) | |
| download | linux-next-2f204fe718f5bf519013cc2536ad7bb2cbb51661.tar.gz linux-next-2f204fe718f5bf519013cc2536ad7bb2cbb51661.zip | |
crypto: af_alg - Add af_alg_restrict sysctl, defaulting to 1
AF_ALG is a frequent source of vulnerabilities and a maintenance
nightmare. It exposes far more functionality to userspace than ever
should have been exposed, especially to unprivileged processes. Recent
exploits have targeted kernel internal implementation details like
"authencesn" that have zero use case for userspace access.
Fortunately, AF_ALG is rarely used in practice, as userspace crypto
libraries exist. And when it is used, only some functionality is known
to be used, and many users are known to hold capabilities already.
iwd for example requires CAP_NET_ADMIN and has a known algorithm list
(https://lore.kernel.org/linux-crypto/bcbbef00-5881-421b-8892-7be6c04b832d@gmail.com/).
Thus, let's restrict the set of allowed algorithms by default, depending
on the capabilities held.
Add a sysctl /proc/sys/crypto/af_alg_restrict with meaning:
0: unrestricted
1: limited functionality
2: completely disabled
Set the default value to 1, which enables an algorithm allowlist for
unprivileged processes and a slightly longer allowlist for privileged
processes.
Note that the list may be tweaked in the future. However, the common
use cases such as iwd and bluez are taken into account already. I've
tested that iwd still works with the default value of 1.
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers')
0 files changed, 0 insertions, 0 deletions
