From a31f5b09e39e5a964457b0a52aa9c437a0bf7f63 Mon Sep 17 00:00:00 2001 From: Roberto Sassu Date: Fri, 2 Jun 2023 10:10:28 +0200 Subject: [PATCH] reiserfs: Disable security xattr initialization since it never worked Commit d82dcd9e21b7 ("reiserfs: Add security prefix to xattr name in reiserfs_security_write()"), while fixed the security xattr initialization, it also revealed a circular locking dependency between the reiserfs write lock and the inode lock. Since the bug in security xattr initialization was introduced since the beginning, there cannot be any user of this feature. Instead of trying to fix the locking dependency, which was already challenging to convert from BLK, just disable the feature. However, still keep the security xattr handler, since it was introduced earlier, and users might have manually added xattrs. Reported-by: syzbot+8fb64a61fdd96b50f3b8@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=8fb64a61fdd96b50f3b8 Suggested-by: Jeff Mahoney Signed-off-by: Roberto Sassu --- fs/reiserfs/super.c | 2 ++ fs/reiserfs/xattr_security.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 929acce6e73..262041b87cd 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c @@ -1654,6 +1654,8 @@ static int read_super_block(struct super_block *s, int offset) reiserfs_warning(NULL, "", "reiserfs filesystem is deprecated and " "scheduled to be removed from the kernel in 2025"); + reiserfs_warning(NULL, "", "initializing security xattrs never worked, disable it"); + SB_BUFFER_WITH_SB(s) = bh; SB_DISK_SUPER_BLOCK(s) = rs; diff --git a/fs/reiserfs/xattr_security.c b/fs/reiserfs/xattr_security.c index 078dd8cc312..4037a998dbf 100644 --- a/fs/reiserfs/xattr_security.c +++ b/fs/reiserfs/xattr_security.c @@ -69,6 +69,9 @@ int reiserfs_security_init(struct inode *dir, struct inode *inode, sec->value = NULL; sec->length = 0; + /* See warning in read_super_block(). */ + return 0; + /* Don't add selinux attributes on xattrs - they'll never get used */ if (IS_PRIVATE(dir)) return 0; -- 2.25.1