diff options
| author | Mark Brown <broonie@kernel.org> | 2026-05-29 22:43:00 +0100 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-05-29 22:43:00 +0100 |
| commit | c6c23350fbf64731e47f4d1576ac2ba6c03b1ed5 (patch) | |
| tree | ec124a98ce774bf0bc31f9c73359122d65ed06e9 /fs | |
| parent | e114941bfd16ae83f7075511371dad18aa62ad73 (diff) | |
| parent | c67f6e6d2c141f202211fa9fea844f577eb233a8 (diff) | |
| download | linux-next-history-c6c23350fbf64731e47f4d1576ac2ba6c03b1ed5.tar.gz | |
Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm.git
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/nfs/nfs4proc.c | 7 | ||||
| -rw-r--r-- | fs/xattr.c | 11 |
2 files changed, 9 insertions, 9 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 0715a6745d1fa..c48281db38689 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -10564,13 +10564,10 @@ static ssize_t nfs4_listxattr(struct dentry *dentry, char *list, size_t size) left -= error; } - error2 = security_inode_listsecurity(d_inode(dentry), list, left); + error2 = security_inode_listsecurity(d_inode(dentry), &list, &left); if (error2 < 0) return error2; - if (list) { - list += error2; - left -= error2; - } + error2 = size - error - left; error3 = nfs4_listxattr_nfs4_user(d_inode(dentry), list, left); if (error3 < 0) diff --git a/fs/xattr.c b/fs/xattr.c index efdcf2a485857..46f5ef9f27ad3 100644 --- a/fs/xattr.c +++ b/fs/xattr.c @@ -510,9 +510,12 @@ vfs_listxattr(struct dentry *dentry, char *list, size_t size) if (inode->i_op->listxattr) { error = inode->i_op->listxattr(dentry, list, size); } else { - error = security_inode_listsecurity(inode, list, size); - if (size && error > size) - error = -ERANGE; + ssize_t remaining = size; + + error = security_inode_listsecurity(inode, &list, &remaining); + if (error) + return error; + error = size - remaining; } return error; } @@ -1540,7 +1543,7 @@ ssize_t simple_xattr_list(struct inode *inode, struct simple_xattrs *xattrs, if (err) return err; - err = security_inode_listsecurity(inode, buffer, remaining_size); + err = security_inode_listsecurity(inode, &buffer, &remaining_size); if (err < 0) return err; |
