From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from r3-24.sinamail.sina.com.cn (r3-24.sinamail.sina.com.cn [202.108.3.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 18FD717BA6 for ; Mon, 29 Jun 2026 22:10:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.108.3.24 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782771046; cv=none; b=dDraBdksZ9NcvxtDwyeIwGaDvLnHYvBazPRAkkn/+8K4u1gbjkWxkhKcWk73W7pP3ULE0YNQcfwMigiOOQSdTdnaniE9yX+OhecAyVsMzIh0UgUyaWSIqrjaJZMtYMUFRLpPTkZ8S+JA/9GtJrFZw2ptBs4zAD8EGoOXg7gC6BA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782771046; c=relaxed/simple; bh=UJTYCiIEHHapbK5ihydoCGf4EEp8acqEmhEL8leIBkY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HkU8ehB5nbxOat39ut3iuuXTEM6ccHr8nxNQE3ZeYHb4h7e6vVubOHcHBCM8g9ZTxjJUBO+2M4lFSO1zElyz7yX8R4bSXlMMvhGVNXeqyPiNz2+SACbcu+GtqlOudql/UYaQV475yPtwRsNw6DEYH5DHXy5N1/NZ2E3vF49RyXE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sina.com; spf=pass smtp.mailfrom=sina.com; dkim=pass (1024-bit key) header.d=sina.com header.i=@sina.com header.b=tpOkYfpL; arc=none smtp.client-ip=202.108.3.24 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sina.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=sina.com header.i=@sina.com header.b="tpOkYfpL" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sina.com; s=201208; t=1782771042; bh=D68vK+18Cry5zlz7WtRzUzSBrrRS6Z/uLx2fPSwPISU=; h=From:Subject:Date:Message-ID; b=tpOkYfpLuS15kvwtcq7S7plDdybZMM/TsrDVjpiOQYSo5hCqMydLCu0Pg20Half3e L5fGMJnMEtS4nC7xne8D/qgPYUL22AhdC3o4aWH+Bv1//pIg7+su6uEwyHiP2uuE1W ZybYaWmrhuZgfsEZChz4oA8rFAC3SkUmGUkDqRmw= X-SMAIL-HELO: localhost.localdomain Received: from unknown (HELO localhost.localdomain)([114.249.62.144]) by sina.com (10.54.253.31) with ESMTP id 6A42ED5500002615; Mon, 30 Jun 2026 06:10:32 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com Authentication-Results: sina.com; spf=none smtp.mailfrom=hdanton@sina.com; dkim=none header.i=none; dmarc=none action=none header.from=hdanton@sina.com X-SMAIL-MID: 3370076816751 X-SMAIL-UIID: CCD146A9DF604767A44B02AA06DDB160-20260630-061032-1 From: Hillf Danton To: Yousef Alhouseen Cc: Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot+563191a4939ddbfe73d4@syzkaller.appspotmail.com Subject: Re: [PATCH] HID: hiddev: keep state alive through disconnect unlock Date: Tue, 30 Jun 2026 06:10:18 +0800 Message-ID: <20260629221019.294-1-hdanton@sina.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit [ feel free not to send top reply ] On Mon, 29 Jun 2026 08:57:02 -0500 Yousef Alhouseen wrote: > The missing interleaving is that mutex_unlock() clears the owner > before taking wait_lock. A contender already spinning on existancelock > can acquire it after that owner clear, reach the final-release path, > and free hiddev before the disconnecting task reaches > raw_spin_lock_irqsave(&lock->wait_lock, ...). It does not need to be > woken by the disconnecting task. > In __mutex_unlock_slowpath() the wait_lock is taken because of MUTEX_FLAG_WAITERS after clearing the lock owner, so it is bug in the mutex backyard instead if mutex is freed without pending waiters handled.