From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f70.google.com (mail-oo1-f70.google.com [209.85.161.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF1604A341E for ; Tue, 19 May 2026 12:52:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.70 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779195151; cv=none; b=OKkS3tcr+E11MC4S2DsAc804qRT220UhdrGXgkso68f7LDGzZsDtxioRMMq16ws4g4pn9NOTPmc0er4rK7U9sS94CKcH/1JcEz6+nVgd4cnUkBuCcj0n/vc//+kOc9EvHYxWs51IubCK+XKNtCbXE05UtkG6jWzPL+w6XTT8j+Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779195151; c=relaxed/simple; bh=DjjDPDi1SXvJ66nqbHM9OINFxFuc0Zf4UFiMPLKTy/U=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To:Cc: Content-Type; b=I415BIXijx80PXEHIhhA6/5+1ZL/5fX9512gEciVIPg0cXo42APXHZNrw9c2Qj6hVdPVOdYDAYy0TI2/do1Fpqplyp+ZBkNCio4va3GZmO6e4/cPho8mwqZqJkmcqDZIYH5lK3/TItSIxI4YSPxZy2XxA/ztZQlQ4sRIiC6NG1A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.161.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oo1-f70.google.com with SMTP id 006d021491bc7-696233b2816so6970573eaf.1 for ; Tue, 19 May 2026 05:52:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779195149; x=1779799949; h=cc:to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NbKMw7vBScDmw7ai/m7BMnNRYIYkk1BLPuOwonqGlcs=; b=c+G2+yesYOlnCyzsLVJoLABC4ID75V9JVDykwLwvFp3YhTG2BVGTm/Qx4Kv1iLW8aZ 8jRO1zzv9w86IXyUrTesGoU9ViLhWaXLcWaLAbVFroKYUZOhATr/BRfgacLNi5qX3UBa vtppSuv50DbwTdM8YCjHcOaXJLXtkg9Zs8hcCgJtzSx4hima8mqLVq+ptP0zwF3+E6v9 GU72jqQp0IKxTqD4EvZpG6rSTKx2RPkpMvJC1ASd/hhTN1IAWg98p6OcMvl2FhawUNHS QaeohJAafJpuNRr5RlDwp/zzUXICHAQJSMZzWUFxYkl6M4xAEnwi5P5j7FDlUHPchvtv A5vQ== X-Forwarded-Encrypted: i=1; AFNElJ/X9AQWACi7lGEDEaSzxp/7ot8tqgn8Rdh5F/xKHeddhCG/MiFFz2Y3HjagVAcoyI7THgE/V+I54JCKVRw=@vger.kernel.org X-Gm-Message-State: AOJu0YwjgqEL1NnPC185B0t8XIHawHG+Nz3Lb3YxNkTFS/w3qSejluuE EzY3m1rilDquYEe7XYTwe9qZxUeSa7TeIiihsf67jAY0j2SvjWCRzJXEZxUiQjgqs6RCL5tRDyP BgGsOMu8XMWkaxPf/fp8jfLelgOytnnotYm5jK56a7n3m5hpKc6lV2/rPjKw= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:6ac4:b0:694:9156:9b97 with SMTP id 006d021491bc7-69c9430183dmr11892491eaf.22.1779195148883; Tue, 19 May 2026 05:52:28 -0700 (PDT) Date: Tue, 19 May 2026 05:52:28 -0700 In-Reply-To: <20260519125202.34382-1-kernel@phwe.de> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6a0c5d0c.050a0220.3d78ee.00dd.GAE@google.com> Subject: Re: [syzbot] [input?] [usb?] KASAN: slab-use-after-free Read in hidraw_report_event From: syzbot To: kernel@phwe.de Cc: kernel@phwe.de, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" > #syz test This crash does not have a reproducer. I cannot test it. > > 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 >