From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (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 D8F8D29B78B for ; Mon, 23 Feb 2026 14:39:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771857600; cv=none; b=R1eJwzpFVK1+y8DY7rLV4XZLNTgahOdgo+WNsoiEpeRvPK2TqyyOGHGEgfNzguzTFjGyIApArgnKSS66pGUKilMIT3fEQqlyToxxAiAN7COJjXYXew99ohCvi4r47MLmbnmgPBLHBKz5JF32BqJhtuiyAm4Icn00iFhBwciohMs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771857600; c=relaxed/simple; bh=t9KBFUqdb3FGV4nIE+fMrWaLv7ZIwKkO2Dt7HG00xmU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bfVZ+SCGsPK88WfpRX4olYJzytdMMz0IWK4yLU3hoy1PllxgFt4L7bOhAaNWPV7BC99mNPbnYn/g1ALSaJwbqVVRzgvcCPUHESyH5JAukwK5ZcuH0q0trgli0MBpl3aHUsptTjMnW2YRF2eVEtUYFklbfbf5bdNWHDPyCKEisp4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rowland.harvard.edu; spf=fail smtp.mailfrom=g.harvard.edu; dkim=pass (2048-bit key) header.d=rowland.harvard.edu header.i=@rowland.harvard.edu header.b=QfXiEwYk; arc=none smtp.client-ip=209.85.160.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rowland.harvard.edu Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=g.harvard.edu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rowland.harvard.edu header.i=@rowland.harvard.edu header.b="QfXiEwYk" Received: by mail-qt1-f176.google.com with SMTP id d75a77b69052e-50335b926c2so40516191cf.2 for ; Mon, 23 Feb 2026 06:39:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rowland.harvard.edu; s=google; t=1771857597; x=1772462397; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=kWORPb6fb34LAVxof+FZjNAy04GbN7Kfnww3yYmf/ys=; b=QfXiEwYkdNCqZ5ipDT+COOGs61xLTT3yFvdd3XmPGs6Mm32ff0bWuECDBVkIddIsag DSlT7YIjAAysPfUhryT8NEMR9MZ6XdeXhqLWywlOv1+yAcb81fPEisElJqVyBScV5rKF Q+FRiIZ1IEfni7I+bGM9gaJwYHyBKvV7Dxd1tQh3OpQmIbCdHtV+T5vH1A9yRf+MvMvt QJlnh7naJaBx7VKxF3koasQhajIbRQx7dQu4Qwd7PYKRysUxeU0XWSuXjYaeCyz0WGy7 qPiF9/94pfOOjqSHonw37CI2oTcjwTzz2CQkEWx+RUFiiQANSSsooC0L3767CbDYFhJ4 yDgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771857597; x=1772462397; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kWORPb6fb34LAVxof+FZjNAy04GbN7Kfnww3yYmf/ys=; b=qpjoXQbLLvjpYn+5PhVD244pTfjb7C9uyAw3R8upJtqC1Pj9Ed836ztAEgt8YRyyDF vJEop4LTmHq8A/gGyVm7C5MDbntaH1zvl7bRbf12NawN207UT5SlXTrKn+aYnmA+LqyP 9+yO0dJqnSF3rbROmj2KiY/tEbrhDwrx3I9XCZNeZMAEL9jj+8mgubIS4g4bu3l3YoAg u7AnPgy2d8QfmaPtzHYjXCrM5fUGciEj/Rqv2fmno0paeqM73Mg1W3Pk9mjdoesYwY/E v92cgx2oTTo3WBJAFbwjqAKnNT7zBsEqqum9qlW2bzvYXd4C8DJhV/10P9SzjeQ0Idib 16gQ== X-Forwarded-Encrypted: i=1; AJvYcCUV4yGV2UCoRRCqEejryvbD5YbsEtOt4xpbH+tjaTqy2312c1eP5x08uWfEHFse37CiRMZwHCaf9df7KIU=@vger.kernel.org X-Gm-Message-State: AOJu0YwffxPj9XTN1CoLs7Wq85UG7ZgCUDDdXUGAn5uhg/CMZiIq1g+g ub+7mV99PW3CAIDyxfFBsnQFhxZ1u6qbCuf4bfQfEebcKGzkfp/xyVnk+WOeuiJu0w== X-Gm-Gg: AZuq6aJ76RPmz9cxVPdTmu9oaBhFOuuunhiE9IWT4ldy/aACxGRcMyh6VL9owmkTwlw WlIFFVXPfGn3E7GTB5JH/Q7ciaO7JJSfXAb14sf0YAzO4Ty2eN1Fux5q5A4nKsfnIHVFbHrclRq grocDG9ijoZHNU6BAizTTb3jlAeAnzGMC/3n7AG8knGGAiVQGufyfht5z+RwIqtsFjGvc9tW6tj 09bDvpt2Tk/suamgGtN9vDD2q1M3eGvHO3cs1myXTwbl2Syyxbto+8jD17FbRJOWpmPhc+U74Br gngWfs6uFG511kuov0wDgTwblYrj5Gaixl5GAx+zSMdtTgrbJGeONrwT+LPnhEYITayyb4pj1A2 jLc/UhGlNh4L26aLE1qo0Gq+xGboKhftRT+7lqKt3AJqey2p+GLEEvgm47CzdOqwakHdyA0l+2a 2Rw6MRXClbWXZHYk0QxFxubAEn X-Received: by 2002:ac8:7f0c:0:b0:4ed:dcf0:6c42 with SMTP id d75a77b69052e-5070bc6bf35mr117323131cf.40.1771857596854; Mon, 23 Feb 2026 06:39:56 -0800 (PST) Received: from rowland.harvard.edu ([2601:19b:d01:d210::687c]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-5070d6e9e81sm70887271cf.32.2026.02.23.06.39.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 06:39:56 -0800 (PST) Date: Mon, 23 Feb 2026 09:39:52 -0500 From: Alan Stern To: Greg Kroah-Hartman Cc: netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Petko Manolov , stable Subject: Re: [PATCH net] net: usb: pegasus: validate USB endpoints Message-ID: References: <2026022347-legibly-attest-cc5c@gregkh> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2026022347-legibly-attest-cc5c@gregkh> On Mon, Feb 23, 2026 at 01:58:48PM +0100, Greg Kroah-Hartman wrote: > The pegasus driver should validate that the device it is probing has the > proper number and types of USB endpoints it is expecting before it binds > to it. If a malicious device were to not have the same urbs the driver > will crash later on when it blindly accesses these endpoints. > > Cc: Petko Manolov > Cc: stable > Assisted-by: gkh_clanker_2000 > Signed-off-by: Greg Kroah-Hartman > --- This does much the same thing as https://lore.kernel.org/linux-usb/20260222050633.410165-1-n7l8m4@u.northwestern.edu/T/#u and that patch also removes some magic numbers. BTW, what is gkh_clanker_2000? Alan Stern > drivers/net/usb/pegasus.c | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c > index 4f539b5d509a..94c17fed0bd4 100644 > --- a/drivers/net/usb/pegasus.c > +++ b/drivers/net/usb/pegasus.c > @@ -801,8 +801,19 @@ static void unlink_all_urbs(pegasus_t *pegasus) > > static int alloc_urbs(pegasus_t *pegasus) > { > + static const u8 bulk_ep_addr[] = { > + 1 | USB_DIR_IN, > + 2 | USB_DIR_OUT, > + 0}; > + static const u8 int_ep_addr[] = { > + 3 | USB_DIR_IN, > + 0}; > int res = -ENOMEM; > > + if (!usb_check_bulk_endpoints(pegasus->intf, bulk_ep_addr) || > + !usb_check_int_endpoints(pegasus->intf, int_ep_addr)) > + return -ENODEV; > + > pegasus->rx_urb = usb_alloc_urb(0, GFP_KERNEL); > if (!pegasus->rx_urb) { > return res; > @@ -1143,6 +1154,7 @@ static int pegasus_probe(struct usb_interface *intf, > > pegasus = netdev_priv(net); > pegasus->dev_index = dev_index; > + pegasus->intf = intf; > > res = alloc_urbs(pegasus); > if (res < 0) { > @@ -1154,7 +1166,6 @@ static int pegasus_probe(struct usb_interface *intf, > > INIT_DELAYED_WORK(&pegasus->carrier_check, check_carrier); > > - pegasus->intf = intf; > pegasus->usb = dev; > pegasus->net = net; > > -- > 2.53.0 > >