From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796235416; b=0QBlnQBsays3Cc9UpL4JIPeXIQyNgiX4U15n33VlDN7LGF9uY8v45VPs3KirwGXfaPO0 qS4oT91Va+q+sKQeTcwcbFwfPkJrxe83H4lrm8fNm7Hn6YhAgIpdDL2tfZ9XNEx4Rnj2o c0E6Z2hlb9vAWLrRy4HoQQx2BTzSX+ah9lnMf53B3KA6+zqwIj8vkgCJdNeqEs/X6LGDc 7t8AZ7zvhmq5QxvBIuTci9/32mhhOr3oiPkHHCFmf00I1Mb8i0wG/RCPS/P9mcu93gBJO /uN6wuV9Fncc1iX+nJOEHGLCyuG7XYap4zgt4PMtflTMpm7O66rgQaGJ5kBlI5Nln/w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796235416; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=4dTYEJRi6FdJOoBicRocIP+OSHlaYBSRPVvpet812mY=; b=gfvsRAOuqR5w81xaqr7ej9qW31QfBu2fPW3Ozh9BBbF7tusC+0SPPrfy1IP1Ka2ekBxU VBOovsiyfsblFOluIovMJ1NVkwd7PqR3PP0fZBExg+/ek2WR1aMHakekEOxi1CehjSzLp ITSoGtTpzqeF5qRNvA9huSoEnnHevPCop9Wm7ilZziWGNqjWMJSgiZIWBJucJ53gndsfM I5CCkdQlcIymyP0EptS91t09VR+0sahnwZzI3SMpOBK6BLu9irVx2hfHvudKI4RAfFFN4 HwOjlGH4F5s9+fLMxllcU0uKTv8gzygHxD60zEU2pZL9cNNbeAeLrZes7JGWHONScjw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=oGMNleBI; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94B8D606A322 for ; Wed, 2 Dec 2026 18:16:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=oGMNleBI Received: by smtp.kernel.org (Postfix) with ESMTPSA id 985DC1F00893 for ; Wed, 2 Dec 2026 18:16:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796235415; bh=4dTYEJRi6FdJOoBicRocIP+OSHlaYBSRPVvpet812mY=; h=From:Subject:Reply-To:Cc:In-Reply-To:References:Date; b=oGMNleBIIOPnYmZ3QjPngPzm1AgnsnndImGiCFgzazeJ5pEVsnlzhjNJjlpgriQsw 8yTsU+8gKKLOxIOIbsbXMJYqqKTiNxKEhy/NiSbLW9+qvHG7jaz2mHbUDSLyF9OeFU 4gu+wa1wLVeMmRJtQIErQFihb7YPxrS0vKWhzHZr2Wyz5IFk9LFqcD4ZyMUbuveOrN Q1+t3/rzZqhAHtBVe+qjGOV0MuQDCTW0K26iv81T95LvOlspeYsIGGricq83HpG59X koNfd+Gx+BhIyhD17Ks8tqIxYo9nT7cCkKoezoxi9dt5GH5cizMDc1deTQlDiZ6C39 k84LV7IK6WOJg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] audit: use rcu_access_pointer() to test inode->i_fsnotify_marks Reply-To: sashiko-reviews@lists.linux.dev Cc: audit@vger.kernel.org In-Reply-To: <20261202181412.4163569-1-zhangjiayi1014@gmail.com> References: <20261202181412.4163569-1-zhangjiayi1014@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 18:16:55 +0000 X-Mailing-List: audit@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list > handle_one() and handle_path() test inode->i_fsnotify_marks for NULL to > skip inodes that have no marks before they look up an audit tree chunk. T= he pointer is an __rcu > pointer that fsnotify_detach_connector_from_object() clears with > rcu_assign_pointer() when the last mark of the inode goes away, but the > tests read it with a plain load. syzbot reports the same race on this > pointer in fsnotify(), which does the same test: >=20 > BUG: KCSAN: data-race in fsnotify / fsnotify_detach_connector_from_obje= ct >=20 > The race has no functional effect: the tests only compare the pointer > with NULL, and audit_tree_lookup() then searches the chunk hash under > RCU and finds no chunk if the mark is gone. > The plain loads still let the compiler tear or reload them. >=20 > Use rcu_access_pointer(), the accessor for testing an __rcu pointer > without dereferencing it. >=20 > Fixes: 08991e83b728 ("fsnotify: Free fsnotify_mark_connector when there i= s no mark attached") > Link: https://syzkaller.appspot.com/bug?extid=3Df968afcac117a84b7f14 > Signed-off-by: Jiayi Zhang Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202181412.4163= 569-1-zhangjiayi1014@gmail.com?part=3D1