Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43FABC32771 for ; Mon, 27 Jan 2020 09:22:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 13A732168B for ; Mon, 27 Jan 2020 09:22:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580116937; bh=bcAtuLcbZ6GzEnrVrz90uVCiK/rezJ4X0q+L/SiC+CI=; h=Subject:To:From:Date:List-ID:From; b=zVcJfWNlUleLP0RNRUSgPyrOekd4UncMcE4jWr2u/HcUydCNS2KIMEX3Z1hhYPXh/ X9UO59eihmSnNRincL0XIybI3h1xu/IgiBzvSmXDyMBdkpwnmAuEusHrLN64AkyPft zJn/xqaW2Uw704yqd73qZf2SM4SP32HeQ1op2PfY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729142AbgA0JWQ (ORCPT ); Mon, 27 Jan 2020 04:22:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:40158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726191AbgA0JWQ (ORCPT ); Mon, 27 Jan 2020 04:22:16 -0500 Received: from localhost (unknown [84.241.194.26]) (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 E98BC21569; Mon, 27 Jan 2020 09:22:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580116935; bh=bcAtuLcbZ6GzEnrVrz90uVCiK/rezJ4X0q+L/SiC+CI=; h=Subject:To:From:Date:From; b=Usk/8AKTYidr2SR6AKG3BF+JUfJgpwFPWmC2kmUTMitoKQSV8LDBIurWJngPKClO5 q4inh3MCAp6Dn4oCo0Iq/zj418NhGMFGIup78xiJXuhopKPwOXwCOXyzpajFhUiy7F ziiU8F0t+EwAr0kFFDhDVdQYQJo9psEVPAWmu1B4= Subject: patch "USB: serial: ir-usb: add missing endpoint sanity check" added to usb-testing To: johan@kernel.org, gregkh@linuxfoundation.org, stable@vger.kernel.org From: Date: Mon, 27 Jan 2020 10:22:08 +0100 Message-ID: <1580116928181251@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This is a note to let you know that I've just added the patch titled USB: serial: ir-usb: add missing endpoint sanity check to my usb git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git in the usb-testing branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will be merged to the usb-next branch sometime soon, after it passes testing, and the merge window is open. If you have any questions about this process, please let me know. From 2988a8ae7476fe9535ab620320790d1714bdad1d Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Wed, 22 Jan 2020 11:15:26 +0100 Subject: USB: serial: ir-usb: add missing endpoint sanity check Add missing endpoint sanity check to avoid dereferencing a NULL-pointer on open() in case a device lacks a bulk-out endpoint. Note that prior to commit f4a4cbb2047e ("USB: ir-usb: reimplement using generic framework") the oops would instead happen on open() if the device lacked a bulk-in endpoint and on write() if it lacked a bulk-out endpoint. Fixes: f4a4cbb2047e ("USB: ir-usb: reimplement using generic framework") Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold --- drivers/usb/serial/ir-usb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c index 302eb9530859..c3b06fc5a7f0 100644 --- a/drivers/usb/serial/ir-usb.c +++ b/drivers/usb/serial/ir-usb.c @@ -195,6 +195,9 @@ static int ir_startup(struct usb_serial *serial) struct usb_irda_cs_descriptor *irda_desc; int rates; + if (serial->num_bulk_in < 1 || serial->num_bulk_out < 1) + return -ENODEV; + irda_desc = irda_usb_find_class_desc(serial, 0); if (!irda_desc) { dev_err(&serial->dev->dev, -- 2.25.0