Received: by 2002:ab2:68c1:0:b0:1fd:9a81:d0e4 with SMTP id e1csp459532lqp; Sun, 9 Jun 2024 04:19:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXLSGdfvK9vQshEGoENe5YWWOFoLddqnV+CfTStO2S1B9j+tMiaZ4+CGyNMdBCN1GYocbgqH3xDQ24SBcdascNFgDsq8UmsqW0UQ+FP5A== X-Google-Smtp-Source: AGHT+IHFpiBBhwtnhGrNeQ1VdrlX6Sy6lBZ6eCiwl47y4+5hMOWVAPDJ0JQlqwUe5DPVPbCboktN X-Received: by 2002:a50:a685:0:b0:57a:1aa8:b4ae with SMTP id 4fb4d7f45d1cf-57c50864ad3mr5688775a12.3.1717931981056; Sun, 09 Jun 2024 04:19:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717931981; cv=pass; d=google.com; s=arc-20160816; b=Y/0y7ISFVphaPi43h/i4HAs4raGXUJd2KzCv8VZZyrl/BwOshH/PekrCwe29MUkIwg KZSt+0w/gi07QepcnTSJMT7N3GTQaYEjBNMN5zNL2zj91w6NogoxxQHq2RSa5CKQDW+O QMYFWfn8Y5J77Zt6ZDHSEmJZa9/4/pT+B8eJmL4iaMcDaCzuE4ig6WwGiDyiLhZtz7OA s7N7FQZUWRfXjtkICvhe6fNOf8TTo/Za9ITEoH1CUT8gt9ay/X8zYoEnK97xeTIMylW4 3mPVUYje7nodtkxF3HtetkUypd+nJlVK+b3kRUzFWvm/QrIICccykvb++oIJh6jHfNuu Yp1w== 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=bh/MlqS7hNI5eIj3bpmc71PMnxB6liyATH2wuOfPabs=; fh=aYA7JSWc6StMhGI3ig8qznZigqj9lhIiRn7m+QnFq7U=; b=a9YVcbXX4c5Igy1Ga6N2aG9V87eR/IVLG7q8LQOddRCoyt4memWDUgIsw+Bv2FXbMN cblh4pqssZpcw4X4SDBu822rMDV9UwXVaMF5q3trHPX8vpta49Hla/vxATwx+rtrb5iq BXO//VK3r//nfHaa9DbWYu/BejjEvGnDfL2w2xToqkKeHIa5b3JChD7EO4PTtZWBdgSI wABJEmNzq++/BOErlNjIVNzjiywDP19dJeWxkwmA9R8fZcM2L1qi9BZkVM9bCM1mZUCP dnAXiwO8vf/PXEUAzwqzvatJpltImUxkGxenM4c8u+NI1c8IqIfyUxMX9tdaRsopQrq+ 6SXg==; 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-207342-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207342-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c77fb86ecsi547821a12.292.2024.06.09.04.19.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 04:19:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207342-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=fintech.ru); spf=pass (google.com: domain of linux-kernel+bounces-207342-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207342-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 am.mirrors.kernel.org (Postfix) with ESMTPS id C200C1F21662 for ; Sun, 9 Jun 2024 11:19:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 17A752E64A; Sun, 9 Jun 2024 11:19:35 +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 B12611865C for ; Sun, 9 Jun 2024 11:19:29 +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=1717931974; cv=none; b=iyJbCKx/g/uzKvjD77BtP3rWuAL4Hd+OQF1eNJ9wdOSPGniJERpXAG/AUyFl6uDlMJtNwG+u/FPdMchCm7ksdZqzw/kQd8z1Zz5i4cZfmgJ7NIiu0hHddULutcDyeN89hZ13VlMAdaHxunjaZlouOLQZUPDty1M3nbDV94QdCT4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717931974; c=relaxed/simple; bh=+V8Zax0iRwxHQ0eU9iOFL0Cw7Djo8PAj80uDzHJ0ARE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MzmrCyhs23KKQYsxi919SX0YMQxSiPoKqBZCHBxQCx7Hq1UYPYZOPaEVqh8MhpDmMOAfZPctlsbjmGhVsDA+YjedSoSOgi4p5y/ZTwxaB4T1uDuk+Mpx0xxO9ta4w8DHNX355OikODJfGQUlmeN4hI4s65O6vKxPRQDaMUP7bVc= 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.169) with Microsoft SMTP Server (TLS) id 14.3.498.0; Sun, 9 Jun 2024 14:19:20 +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; Sun, 9 Jun 2024 14:19:20 +0300 From: Nikita Zhandarovich To: CC: Nikita Zhandarovich , , Subject: Re: WARNING in cxacru_cm/usb_submit_urb Date: Sun, 9 Jun 2024 04:19:14 -0700 Message-ID: <20240609111914.3620-1-n.zhandarovich@fintech.ru> X-Mailer: git-send-email 2.25.1 In-Reply-To: <000000000000d2c99705a01ead04@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) #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master --- drivers/usb/atm/cxacru.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c index 4ce7cba2b48a..8f3b9a0a38e1 100644 --- a/drivers/usb/atm/cxacru.c +++ b/drivers/usb/atm/cxacru.c @@ -1131,6 +1131,7 @@ static int cxacru_bind(struct usbatm_data *usbatm_instance, struct cxacru_data *instance; struct usb_device *usb_dev = interface_to_usbdev(intf); struct usb_host_endpoint *cmd_ep = usb_dev->ep_in[CXACRU_EP_CMD]; + struct usb_endpoint_descriptor *in, *out; int ret; /* instance init */ @@ -1177,6 +1178,19 @@ static int cxacru_bind(struct usbatm_data *usbatm_instance, goto fail; } + if (usb_endpoint_xfer_int(&cmd_ep->desc)) + ret = usb_find_common_endpoints(intf->cur_altsetting, + NULL, NULL, &in, &out); + else + ret = usb_find_common_endpoints(intf->cur_altsetting, + &in, &out, NULL, NULL); + + if (ret) { + usb_err(usbatm_instance, "cxacru_bind: interface has incorrect endpoints\n"); + ret = -ENODEV; + goto fail; + } + if ((cmd_ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) { usb_fill_int_urb(instance->rcv_urb,