Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2101066ybl; Thu, 30 Jan 2020 11:22:21 -0800 (PST) X-Google-Smtp-Source: APXvYqzCCUf4roMVRJTVImvb1rE56Dq0hrNhLmPb5/lc/8DcnmToLnrXrUpyLFfladDopo9WTEzC X-Received: by 2002:aca:59c2:: with SMTP id n185mr4000178oib.170.1580412140994; Thu, 30 Jan 2020 11:22:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580412140; cv=none; d=google.com; s=arc-20160816; b=YjhbAdwKFxOaeicgzqN3nicqWtPVRI28fFhIPmgklSfF7M8+po0ufvvC48C5Ig/twI kkgb+6kQ5CG0NVaG+7NfKDJMNcSKbZrQ7VFV17lqSk2iQR6KwDDYfkgbqJ34rK8y06QR ARXL0l0K/gRqHcS+rYsQFQ/FGyhXt1DCpSc10uBvWlc2x24rKKsBUxSLskDMDw2ViQe3 cuy7EG8M5iC//IlScF8lDOR+hxLpsXURe8fkV0fMahUsADjpv/UWL3Oo3QAkG5G1hIAe q5RvE+CynmgtyIuo98SOeR04berroSduv2Xd9/JTXZmsHOqmCtwZUMP4VPZOFRLSIZsF WSlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9IbrhojrYAPh9S0iY82djFrYc6e5Vjv2Jc30r1cTdw8=; b=cQnOYZ8Fn5BE1Bdkz0rypM0hRng/7vVKKJA1ekzyrpB0t7VyQMWjhL5oKJ/FnWfH2r EHd9QnkYum81vCxBw0A0Q8QKMMssWgJvx/B1MYbizRE7GlhHUGEaRY5aK1kQqem1tJDW RrQvGw3+nyLVPPzhgiONz8xiXsKm0A1TeVuCC98aYnyb9/+4kFkleevkXOy4G2EZs/ix R2S3txYXzK4PKHe8ayOA+X3xrN86BlTWBRUa4cqWFcUuc31z6UJVCBCGlGt7AR+5lPHV WD0sOxcQr679X/bY5T47HFLIyAUQ8AU/16uyVPzbuma9+jmyB5cNnUAxb2TMFNSphoXm ifBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FcMlPDzw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r22si3199959oic.93.2020.01.30.11.22.08; Thu, 30 Jan 2020 11:22:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FcMlPDzw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731680AbgA3SxP (ORCPT + 99 others); Thu, 30 Jan 2020 13:53:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:50372 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730331AbgA3SmL (ORCPT ); Thu, 30 Jan 2020 13:42:11 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 127792173E; Thu, 30 Jan 2020 18:42:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580409730; bh=rkr4v3w3gcxDIUGXLSQY/xRcj719qPpxS+Rw5Z/tExw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FcMlPDzwJvuE/a6PAQ8HRKhqDOwe64+BqSkjNCfJdmKUfxIA56/2WASTcZvet5Wew dOtL/GmINYqVJ0pd75uox32TRRDh/2UAWqv95GkG+Cy8HL4V7HBNsdtLjcdw/WZ/WT kEfMcrSr++GoCMevkHrXQUCBLimtvMyTty4TMrXI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fariya Fatima , Johan Hovold , Kalle Valo Subject: [PATCH 5.4 003/110] rsi_91x_usb: fix interface sanity check Date: Thu, 30 Jan 2020 19:37:39 +0100 Message-Id: <20200130183614.333507488@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200130183613.810054545@linuxfoundation.org> References: <20200130183613.810054545@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johan Hovold commit 3139b180906af43bc09bd3373fc2338a8271d9d9 upstream. Make sure to use the current alternate setting when verifying the interface descriptors to avoid binding to an invalid interface. Failing to do so could cause the driver to misbehave or trigger a WARN() in usb_submit_urb() that kernels with panic_on_warn set would choke on. Fixes: dad0d04fa7ba ("rsi: Add RS9113 wireless driver") Cc: stable # 3.15 Cc: Fariya Fatima Signed-off-by: Johan Hovold Signed-off-by: Kalle Valo Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/rsi/rsi_91x_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/wireless/rsi/rsi_91x_usb.c +++ b/drivers/net/wireless/rsi/rsi_91x_usb.c @@ -117,7 +117,7 @@ static int rsi_find_bulk_in_and_out_endp __le16 buffer_size; int ii, bin_found = 0, bout_found = 0; - iface_desc = &(interface->altsetting[0]); + iface_desc = interface->cur_altsetting; for (ii = 0; ii < iface_desc->desc.bNumEndpoints; ++ii) { endpoint = &(iface_desc->endpoint[ii].desc);