Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2756084lqz; Wed, 3 Apr 2024 07:48:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVmWffHM5083I0uOYnpCoabdyHbFHU3WTHIFjj9tY9kWxn8hFywtc2cQBG19o8q+7SQ6oBV9nYmIB8iANPkFaoRCDj7pVtzps+X2PJ4Wg== X-Google-Smtp-Source: AGHT+IE7uLsLvLkCEhxlrHKvqPxrk8w9y0CuLwyhE5ChF27evAOkhykJkBGm+YOPo7NhQVb3E4HV X-Received: by 2002:a05:6358:342a:b0:17e:6a4d:777 with SMTP id h42-20020a056358342a00b0017e6a4d0777mr19363909rwd.19.1712155720403; Wed, 03 Apr 2024 07:48:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712155720; cv=pass; d=google.com; s=arc-20160816; b=AvFoYnYBiFh8bQwYD5zEBmfXG16Khjymdo77U+F8L5rmmQHkM8TEkn3tRZLMCM3BnK SwDnXXmFRxFodBNjF85s7WFtNxHgdpN1Amd8/idHDumCClCG3sJnEgDRXI60ZUkZPNGc MF11efrWptRFlNCZjfq1uPJIQB6yQ9q8rJy358aNIN10/EdtrgxxiGpuUObNqYu6xlbr V7FDzfhdlPqFE1KhFCk4OrLNLbLN7k6ZZLYzoNyackIa3ZkRkhcL6RxyIJdHzNCK6Fxx as1FZoQHZzUusOkfH9U68ncQAJ1KHe3xSxezfx2QTpz+ZSp/r3L566w9pFNlnlHvEr/f blsA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=VwyM9OdrH/2cOL5PBVYm/jr2+Jnksu1cpLmla8W++9c=; fh=gARoM2ZV7AoCZoIJXjSKNeAJW30rNoGKESrPH+AjQWM=; b=UttJVct3ueUth3Kxnbv3MUYPhG9WZK/dhk1Qkkr5eTLGE2he8hvWOuOGQtvWmPXcrY D/5Qh+E6EOZB39+hYT5/kfYxla57g8X3h41KEQ/+lkfqMjG2ECi4L406Wwp/ypiBkRXr yr8Rly3hZLD+mGMl07LnhKpBmwKLkaJRZMeJPYcUullHhHC03iIL0tTYMVvXxxL6ud/d qfT9r7fbXTD6f/SuXztHxXhIoKdTwKMs/LSG2BsIvvdV6wNMii04gnkdEu43xxQ3Ibgf t/drA2/j70W1ipunntMloz9YjdXZ+6QGZPwnfrhceV/xCZWuNd5TSgzmeTY3gOUha+a7 D04w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=fintech.ru); spf=pass (google.com: domain of linux-kernel+bounces-129999-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129999-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q28-20020a63505c000000b005d72fd9d73asi12929174pgl.602.2024.04.03.07.48.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 07:48:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-129999-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=fintech.ru); spf=pass (google.com: domain of linux-kernel+bounces-129999-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129999-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id F37E328CE1F for ; Wed, 3 Apr 2024 14:48:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 102DF14A08F; Wed, 3 Apr 2024 14:47:40 +0000 (UTC) Received: from exchange.fintech.ru (exchange.fintech.ru [195.54.195.159]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8470413AA52 for ; Wed, 3 Apr 2024 14:47:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.54.195.159 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712155659; cv=none; b=m6g0iZLRl+o9iC059ccTy/6vSFAhORfeE0iWlSLlDucHlu1YKKG/ArGfES9jhsUH193W2qRWvi1gIaHVfn6o0mKge981riljb5lW6bkAIdcOq6VbBl6pQmvNc2UsU95rphdEW5Cy8Kwx9fGCdlLEnm2Kv/TtY5nif/L9R5FEV9A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712155659; c=relaxed/simple; bh=8Pid9JdmhrcoZr0ymkIWECXLWqq8N6rDdyO+sMGc29Y=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PX5ZxfO2Y/J+qS/lzCTf14rh2xF0yvhPJxhsARW0LKOZI9VcKMbN2zpRtwYfhR+00UMiQVDo4GTgFOy+NKkVoOdKMrjb6HUn7/pUlfoo6SGEsgOeqvOk/Q4BWviREGjHOddcJ9bfAxsPOib4LqU94r3JWrzY99K0C91CNjr+7Jg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=fintech.ru; spf=pass smtp.mailfrom=fintech.ru; arc=none smtp.client-ip=195.54.195.159 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=fintech.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fintech.ru Received: from Ex16-01.fintech.ru (10.0.10.18) by exchange.fintech.ru (195.54.195.159) with Microsoft SMTP Server (TLS) id 14.3.498.0; Wed, 3 Apr 2024 17:47:31 +0300 Received: from localhost (10.0.253.138) by Ex16-01.fintech.ru (10.0.10.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Wed, 3 Apr 2024 17:47:31 +0300 From: Nikita Zhandarovich To: CC: Nikita Zhandarovich , , Subject: Re: [syzbot] WARNING in carl9170_usb_send_rx_irq_urb/usb_submit_urb Date: Wed, 3 Apr 2024 07:47:24 -0700 Message-ID: <20240403144724.14960-1-n.zhandarovich@fintech.ru> X-Mailer: git-send-email 2.25.1 In-Reply-To: <0000000000002592aa05bccabae5@google.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: Ex16-02.fintech.ru (10.0.10.19) To Ex16-01.fintech.ru (10.0.10.18) Verify endpoints in carl9170_usb_probe, leave with error if any are missing. #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master --- drivers/net/wireless/ath/carl9170/usb.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/drivers/net/wireless/ath/carl9170/usb.c b/drivers/net/wireless/ath/carl9170/usb.c index c4edf8355941..66d2ad561fd3 100644 --- a/drivers/net/wireless/ath/carl9170/usb.c +++ b/drivers/net/wireless/ath/carl9170/usb.c @@ -1069,6 +1069,33 @@ static int carl9170_usb_probe(struct usb_interface *intf, ar->usb_ep_cmd_is_bulk = true; } + /* Verify that all expected endpoints are present */ + if (ar->usb_ep_cmd_is_bulk) { + u8 bulk_ep_addr[] = { + AR9170_USB_EP_RX | USB_DIR_IN, + AR9170_USB_EP_TX | USB_DIR_OUT, + AR9170_USB_EP_CMD | USB_DIR_OUT, + 0}; + u8 int_ep_addr[] = { + AR9170_USB_EP_IRQ | USB_DIR_IN, + 0}; + if (!usb_check_bulk_endpoints(intf, bulk_ep_addr) || + !usb_check_int_endpoints(intf, int_ep_addr)) + return -ENODEV; + } else { + u8 bulk_ep_addr[] = { + AR9170_USB_EP_RX | USB_DIR_IN, + AR9170_USB_EP_TX | USB_DIR_OUT, + 0}; + u8 int_ep_addr[] = { + AR9170_USB_EP_IRQ | USB_DIR_IN, + AR9170_USB_EP_CMD | USB_DIR_OUT, + 0}; + if (!usb_check_bulk_endpoints(intf, bulk_ep_addr) || + !usb_check_int_endpoints(intf, int_ep_addr)) + return -ENODEV; + } + usb_set_intfdata(intf, ar); SET_IEEE80211_DEV(ar->hw, &intf->dev);