lsm: replace context+len with lsm_context
authorCasey Schaufler <casey@schaufler-ca.com>
Wed, 23 Oct 2024 21:21:55 +0000 (14:21 -0700)
committerPaul Moore <paul@paul-moore.com>
Wed, 4 Dec 2024 19:42:31 +0000 (14:42 -0500)
commit2d470c778120d3cdb8d8ab250329ca85f49f12b1
tree9796bb2460bd31563d4993b32f47fec7c80fad86
parent6fba89813ccf333d2bc4d5caea04cd5f3c39eb50
lsm: replace context+len with lsm_context

Replace the (secctx,seclen) pointer pair with a single
lsm_context pointer to allow return of the LSM identifier
along with the context and context length. This allows
security_release_secctx() to know how to release the
context. Callers have been modified to use or save the
returned data from the new structure.

security_secid_to_secctx() and security_lsmproc_to_secctx()
will now return the length value on success instead of 0.

Cc: netdev@vger.kernel.org
Cc: audit@vger.kernel.org
Cc: netfilter-devel@vger.kernel.org
Cc: Todd Kjos <tkjos@google.com>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
[PM: subject tweak, kdoc fix, signedness fix from Dan Carpenter]
Signed-off-by: Paul Moore <paul@paul-moore.com>
17 files changed:
drivers/android/binder.c
include/linux/lsm_hook_defs.h
include/linux/security.h
include/net/scm.h
kernel/audit.c
kernel/auditsc.c
net/ipv4/ip_sockglue.c
net/netfilter/nf_conntrack_netlink.c
net/netfilter/nf_conntrack_standalone.c
net/netfilter/nfnetlink_queue.c
net/netlabel/netlabel_unlabeled.c
net/netlabel/netlabel_user.c
security/apparmor/include/secid.h
security/apparmor/secid.c
security/security.c
security/selinux/hooks.c
security/smack/smack_lsm.c