diff mbox series

[I/U] UBUNTU: [Config] mark CONFIG_BPF_UNPRIV_DEFAULT_OFF enforced

Message ID 20210901174435.497412-1-cascardo@canonical.com
State New
Headers show
Series [I/U] UBUNTU: [Config] mark CONFIG_BPF_UNPRIV_DEFAULT_OFF enforced | expand

Commit Message

Thadeu Lima de Souza Cascardo Sept. 1, 2021, 5:44 p.m. UTC
Setting unprivileged_bpf_disabled to 2 by default will prevent attacks
using BPF by unprivileged users by default. If necessary, the sysadmin will
be able to turn this on again by setting unprivileged_bpf_disabled to 0. On
the other hand, the sysadmin can disable unprivileged BPF without allowing
it to be reenabled by setting unprivileged_bpf_disabled to 1.

Additionaly, there is a CAP_BPF that allows processes to use BPF without
having the complete capability set or CAP_SYS_ADMIN.

Mark the option as enforced so derivative kernels will pick it up.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
---
 debian.master/config/annotations | 1 +
 1 file changed, 1 insertion(+)

Comments

Colin Ian King Sept. 1, 2021, 6:02 p.m. UTC | #1
On 01/09/2021 18:44, Thadeu Lima de Souza Cascardo wrote:
> Setting unprivileged_bpf_disabled to 2 by default will prevent attacks
> using BPF by unprivileged users by default. If necessary, the sysadmin will
> be able to turn this on again by setting unprivileged_bpf_disabled to 0. On
> the other hand, the sysadmin can disable unprivileged BPF without allowing
> it to be reenabled by setting unprivileged_bpf_disabled to 1.
> 
> Additionaly, there is a CAP_BPF that allows processes to use BPF without
> having the complete capability set or CAP_SYS_ADMIN.
> 
> Mark the option as enforced so derivative kernels will pick it up.
> 
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
> ---
>  debian.master/config/annotations | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/debian.master/config/annotations b/debian.master/config/annotations
> index f1435df44bdd..f3450201abc2 100644
> --- a/debian.master/config/annotations
> +++ b/debian.master/config/annotations
> @@ -11044,6 +11044,7 @@ CONFIG_BPF_UNPRIV_DEFAULT_OFF                   policy<{'amd64': 'y', 'arm64': '
>  CONFIG_BPF_JIT                                  policy<{'amd64': 'y', 'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y', 's390x': 'y'}>
>  #
>  CONFIG_BPF_JIT_ALWAYS_ON                        flag<REVIEW>
> +CONFIG_BPF_UNPRIV_DEFAULT_OFF                   mark<ENFORCED> note<security reason>
>  
>  # Menu: General setup >> BPF subsystem >> Preload BPF file system with kernel specific program and map iterators
>  CONFIG_BPF_PRELOAD                              policy<{'amd64': 'n', 'arm64': 'n', 'armhf': 'n', 'ppc64el': 'n', 's390x': 'n'}>
> 

Acked-by: Colin Ian King <colin.king@canonical.com>
Tim Gardner Sept. 1, 2021, 6:04 p.m. UTC | #2
Acked-by: Tim Gardner <tim.gardner@canonical.com>

On 9/1/21 11:44 AM, Thadeu Lima de Souza Cascardo wrote:
> Setting unprivileged_bpf_disabled to 2 by default will prevent attacks
> using BPF by unprivileged users by default. If necessary, the sysadmin will
> be able to turn this on again by setting unprivileged_bpf_disabled to 0. On
> the other hand, the sysadmin can disable unprivileged BPF without allowing
> it to be reenabled by setting unprivileged_bpf_disabled to 1.
> 
> Additionaly, there is a CAP_BPF that allows processes to use BPF without
> having the complete capability set or CAP_SYS_ADMIN.
> 
> Mark the option as enforced so derivative kernels will pick it up.
> 
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
> ---
>   debian.master/config/annotations | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/debian.master/config/annotations b/debian.master/config/annotations
> index f1435df44bdd..f3450201abc2 100644
> --- a/debian.master/config/annotations
> +++ b/debian.master/config/annotations
> @@ -11044,6 +11044,7 @@ CONFIG_BPF_UNPRIV_DEFAULT_OFF                   policy<{'amd64': 'y', 'arm64': '
>   CONFIG_BPF_JIT                                  policy<{'amd64': 'y', 'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y', 's390x': 'y'}>
>   #
>   CONFIG_BPF_JIT_ALWAYS_ON                        flag<REVIEW>
> +CONFIG_BPF_UNPRIV_DEFAULT_OFF                   mark<ENFORCED> note<security reason>
>   
>   # Menu: General setup >> BPF subsystem >> Preload BPF file system with kernel specific program and map iterators
>   CONFIG_BPF_PRELOAD                              policy<{'amd64': 'n', 'arm64': 'n', 'armhf': 'n', 'ppc64el': 'n', 's390x': 'n'}>
>
Paolo Pisati Sept. 9, 2021, 9:35 a.m. UTC | #3
On Wed, Sep 01, 2021 at 02:44:35PM -0300, Thadeu Lima de Souza Cascardo wrote:
> Setting unprivileged_bpf_disabled to 2 by default will prevent attacks
> using BPF by unprivileged users by default. If necessary, the sysadmin will
> be able to turn this on again by setting unprivileged_bpf_disabled to 0. On
> the other hand, the sysadmin can disable unprivileged BPF without allowing
> it to be reenabled by setting unprivileged_bpf_disabled to 1.
> 
> Additionaly, there is a CAP_BPF that allows processes to use BPF without
> having the complete capability set or CAP_SYS_ADMIN.
> 
> Mark the option as enforced so derivative kernels will pick it up.
> 
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
diff mbox series

Patch

diff --git a/debian.master/config/annotations b/debian.master/config/annotations
index f1435df44bdd..f3450201abc2 100644
--- a/debian.master/config/annotations
+++ b/debian.master/config/annotations
@@ -11044,6 +11044,7 @@  CONFIG_BPF_UNPRIV_DEFAULT_OFF                   policy<{'amd64': 'y', 'arm64': '
 CONFIG_BPF_JIT                                  policy<{'amd64': 'y', 'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y', 's390x': 'y'}>
 #
 CONFIG_BPF_JIT_ALWAYS_ON                        flag<REVIEW>
+CONFIG_BPF_UNPRIV_DEFAULT_OFF                   mark<ENFORCED> note<security reason>
 
 # Menu: General setup >> BPF subsystem >> Preload BPF file system with kernel specific program and map iterators
 CONFIG_BPF_PRELOAD                              policy<{'amd64': 'n', 'arm64': 'n', 'armhf': 'n', 'ppc64el': 'n', 's390x': 'n'}>