From 8dc51459ef702bcc0ef5fb26bb4d362b38aa56c2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20G=C3=B6ttsche?= Date: Mon, 2 Feb 2026 14:48:03 +0100 Subject: [PATCH] selinux: annotate intentional data race in inode_doinit_with_dentry() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Like other `isec->initialized == LABEL_INITIALIZED` checks annotate the check in inode_doinit_with_dentry() with data_race to please KCSAN. The value is rechecked next with lock held. Reported-by: syzbot+9ab96b38b76bec93939a@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=9ab96b38b76bec93939a Signed-off-by: Christian Göttsche Signed-off-by: Paul Moore --- security/selinux/hooks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index d8224ea113d1a..6ef9c1aade65f 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -1436,7 +1436,8 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent struct dentry *dentry; int rc = 0; - if (isec->initialized == LABEL_INITIALIZED) + /* check below is racy, but we will recheck with lock held */ + if (data_race(isec->initialized == LABEL_INITIALIZED)) return 0; spin_lock(&isec->lock); -- 2.47.3