From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay.yourmailgateway.de (relay.yourmailgateway.de [194.59.206.189]) (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 6297826299 for ; Tue, 19 May 2026 12:52:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.59.206.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779195160; cv=none; b=GSo/Uw3soTDSN5CHzcH+PvX/hokqP30TfNloOUYxF9SYdioewY0bP5OBvJXcEbP56W/ZYD5HQbZ9r56Du02BFkzFOrS9pbIwlFoWgZPcTC8dTsNtCbz4kjymu81EcKdsptW5x2LDbTbwX4+7jqDSguy7NEOMk2AKcUjnQ+5c/Qw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779195160; c=relaxed/simple; bh=ObtwUNnAxbErCuQe5gwJIS1/0BHgUj69ngVemGF0Z4c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lZ6pRqRhQCmuFr3bQDxeHfsDBJu3vKg2eDNdkuNQpLYzTvKstUqkF4TJQe4hsNJ8k5KLM6KC7T05N5bvSI0Immh7wYZW2rk1pVkCf57VRksULmVulorFwKoy5S/14XvHiUjN5pfe2R2WoUYz6s+LllfdaVMazo3U0HcToeubVWY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=phwe.de; spf=pass smtp.mailfrom=phwe.de; dkim=pass (2048-bit key) header.d=phwe.de header.i=@phwe.de header.b=dqAfUSg5; arc=none smtp.client-ip=194.59.206.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=phwe.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=phwe.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=phwe.de header.i=@phwe.de header.b="dqAfUSg5" Received: from relay02-mors.netcup.net (localhost [127.0.0.1]) by relay02-mors.netcup.net (Postfix) with ESMTPS id 4gKZMJ1WrGz4DFB; Tue, 19 May 2026 14:52:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=phwe.de; s=key2; t=1779195148; bh=ObtwUNnAxbErCuQe5gwJIS1/0BHgUj69ngVemGF0Z4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dqAfUSg5QoQrM4Nbljsn3yr5UwVEczC7WDOq4xptv46h/i6vLcwjn+IFbGDd2/oq5 vGlUJcZ1ADntaYNYCYcQVHu/Du7kQNuozhBBI9SbXTSu5aLE9CKuG0k2KWnTmO3S3o yfOpJXYvTaU/poDHe3wHvsOQCdRPYdrR2nVgtu1DsvQR5HieT0iRrs+kL8RKvxAn3A blWyUXF/L3B8mtSW+HLoJaANG4uIRPT13RJFi0KNh5AMFQIQyjk+5Nxhpn4ITKYouy s8ik1HIUFQVUN+WBEvVDh53cSkKvottVna5fJkO4JNuYa6yHDBLBGXOnokY3E/h53N WdaHGNftQS/lw== Received: from policy02-mors.netcup.net (unknown [46.38.225.35]) by relay02-mors.netcup.net (Postfix) with ESMTPS id 4gKZMJ0qVsz7wmw; Tue, 19 May 2026 14:52:28 +0200 (CEST) Received: from mxe95c.netcup.net (unknown [10.243.12.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by policy02-mors.netcup.net (Postfix) with ESMTPS id 4gKZMH5jBvz8sZw; Tue, 19 May 2026 14:52:27 +0200 (CEST) Received: from mandalore.fritz.box (p5dd24ed4.dip0.t-ipconnect.de [93.210.78.212]) by mxe95c.netcup.net (Postfix) with ESMTPSA id 78DC7800F7; Tue, 19 May 2026 14:52:26 +0200 (CEST) Authentication-Results: mxe95c; spf=pass (sender IP is 93.210.78.212) smtp.mailfrom=kernel@phwe.de smtp.helo=mandalore.fritz.box Received-SPF: pass (mxe95c: connection is authenticated) From: Philipp Weber To: syzbot+9eebf5f6544c5e873858@syzkaller.appspotmail.com Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [input?] [usb?] KASAN: slab-use-after-free Read in hidraw_report_event Date: Tue, 19 May 2026 14:52:02 +0200 Message-ID: <20260519125202.34382-1-kernel@phwe.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <69eed7e0.a00a0220.7773.0026.GAE@google.com> References: <69eed7e0.a00a0220.7773.0026.GAE@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-PPP-Message-ID: <177919514717.2856406.2261764082066061062@mxe95c.netcup.net> X-NC-CID: VeHR0NARzHmDnmsL2Rl5ue2D58fYOsH7KMUw7CHt7Q== #syz test Quiesce HID input in hid_hw_stop() when io_started is true, so that hidraw_report_event() cannot race with the upcoming hid_disconnect() that frees the hidraw object. This is a centralized variant of Edward Adam Davis's per-driver fix ("hwmon: prevent packets from going to driver for probe", 2026-04-28). Of 15 hid_device_io_start() callers in the tree, 8 lack the matching io_stop() before hid_hw_stop() in their error paths. --- drivers/hid/hid-core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 41a79e43c82b..6b024118d983 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -2440,9 +2440,16 @@ EXPORT_SYMBOL_GPL(hid_hw_start); * * This is usually called from remove function or from probe when something * failed and hid_hw_start was called already. + * + * If the caller enabled HID input via hid_device_io_start() and is unwinding + * without an explicit hid_device_io_stop(), quiesce input first so that + * in-flight reports cannot reach handlers (e.g. hidraw_report_event) whose + * backing objects hid_disconnect() is about to free. */ void hid_hw_stop(struct hid_device *hdev) { + if (hdev->io_started) + hid_device_io_stop(hdev); hid_disconnect(hdev); hdev->ll_driver->stop(hdev); } -- 2.53.0