From: Johan Hovold <johan@kernel.org>
To: Johan Hovold <johan@kernel.org>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
syzbot+763813d65c7e18c1b6d5@syzkaller.appspotmail.com,
stable@vger.kernel.org
Subject: [PATCH v2 01/12] USB: serial: io_edgeport: fix NULL-deref on early status
Date: Fri, 23 Oct 2026 14:15:19 +0200 [thread overview]
Message-ID: <20261023121530.186541-2-johan@kernel.org> (raw)
In-Reply-To: <20261023121530.186541-1-johan@kernel.org>
The driver submits the interrupt-in URB during probe or on first port
open, which on completion may submit the bulk-in URB before all ports
have been opened and their waitqueues have been initialised.
If a (malicious) device sends a status message for a port that has not
yet been opened this may lead to a NULL-pointer dereference in the
bulk-in completion handler when attempting to wakeup blocked tasks.
Move waitqueue initialisation from open() to port_probe() to address
this.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: syzbot+763813d65c7e18c1b6d5@syzkaller.appspotmail.com
Link: https://lore.kernel.org/6a8818d8.ae6ddae5.3da009.0031.GAE@google.com
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/usb/serial/io_edgeport.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index eaa8f00716c8..cdf41e86ba44 100644
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -877,11 +877,6 @@ static int edge_open(struct tty_struct *tty, struct usb_serial_port *port)
}
}
- /* initialize our wait queues */
- init_waitqueue_head(&edge_port->wait_open);
- init_waitqueue_head(&edge_port->wait_chase);
- init_waitqueue_head(&edge_port->wait_command);
-
/* initialize our port settings */
edge_port->txCredits = 0; /* Can't send any data yet */
/* Must always set this bit to enable ints! */
@@ -2965,6 +2960,11 @@ static int edge_port_probe(struct usb_serial_port *port)
return -ENOMEM;
spin_lock_init(&edge_port->ep_lock);
+
+ init_waitqueue_head(&edge_port->wait_open);
+ init_waitqueue_head(&edge_port->wait_chase);
+ init_waitqueue_head(&edge_port->wait_command);
+
edge_port->port = port;
usb_set_serial_port_data(port, edge_port);
--
2.55.0
next prev parent reply other threads:[~2026-10-23 12:16 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-23 12:15 [PATCH v2 00/12] USB: serial: io_edgeport: fixes and sync commands Johan Hovold
2026-10-23 12:15 ` Johan Hovold [this message]
2026-10-23 12:24 ` [PATCH v2 01/12] USB: serial: io_edgeport: fix NULL-deref on early status sashiko-bot
2026-10-23 12:15 ` [PATCH v2 02/12] USB: serial: io_edgeport: fix potential close() use-after-free Johan Hovold
2026-10-23 12:30 ` sashiko-bot
2026-10-23 12:15 ` [PATCH v2 03/12] USB: serial: io_edgeport: fix potential NULL-deref at open Johan Hovold
2026-10-23 12:35 ` sashiko-bot
2026-10-23 12:15 ` [PATCH v2 04/12] USB: serial: io_edgeport: move initial termios update to open() Johan Hovold
2026-10-23 12:28 ` sashiko-bot
2026-10-23 12:15 ` [PATCH v2 05/12] USB: serial: io_edgeport: fix potential fifo corruption Johan Hovold
2026-10-23 12:25 ` sashiko-bot
2026-10-23 12:15 ` [PATCH v2 06/12] USB: serial: io_edgeport: fix potential use-after-free on disconnect Johan Hovold
2026-10-23 12:28 ` sashiko-bot
2026-10-23 12:15 ` [PATCH v2 07/12] USB: serial: io_edgeport: serialise MCR accesses Johan Hovold
2026-10-23 12:22 ` sashiko-bot
2026-10-23 12:15 ` [PATCH v2 08/12] USB: serial: io_edgeport: drop redundant sanity checks Johan Hovold
2026-10-23 12:25 ` sashiko-bot
2026-10-23 12:15 ` [PATCH v2 09/12] USB: serial: io_edgeport: drop redundant open " Johan Hovold
2026-10-23 12:27 ` sashiko-bot
2026-10-23 12:15 ` [PATCH v2 10/12] USB: serial: io_edgeport: deassert DTR/RTS on close() and B0 Johan Hovold
2026-10-23 12:43 ` sashiko-bot
2026-10-23 14:00 ` Johan Hovold
2026-10-23 12:15 ` [PATCH v2 11/12] USB: serial: io_edgeport: replace atomic command allocations Johan Hovold
2026-10-23 12:24 ` sashiko-bot
2026-10-23 12:15 ` [PATCH v2 12/12] USB: serial: io_edgeport: switch to synchronous commands Johan Hovold
2026-10-23 12:31 ` sashiko-bot
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=20261023121530.186541-2-johan@kernel.org \
--to=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=syzbot+763813d65c7e18c1b6d5@syzkaller.appspotmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.