]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
usb: net: sierra: check for no status endpoint
authorOliver Neukum <oneukum@suse.com>
Mon, 14 Jul 2025 11:12:56 +0000 (13:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 24 Jul 2025 06:56:32 +0000 (08:56 +0200)
[ Upstream commit 4c4ca3c46167518f8534ed70f6e3b4bf86c4d158 ]

The driver checks for having three endpoints and
having bulk in and out endpoints, but not that
the third endpoint is interrupt input.
Rectify the omission.

Reported-by: syzbot+3f89ec3d1d0842e95d50@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/linux-usb/686d5a9f.050a0220.1ffab7.0017.GAE@google.com/
Tested-by: syzbot+3f89ec3d1d0842e95d50@syzkaller.appspotmail.com
Fixes: eb4fd8cd355c8 ("net/usb: add sierra_net.c driver")
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Link: https://patch.msgid.link/20250714111326.258378-1-oneukum@suse.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/usb/sierra_net.c

index 3d239b8d1a1bcb2340692b4884cf3d66e62defc2..52e9fd8116f98e52911f85d28fdd53aa27e975b8 100644 (file)
@@ -689,6 +689,10 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf)
                        status);
                return -ENODEV;
        }
+       if (!dev->status) {
+               dev_err(&dev->udev->dev, "No status endpoint found");
+               return -ENODEV;
+       }
        /* Initialize sierra private data */
        priv = kzalloc(sizeof *priv, GFP_KERNEL);
        if (!priv)