mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: syzbot <syzbot+473d7477c523b41d4046@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Forwarded: [PATCH] usb: serial: keyspan: add debug prints to trace NULL p_priv
Date: Thu, 27 Aug 2026 18:28:49 -0700	[thread overview]
Message-ID: <6a90e451.1d9ded08.62e62.00e0.GAE@google.com> (raw)
In-Reply-To: <6a9087a4.4d659fcc.734b4.0013.GAE@google.com>

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: [PATCH] usb: serial: keyspan: add debug prints to trace NULL p_priv
Author: kartikey406@gmail.com

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master



Add pr_info() calls in keyspan_break_ctl() and keyspan_port_remove()
to trace the lifetime of the per-port private data (p_priv) around
port removal. This is a debugging aid to confirm a suspected race
where a port is unbound (freeing p_priv) while a stale tty fd is
still open, leading to a NULL pointer dereference in
keyspan_break_ctl() when break_ctl is issued afterward.

Not for upstream inclusion - debug only.

Link: https://syzkaller.appspot.com/bug?extid=473d7477c523b41d4046
Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
---
 drivers/usb/serial/keyspan.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
index 4d3746c7a94e..36626c0cc0a9 100644
--- a/drivers/usb/serial/keyspan.c
+++ b/drivers/usb/serial/keyspan.c
@@ -601,9 +601,9 @@ static int keyspan_break_ctl(struct tty_struct *tty, int break_state)
 {
 	struct usb_serial_port *port = tty->driver_data;
 	struct keyspan_port_private 	*p_priv;
-
 	p_priv = usb_get_serial_port_data(port);
-
+	pr_info("keyspan: break_ctl port=%d p_priv=%px disconnected=%d\n",
+        port->port_number, p_priv, port->serial->disconnected);
 	if (break_state == -1)
 		p_priv->break_on = 1;
 	else
@@ -2975,7 +2975,8 @@ static void keyspan_port_remove(struct usb_serial_port *port)
 	int i;
 
 	p_priv = usb_get_serial_port_data(port);
-
+	pr_info("keyspan: port_remove port=%d freeing p_priv=%px\n",
+        port->port_number, p_priv);
 	usb_kill_urb(p_priv->inack_urb);
 	usb_kill_urb(p_priv->outcont_urb);
 	for (i = 0; i < 2; i++) {
-- 
2.43.0


  reply	other threads:[~2026-08-28  1:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-27 18:53 [syzbot] [usb?] general protection fault in keyspan_break_ctl syzbot
2026-08-28  1:28 ` syzbot [this message]
2026-08-28  6:53 ` Johan Hovold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6a90e451.1d9ded08.62e62.00e0.GAE@google.com \
    --to=syzbot+473d7477c523b41d4046@syzkaller.appspotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®