From nobody Sat Feb 7 20:59:34 2026 Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) (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 063F4264614 for ; Mon, 26 Jan 2026 06:17:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.71 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769408258; cv=none; b=pZn66VhYNjcqvSzA8tn3HPLzbx7hXuiXPlV1wBSRKPPY94fOOGo1P2ukqzQN2LeOV7txFkF9f61XVj3U/nM7RmZBvbbiCKlvavyJAeEfbWgHV76724fVwL4jk0lNadsMXdXmnZmhBAEwEkQCStyUuHUiKr6cDN+p5Tw7i/nd9Yc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769408258; c=relaxed/simple; bh=d7D/6fTr1c7yUVujcScVI3hipxcuT+xavR2iCQPChSE=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=AbYSN5dGC0YWACCZbgv1t4oT/SPPbcQboMWmgSR052d44XWweIbPljTJNRMHd1zdrxqLoNZfUPytemkTjaGs502y+gqJWMCL3PeYJkqqqcW3RkPr0JYOSRcyTAFS+b3zSb2Ue7UdHw/gf2qbhElMI3BoB3ibGBCC7nVDAy+r6kw= 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.210.71 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-ot1-f71.google.com with SMTP id 46e09a7af769-7ce5218a74cso11936917a34.3 for ; Sun, 25 Jan 2026 22:17:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769408256; x=1770013056; h=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=TTj5xzHvVck4XhQ+UZOT92pDkRT0Ngs4HisrdPPFcWo=; b=owTwUx+CktQEvSGrELPuimRe4m5bZDCYjWFLtP7QqwyFVHqflyf+RHMUEwOTyWsVCJ hsfbDGgpG3bBU1RjZOnWWfJaMtNHK94jHi2GQGSV3+kXfOuBqZo8hbHlwAGFX9pFmrbf O00mjOhX5L8v14hO0qJWsg7ebaWrssfJlxofSQXvNlfCxg4Xe28adLnEXx+NGb/6LRAh I/UwacmULGOMwuEluD7Jbo1oyyL/3xU7gtuyJldXeWlz5paT+7Hqmb5akpeL0Yn2v+bL j8UCyMkTNnJCBiAndtzAbmk2UcJtEcPPW9TyzqG8GKZKN/CHCDsq44bLpdToBWHMyJy7 r8XA== X-Gm-Message-State: AOJu0YxNzt8p0CtX7k7In9Z/ehCqwzVYvDXvKClNYYm7Gn8twrv+DVK0 n34CvZ9sdM5+xIDi4Z5MG4Xh3YPI0RFSwfffB/o+U0h9YJ7kFC1SaYFezsfZx3narvB9g2ix0sP gy698mfGOjvguVeJiaNtWWmaYcq+GHSblajtR3dKly0JLLKsRbK6bwVUrc+E= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a4a:e847:0:b0:65f:1038:1316 with SMTP id 006d021491bc7-662e04537a2mr1883255eaf.62.1769408255973; Sun, 25 Jan 2026 22:17:35 -0800 (PST) Date: Sun, 25 Jan 2026 22:17:35 -0800 In-Reply-To: <69746a86.050a0220.226181.0003.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <697706ff.050a0220.226181.0013.GAE@google.com> Subject: Forwarded: [PATCH] comedi: dt2815: add comprehensive debug logging to diagnose crashes From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] comedi: dt2815: add comprehensive debug logging to diagnos= e crashes Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git= master Add detailed debug logging throughout dt2815_attach() to diagnose multiple crash scenarios reported by syzbot. The crashes occur at different offsets within the function when attaching to I/O ports without actual hardware present. This debug patch adds: - PID tracking to identify concurrent execution - Logging before/after each outb() operation - Status register values at each iteration - Device pointer and iobase values at critical points - Entry/exit tracking for the attach function Additionally, implements an early hardware detection check: if the first status read returns 0xff (floating bus indicating no hardware), the driver returns -ENODEV immediately instead of attempting further I/O operations. This is a debug patch to gather information about the crash patterns before implementing a final fix. Reported-by: syzbot+72f94b474d6e50b71ffc@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=3D72f94b474d6e50b71ffc Signed-off-by: Deepanshu Kartikey --- drivers/comedi/drivers/dt2815.c | 37 +++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/drivers/comedi/drivers/dt2815.c b/drivers/comedi/drivers/dt281= 5.c index 03ba2fd18a21..285bf13fc74d 100644 --- a/drivers/comedi/drivers/dt2815.c +++ b/drivers/comedi/drivers/dt2815.c @@ -144,10 +144,16 @@ static int dt2815_attach(struct comedi_device *dev, s= truct comedi_devconfig *it) const struct comedi_lrange *current_range_type, *voltage_range_type; int ret; =20 + printk(KERN_INFO "dt2815: [PID %d] ENTER dt2815_attach, it->options[0] = =3D 0x%lx\n",=20 + current->pid, it->options[0]); + ret =3D comedi_request_region(dev, it->options[0], 0x2); if (ret) return ret; =20 + printk(KERN_INFO "dt2815: [PID %d] after comedi_request_region, dev->ioba= se =3D 0x%lx\n",=20 + current->pid, dev->iobase); + ret =3D comedi_alloc_subdevices(dev, 1); if (ret) return ret; @@ -175,31 +181,58 @@ static int dt2815_attach(struct comedi_device *dev, s= truct comedi_devconfig *it) ? current_range_type : voltage_range_type; } =20 + printk(KERN_INFO "dt2815: [PID %d] About to do FIRST outb, dev =3D %px, d= ev->iobase =3D 0x%lx\n", + current->pid, dev, dev->iobase); /* Init the 2815 */ outb(0x00, dev->iobase + DT2815_STATUS); + + printk(KERN_INFO "dt2815: [PID %d] FIRST outb completed successfully\n", = current->pid); + for (i =3D 0; i < 100; i++) { /* This is incredibly slow (approx 20 ms) */ unsigned int status; =20 + printk(KERN_INFO "dt2815: [PID %d] Loop iteration %d, dev->iobase =3D 0x= %lx\n", + current->pid, i, dev->iobase); usleep_range(1000, 3000); status =3D inb(dev->iobase + DT2815_STATUS); + printk(KERN_INFO "dt2815: [PID %d] iteration %d: status =3D 0x%x\n", + current->pid, i, status); + /* 0xff usually indicates no hardware present on the bus */ + if (i =3D=3D 0 && status =3D=3D 0xff) { + dev_err(dev->class_dev, + "No hardware detected at I/O base 0x%lx\n", + dev->iobase); + printk(KERN_INFO "dt2815: [PID %d] Returning -ENODEV (no hardware)\n", + current->pid); + return -ENODEV; + } + if (status =3D=3D 4) { unsigned int program; =20 program =3D (it->options[4] & 0x3) << 3 | 0x7; outb(program, dev->iobase + DT2815_DATA); + printk(KERN_INFO "dt2815: [PID %d] Hardware ready, programmed successfu= lly\n", + current->pid); dev_dbg(dev->class_dev, "program: 0x%x (@t=3D%d)\n", program, i); + printk(KERN_INFO "dt2815: [PID %d] Unexpected status 0x%x at iteration = %d\n", + current->pid, status, i); break; } else if (status !=3D 0x00) { dev_dbg(dev->class_dev, "unexpected status 0x%x (@t=3D%d)\n", status, i); - if (status & 0x60) + if (status & 0x60) { + printk(KERN_INFO "dt2815: [PID %d] About to do recovery outb, dev =3D = %px, dev->iobase =3D 0x%lx\n", + current->pid, dev, dev->iobase); outb(0x00, dev->iobase + DT2815_STATUS); + printk(KERN_INFO "dt2815: [PID %d] Recovery outb completed\n", current= ->pid); + } } } - + printk(KERN_INFO "dt2815: [PID %d] EXIT dt2815_attach successfully\n", cu= rrent->pid); return 0; } =20 --=20 2.43.0