From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796385739; b=ZC02+jorG0qxrNdqZUXKTAH/6dzy5PIoNq+r8Kma+inG7BW+lhEaQVCGPKq1iB+P5ghs IrGx34cCcSDUmUbSziYGf/6drkndi2pWmHM3bHfVfb1kEmASXoUB0ULBb7Bw2NLLTD6Ex d0TyEzHaFQ94Hkn+oMNvyQJEEqIsbfg5Y7XcxEnu68UGewdwqFEAuZGBkehur9hN+3OVn L+Y/bq4H8xNoa+BjyKSOak1Py9u7rbyiUY2p2hmtARe7JbILBJV5m76xN6k3Gk7ukTO6t p6wB0cHmZpaTAmmTyE447J2w/qtArSu53gg3N3vmdOi3jDydBdAsBq8lfQTraE9GmvQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385739; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=XlyckDq4X9Y9vebuF6rDsnqIhqyRj2HsbGTtEg7REKE=; b=4YD4180ES6ZCVrcjc8cNSRQ5S/wfuDpfkXmXnehDASTXYORF2QrFTUk+EMjtD0ni6t8+ QJ5P64kOO392LV4YUB0kCTG0NUwdtfmx7ZHvcQhcUGEQrjJBwh7GlPRYbY6Y+VoAZvvt/ uAbOe/0JPFq4KzS1Outcg1y/mo1f38RBYb4UV/XVMRsJPdiB+r6pcEXWsAaRA+qBvUbBx 6vrAQJpr5fGXO7Ieb8lNNYz8gb7Z7xBYbDTeUHVhQLvV4yosJ3uundL3/Lon1UOtgTPeX KRNCs248SXSk+FMzHERlsH7BDz6d+gN1f1esX76A5ZVI3dpPR+XHhdM5Bft2ib0nLUg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=H28Ah0zP; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E8BDF606A322; Fri, 4 Dec 2026 12:02:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=H28Ah0zP Received: by smtp.kernel.org (Postfix) with ESMTPSA id 658561F000C2; Fri, 4 Dec 2026 12:02:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385738; bh=XlyckDq4X9Y9vebuF6rDsnqIhqyRj2HsbGTtEg7REKE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=H28Ah0zP+Yn/YgRx71RbOMLzFXB44HF9FZOe9xFHTJ52nTODZMr6Fdr09qH94L9jg 9ln1j1Oq/IR2zWO21onHYBx7pbQCm66OGRu5T499EtpgHX/OA/CjZdoyHrt2tL1L3g OowHSvQ22DeYUoqsvEsjCQ+0Ji/bEzwxCRJRbeQ4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+763813d65c7e18c1b6d5@syzkaller.appspotmail.com, Johan Hovold Subject: [PATCH 6.6 0672/1167] USB: serial: io_edgeport: fix NULL-deref on early status Date: Fri, 4 Dec 2026 19:01:39 +0900 Message-ID: <20261204100719.563601187@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold commit ae22e9b6412e5dc99e1cf8bd13c6176d44c7d42e upstream. 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 Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/io_edgeport.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- 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 * } } - /* 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_se 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);