Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp139183lqb; Tue, 28 May 2024 10:59:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVpSBPxNTZh5DHxXLKAk7Lx9qsNzUolSUq1BInQlfsUUQSDCtbRKdvPNB0H36x6FVoYVBL4S4I3/WFFdgah3UqMo3bZeMrTo8hcJNIlOA== X-Google-Smtp-Source: AGHT+IGEoGM37HK0gipyx26fACpW4970dwVcAG7bOGlSrEpb1ZhPQodjg6FqupzICK5e5r+CJbxx X-Received: by 2002:a17:902:e849:b0:1f2:ff65:d2e0 with SMTP id d9443c01a7336-1f449026bdamr162757775ad.42.1716919174758; Tue, 28 May 2024 10:59:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716919174; cv=pass; d=google.com; s=arc-20160816; b=Fnv4Cke44P0/FAIp8Aj2l5Spu1QSUl1AtNVc3NAB3KAOqLkPg2x90RvmMEcIkyMeYx 6v2QExdvhIJpsA5iPm9tFqzluEBRy0MRI1ICRW83+EaYfm0JHTAtOmQAIuRLnyRBWYuK SLHmmkFavnvYfA8t3uL67xy0RZelPaDDdWjRTARsdcEBDJdd6rsUl0jHOldRBS6iW7Yu Nal67eSG/bGxqNgYQhWXtT6ZozfIcL7ffWnYPMeO7PVLqQyunb6j50jHJpl/3I5Ii6/F IdN2tAmkn+NdlIjaviN92pWUVQbSwY6u07K7AqDXMBMQDg49JnIajIWtq5v/mfSofjwA Z1oQ== 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=iqY+eGbr1H2LtC6xi3WvG4pe9J9LzgkeQnZzBqNPJCU=; fh=aYA7JSWc6StMhGI3ig8qznZigqj9lhIiRn7m+QnFq7U=; b=J/QkxN16u049U7lVU26jLZ6cm3bBT/1snS9xJqgm9j+PaJ7XagYgCZivqAaD2dAzT5 atmRV+qlQ4BoN1hZHEBWH+6Vg1Lqr6t4olh5aUMGNwXULRtnKlhnnS2r/+dCrMoCW5AO kCnL8/PV1SAWgs1yeIViPfdy6avOS1ILPMH0FtVvkBNxJxkvXcUN7i5SsY5Z0OIjI0Ok Kj56AMoHv87aY2Se/180LQcqhCm0P+oj/DHjGvZ8NYvFJ7bKP8ovTgx/KKv3SQfpsakN klFGeSX6tr9aVWiE/q2a70/xVFpINUEm6ZQ1Re+6Sg9bUEnB6Ag+tEuZI0vxw2wSFd7v yugg==; 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-192833-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192833-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f44c99c8efsi83842705ad.373.2024.05.28.10.59.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 10:59:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192833-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=fintech.ru); spf=pass (google.com: domain of linux-kernel+bounces-192833-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192833-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id C7D92B224A6 for ; Tue, 28 May 2024 17:59:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4AD3445C07; Tue, 28 May 2024 17:59:25 +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 3B8EC446A1 for ; Tue, 28 May 2024 17:59:18 +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=1716919164; cv=none; b=larcaTNG0IJfX34bDWA4p/wJSMU9iodIJSeQHzjUPozhl4u1hEtNXBjPyR8vjRRm66RafifQpd3bUjAWQpqSX6HlmfWNB/CPUUgMtTKvJQVR7W0lH34gCoOXNdWTiMNNBOvrxXJUVmhHaPqaLEXNGJU+QxRlQ2bUdcqWRFbsg1Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716919164; c=relaxed/simple; bh=xdleK44FgukP8bWDJjnH5QvLaMzO588N0cV67F9/bd8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aO14fwBovdaok40Zc7FTWCXa8Elwz+QFf1LELajiEjFDgPCq0cXYd3TD63bjWdz7BW9qpTuG0kei8L/IhiZNL4hXnOzoFhveOLAuLxF1NXRz8EvAvnXMMjGmumTr+3gbwGUhpiAYy78cNArXBFif8bjBc1IaP9NyL2RpH0oKiKs= 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; Tue, 28 May 2024 20:59:16 +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; Tue, 28 May 2024 20:59:16 +0300 From: Nikita Zhandarovich To: CC: Nikita Zhandarovich , , Subject: Re: WARNING in cxacru_cm/usb_submit_urb Date: Tue, 28 May 2024 10:59:07 -0700 Message-ID: <20240528175907.3525-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 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c index 4ce7cba2b48a..8a8e94a601c6 100644 --- a/drivers/usb/atm/cxacru.c +++ b/drivers/usb/atm/cxacru.c @@ -1131,7 +1131,8 @@ 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]; - int ret; + struct usb_endpoint_descriptor *in, *out; + int ret = -1; /* instance init */ instance = kzalloc(sizeof(*instance), GFP_KERNEL); @@ -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_dbg(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,