armbian-build/lib/functions/compilation
Rosen Penev 65d823f343
board configs: disable unprivelaged BPF (#9082)
Fixes wrong CPU vulnerability output:

/sys/devices/system/cpu/vulnerabilities/spectre_v2:Mitigation:Vulnerable: Unprivileged eBPF enabled

It's enabled but CONFIG_BPF_UNPRIV_DEFAULT_OFF being unset causes the warning.

This warning happens on ARM32 and ARM64 devices.

Edited with:
find -name "*.config" -exec sed -i 's/# CONFIG_BPF_UNPRIV_DEFAULT_OFF is not set/CONFIG_BPF_UNPRIV_DEFAULT_OFF=y/g' '{}' ;

CONFIG_BPF_UNPRIV_DEFAULT_OFF is a Linux kernel build-time hardening option that disables unprivileged use of the bpf() syscall (and thus unprivileged eBPF loading) by default by setting kernel.unprivileged_bpf_disabled=2 at boot. With this default, only privileged processes (e.g., with CAP_SYS_ADMIN / CAP_BPF, depending on kernel) can load eBPF unless an administrator explicitly relaxes it. [1], [2]
Operational behavior you should know

kernel.unprivileged_bpf_disabled semantics (as documented in the kernel sysctl docs/patch):

    0: unprivileged bpf() allowed
    1: unprivileged bpf() blocked and cannot be re-enabled until reboot (no transition back to 0 while running)
    2: unprivileged bpf() blocked but admin can later switch to 0 or 1 if needed
    If CONFIG_BPF_UNPRIV_DEFAULT_OFF=y, the default becomes 2 instead of 0. [2]

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2026-02-08 14:33:35 -05:00
..
packages chore: update copyright years to 2026 2025-12-25 12:03:34 +01:00
patch uwe5622: fix compilation with clang on Linux 6.19 (#9314) 2026-01-31 13:51:07 +01:00
armbian-kernel.sh board configs: disable unprivelaged BPF (#9082) 2026-02-08 14:33:35 -05:00
atf.sh drop find_toolchains, SKIP_EXTERNAL_TOOLCHAINS and all $toolchain PATH injections 2026-01-14 20:08:21 +01:00
ccache.sh chore: update copyright years to 2026 2025-12-25 12:03:34 +01:00
crust.sh drop find_toolchains, SKIP_EXTERNAL_TOOLCHAINS and all $toolchain PATH injections 2026-01-14 20:08:21 +01:00
distcc.sh chore: update copyright years to 2026 2025-12-25 12:03:34 +01:00
kernel-config.sh chore: update copyright years to 2026 2025-12-25 12:03:34 +01:00
kernel-debs.sh Fix "modpost not foud" error since error in rust coreutils uutils/coreutils#8924 2026-01-22 12:25:08 +01:00
kernel-dts-check.sh chore: update copyright years to 2026 2025-12-25 12:03:34 +01:00
kernel-git-bundle.sh chore: update copyright years to 2026 2025-12-25 12:03:34 +01:00
kernel-git-oras.sh chore: update copyright years to 2026 2025-12-25 12:03:34 +01:00
kernel-git.sh chore: update copyright years to 2026 2025-12-25 12:03:34 +01:00
kernel-make.sh clang: enable colored diagnostic output for kernel compilation 2026-01-31 17:12:25 +01:00
kernel-patching.sh chore: update copyright years to 2026 2025-12-25 12:03:34 +01:00
kernel.sh cli: kernel-dtb: check dtc for version 1.7.2 before producing normalized dts 2026-01-25 11:36:34 +01:00
uboot-git.sh chore: update copyright years to 2026 2025-12-25 12:03:34 +01:00
uboot-patching.sh chore: update copyright years to 2026 2025-12-25 12:03:34 +01:00
uboot.sh u-boot: fix and unify CROSS_COMPILE and PATH after predatory maintenance 2026-01-14 20:08:21 +01:00
utils-compilation.sh drop find_toolchains, SKIP_EXTERNAL_TOOLCHAINS and all $toolchain PATH injections 2026-01-14 20:08:21 +01:00