mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-01 10:42:11 +00:00
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: 52ca4b6435
("reiserfs: Switch to security_inode_init_security()")
Signed-off-by: Paul Moore <paul@paul-moore.com>
This commit is contained in:
parent
a495108ea9
commit
d031f4e8b4
@ -67,6 +67,7 @@ int reiserfs_security_init(struct inode *dir, struct inode *inode,
|
||||
|
||||
sec->name = NULL;
|
||||
sec->value = NULL;
|
||||
sec->length = 0;
|
||||
|
||||
/* Don't add selinux attributes on xattrs - they'll never get used */
|
||||
if (IS_PRIVATE(dir))
|
||||
|
Loading…
Reference in New Issue
Block a user