diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-06-17 12:34:16 +0100 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-06-17 12:34:16 +0100 |
| commit | 87599bd29856ea7bfdd62591c581c8be5a4719ee (patch) | |
| tree | b923cec03ce2948444147a1424ebbc3d4b2be48e /security/selinux/hooks.c | |
| parent | 5b33fc6492a7b7a62359157db0f92f5b6e9af690 (diff) | |
| parent | f71ece9712b7712df98871eea9aeb60e49ca5239 (diff) | |
| download | linux-87599bd29856ea7bfdd62591c581c8be5a4719ee.tar.gz linux-87599bd29856ea7bfdd62591c581c8be5a4719ee.tar.bz2 linux-87599bd29856ea7bfdd62591c581c8be5a4719ee.zip | |
Merge tag 'lsm-pr-20260615' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm
Pull lsm update from Paul Moore:
"A single LSM update the security_inode_listsecurity() hook to be able
to leverage the xattr_list_one() helper function.
We wanted to do this for a while, but we needed to fixup the callers
in the NFS code first. With the NFS code changes shipping in Linux
v7.0 and no one complaining, it seemed a good time to complete the
shift"
* tag 'lsm-pr-20260615' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm:
security,fs,nfs,net: update security_inode_listsecurity() interface
Diffstat (limited to 'security/selinux/hooks.c')
| -rw-r--r-- | security/selinux/hooks.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 0f704380a8c8..1a713d96206f 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -3680,16 +3680,12 @@ static int selinux_inode_setsecurity(struct inode *inode, const char *name, return 0; } -static int selinux_inode_listsecurity(struct inode *inode, char *buffer, size_t buffer_size) +static int selinux_inode_listsecurity(struct inode *inode, char **buffer, + ssize_t *remaining_size) { - const int len = sizeof(XATTR_NAME_SELINUX); - if (!selinux_initialized()) return 0; - - if (buffer && len <= buffer_size) - memcpy(buffer, XATTR_NAME_SELINUX, len); - return len; + return xattr_list_one(buffer, remaining_size, XATTR_NAME_SELINUX); } static void selinux_inode_getlsmprop(struct inode *inode, struct lsm_prop *prop) |