diff options
author | Roberto Sassu <roberto.sassu@huawei.com> | 2023-03-31 15:32:18 +0300 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2023-04-04 21:26:26 +0300 |
commit | d82dcd9e21b77d338dc4875f3d4111f0db314a7c (patch) | |
tree | 06ff2c4cda2f45077c96f445939735275401e9ce /Documentation/powerpc/vcpudispatch_stats.rst | |
parent | 0d57b970df352517a75f4533820c49de360c4123 (diff) | |
download | linux-d82dcd9e21b77d338dc4875f3d4111f0db314a7c.tar.xz |
reiserfs: Add security prefix to xattr name in reiserfs_security_write()
Reiserfs sets a security xattr at inode creation time in two stages: first,
it calls reiserfs_security_init() to obtain the xattr from active LSMs;
then, it calls reiserfs_security_write() to actually write that xattr.
Unfortunately, it seems there is a wrong expectation that LSMs provide the
full xattr name in the form 'security.<suffix>'. However, LSMs always
provided just the suffix, causing reiserfs to not write the xattr at all
(if the suffix is shorter than the prefix), or to write an xattr with the
wrong name.
Add a temporary buffer in reiserfs_security_write(), and write to it the
full xattr name, before passing it to reiserfs_xattr_set_handle().
Also replace the name length check with a check that the full xattr name is
not larger than XATTR_NAME_MAX.
Cc: stable@vger.kernel.org # v2.6.x
Fixes: 57fe60df6241 ("reiserfs: add atomic addition of selinux attributes during inode creation")
Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'Documentation/powerpc/vcpudispatch_stats.rst')
0 files changed, 0 insertions, 0 deletions