Skip to content

Commit d031f4e

Browse files
Tetsuo Handapcmoore
authored andcommitted
reiserfs: Initialize sec->length in reiserfs_security_init().
syzbot is reporting that sec->length is not initialized. Since security_inode_init_security() returns 0 when initxattrs is provided but call_int_hook(inode_init_security) returned -EOPNOTSUPP, control will reach to "if (sec->length && ...) {" without initializing sec->length. Reported-by: syzbot <syzbot+00a3779539a23cbee38c@syzkaller.appspotmail.com> Closes: https://syzkaller.appspot.com/bug?extid=00a3779539a23cbee38c Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Fixes: 52ca4b6 ("reiserfs: Switch to security_inode_init_security()") Signed-off-by: Paul Moore <paul@paul-moore.com>
1 parent a495108 commit d031f4e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

fs/reiserfs/xattr_security.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ int reiserfs_security_init(struct inode *dir, struct inode *inode,
6767

6868
sec->name = NULL;
6969
sec->value = NULL;
70+
sec->length = 0;
7071

7172
/* Don't add selinux attributes on xattrs - they'll never get used */
7273
if (IS_PRIVATE(dir))

0 commit comments

Comments
 (0)