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=1796409809; b=Hn3hcu0Pvt0Emf0e5bl1D83aTSJz1//WhgFRT4FUgqaHbFJxvv4AsoY26gvVmTfZuLn7 Usx1xwxQuxIuOcjPQlKTeqWK21SVD3xqw9EmVO1fsxhgkSpMTXNfGwRiJqI+cjSCfrWha QzcH1up+lI92YA9i/qZmK860DbdQfMV/2UwO6zTYD60aHQZyAOS5fmPA265OmILuzDIKh YHGzct7hjFdEPJlA2Xwccs/0IEdq9LCrTJ08lIlaX/4doCQ/891ydKuXDIOExk3eOHR4h t53UanWJAtmXyMM6dLA/aqi0VkjjFvNlhygaHoJ2cVaylDASApXktsvLAO5oubfPRlg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796409809; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=sxIKvXjX+kYRjpLI2Vy4TZljrtnGb0A+NbqfYs4BYfE=; b=d0Y245zwF0XgYjFfzsXlkF2p4fI0Yrzm9fVLvTYrq7EtwcXk48ZYyQtWiU887MxwE+hD 7n7cOVzjRm2TE5tbuGGgggDYQRMPgypJ2G3n08iwL/Mu5J8bLUyLtj64rFz+6ROSbia9T FymXRzpKThICnXFS4amOynbM4uiHiJJSTRDy6zIKgejleUUZDBcll0qlAYEIMd9sVFvXJ BzNXhloppAwDVE2yiiT3YxagLoMg6TrEGKpGGreF1m0Lx/7HC2Qag92mGQyyV1wvTFmhm ln/pnH9HvI2fwwI6hyjJhVW404cMUrOOVvBNtBr1o5UTPaL8qWIouSOo5K77NHdyMcQ== 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=hKtFhkye; 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 F20C5606A322 for ; Fri, 4 Dec 2026 18:43:28 +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=hKtFhkye Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82F1A1F00936; Fri, 4 Dec 2026 18:43:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796409808; bh=sxIKvXjX+kYRjpLI2Vy4TZljrtnGb0A+NbqfYs4BYfE=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=hKtFhkyeONXaA9A+M9KZCq/YmAGpmFNMqX49dxyqVNF61ApDftM8cEKi9nNQJFM5n 3JOWyWepVrbd5Zm9QdfwnKFN5efylEE2dMvynoO/c5Kb7kv3jKx2MpflHWaU4V8AxW N/OZtwAwH9YVNNc1+rJm99iTwgItaw+96YDauvy0fHnhFmxwMpHnbI8pKWOs+DRh0n zy8vPDJUzkmXY+f+pS9dfX+/a8JJ1OUgpwHvq9d2Sk3NWNovjOFvTMNkFSv/WsF1mi Ks3yasgab4jUuZJWK/poYZW1QU2zAdpEdgr1aGoAO/6HeEaz72MmWVCTKCbp6B2zMf QYXvDcAOIOkaA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v5] usb: gadget: f_fs: fix use-after-free in ffs_closed() on umount Reply-To: sashiko-reviews@lists.linux.dev To: "Mohammad Mosafer" Cc: linux-usb@vger.kernel.org In-Reply-To: <20261204182530.178997-1-mohsafer@gmail.com> References: <2026120316-slicer-twiddle-2f8c@gregkh> <20261204182530.178997-1-mohsafer@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 18:43:28 +0000 X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list > ffs_free_inst() releases the ffs_dev with ffs_release_dev() and only > then re-acquires ffs_dev_lock to free it with _ffs_free_dev(). In > between, the dev is still linked on the ffs_devices list while already > marked unmounted, so a concurrent mount(2) of functionfs finds it by > name in ffs_acquire_dev() and links a fresh ffs_data to the doomed dev > (ffs_data->private_data =3D dev). _ffs_free_dev() then kfrees the dev, > and when that mount is torn down, ffs_closed() dereferences the stale > ffs->private_data: >=20 > BUG: KASAN: slab-use-after-free in ffs_data_clear+0x438/0x530 > Write of size 1 at addr ffff88810594664a by task repro/116 > ffs_data_clear+0x438/0x530 > ffs_fs_kill_sb+0x7b/0x510 > deactivate_locked_super+0xa9/0x200 > cleanup_mnt+0x255/0x380 > [ ... ] >=20 > Reported-by: syzbot+6227549bd2c8a1ec8ba0@syzkaller.appspotmail.com > Closes: https://syzkaller.appspot.com/bug?extid=3D6227549bd2c8a1ec8ba0 > Fixes: ecfbd7b9054b ("usb: gadget: f_fs: Fix setting of device and driver= data cross-references") > Signed-off-by: Mohammad Mosafer Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204182530.1789= 97-1-mohsafer@gmail.com?part=3D1