diff options
author | Casey Schaufler <casey@schaufler-ca.com> | 2024-10-24 00:21:54 +0300 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2024-12-04 18:46:26 +0300 |
commit | 6fba89813ccf333d2bc4d5caea04cd5f3c39eb50 (patch) | |
tree | b81fee3690bd96f7009b49f7dca8f4a33bc11f01 /rust/helpers/security.c | |
parent | 40384c840ea1944d7c5a392e8975ed088ecf0b37 (diff) | |
download | linux-6fba89813ccf333d2bc4d5caea04cd5f3c39eb50.tar.xz |
lsm: ensure the correct LSM context releaser
Add a new lsm_context data structure to hold all the information about a
"security context", including the string, its size and which LSM allocated
the string. The allocation information is necessary because LSMs have
different policies regarding the lifecycle of these strings. SELinux
allocates and destroys them on each use, whereas Smack provides a pointer
to an entry in a list that never goes away.
Update security_release_secctx() to use the lsm_context instead of a
(char *, len) pair. Change its callers to do likewise. The LSMs
supporting this hook have had comments added to remind the developer
that there is more work to be done.
The BPF security module provides all LSM hooks. While there has yet to
be a known instance of a BPF configuration that uses security contexts,
the possibility is real. In the existing implementation there is
potential for multiple frees in that case.
Cc: linux-integrity@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: audit@vger.kernel.org
Cc: netfilter-devel@vger.kernel.org
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: linux-nfs@vger.kernel.org
Cc: Todd Kjos <tkjos@google.com>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
[PM: subject tweak]
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'rust/helpers/security.c')
0 files changed, 0 insertions, 0 deletions