summaryrefslogtreecommitdiff
path: root/include/linux/zstd_errors.h
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2026-10-29 17:40:57 +0100
committerChristian Brauner <brauner@kernel.org>2026-11-11 12:26:07 +0100
commitea8c4b37b8809da104c4a871bb81d20465bf67b2 (patch)
tree6e0d0b0727b9332b32b3115f29c6f4f52db9eb0f /include/linux/zstd_errors.h
parent256fc12b1c95dae30109697efdc9d5bacf1a0aa5 (diff)
bpf: don't mark namespace_init and namespace_free arguments as trusted
The bpf LSM marks the arguments of all hooks as trusted unless the hook is listed in untrusted_lsm_hooks. That list was added in commit c0c852dd1876 ("bpf: Do not mark certain LSM hook arguments as trusted") for hooks that are called on objects that are only partially set up or that are already on their way out. The namespace_init and namespace_free hooks are exactly that but they aren't listed. namespace_init is called from __ns_common_init() before the namespace has been set up. It isn't in the namespace trees yet and for all types but network namespaces even the owning user namespace isn't set yet. If any LSM rejects the namespace or if anything after ns_common_init() fails the namespace is freed right away without looking at its reference count. namespace_free is called from __ns_common_free() when the namespace is torn down or when its initialization failed. Currently there's no kfunc that takes a namespace. But once there is one, e.g., for namespace local storage, a program could take a reference to or create storage on a namespace that is about to be freed. So don't mark the arguments of these hooks as trusted. namespace_install is called with a reference to a fully set up namespace and stays trusted. Fixes: f675d2e95569 ("lsm: add LSM blob and hooks for namespaces") Cc: stable@kernel.org # mainline only Acked-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Tested-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://patch.msgid.link/20261029-work-security-namespace_free-v2-2-65591dbba7b3@kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Diffstat (limited to 'include/linux/zstd_errors.h')
0 files changed, 0 insertions, 0 deletions