From mboxrd@z Thu Jan 1 00:00:00 1970 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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, 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 E62D4C33CB1 for ; Sun, 19 Jan 2020 13:40:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B848F20663 for ; Sun, 19 Jan 2020 13:40:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579441230; bh=vhQU/9/6FHj0TJUS90EDpgmjiu0ZhV/PWygjo5wpVqY=; h=Subject:To:Cc:From:Date:List-ID:From; b=TPvgAtuCTGfF2u/geBR645BxF8D+n9C/PPrlUaw3/+3HobnkCZ/0Zdc0ydD9aCbmH MUyvp5h6qXw0hlpiRnNf6bgUconPqIx2agJEZcn0rAYWvbs2uI/dNndrA3VfK+LP72 6xgRbew2n65TmtFoZ+UOcA2nZG+oL4HhgHEQERW4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726798AbgASNka (ORCPT ); Sun, 19 Jan 2020 08:40:30 -0500 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:42347 "EHLO wout2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726778AbgASNka (ORCPT ); Sun, 19 Jan 2020 08:40:30 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 40D66544; Sun, 19 Jan 2020 08:40:29 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sun, 19 Jan 2020 08:40:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=yzulsE 52YV33yRppOiIjc+9z5fFdxcOVyvb6Luh1ymc=; b=jrKnv4AYMR5ueXeFbIxz/D YrI5/DNcA/gbXCQrYLWLWENlZn/saHywKGVpO8biKr8xQin07D1DU4WFZUsVHJvk D36a/jixyWlhabTmh3zlkIOhzCj6kYkpVuTABjCIBt5QVU+9udA9FI8f8Dz2OYpo KLUTUDH8ocM9ZP274aCrmmPXFv9ZDeCPhoatr233c7LtF0R9modQTtvxfjqFV9Jm pvFT+mll/cxCM6RY1sebNkGYdtkWapvwxI/woi+Gu2iGI0jues/91GvYeirEWexg Fi+Yduglt2sn0BigjPPSFjwcvC6kLxe8lk6JIUzSvcPbCSmXd022SQHr1oS/n6TQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudefgdehgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertddttd flnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhg qeenucfkphepkeegrddvgedurdduleejrdeijeenucfrrghrrghmpehmrghilhhfrhhomh epghhrvghgsehkrhhorghhrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost (unknown [84.241.197.67]) by mail.messagingengine.com (Postfix) with ESMTPA id 2E3A48005B; Sun, 19 Jan 2020 08:40:28 -0500 (EST) Subject: FAILED: patch "[PATCH] USB: serial: io_edgeport: handle unbound ports on URB" failed to apply to 4.9-stable tree To: johan@kernel.org, gregkh@linuxfoundation.org, stable@vger.kernel.org Cc: From: Date: Sun, 19 Jan 2020 14:40:26 +0100 Message-ID: <157944122699135@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 The patch below does not apply to the 4.9-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From e37d1aeda737a20b1846a91a3da3f8b0f00cf690 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Fri, 17 Jan 2020 10:50:23 +0100 Subject: [PATCH] USB: serial: io_edgeport: handle unbound ports on URB completion Check for NULL port data in the shared interrupt and bulk completion callbacks to avoid dereferencing a NULL pointer in case a device sends data for a port device which isn't bound to a driver (e.g. due to a malicious device having unexpected endpoints or after an allocation failure on port probe). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c index 9690a5f4b9d6..0582d78bdb1d 100644 --- a/drivers/usb/serial/io_edgeport.c +++ b/drivers/usb/serial/io_edgeport.c @@ -716,7 +716,7 @@ static void edge_interrupt_callback(struct urb *urb) if (txCredits) { port = edge_serial->serial->port[portNumber]; edge_port = usb_get_serial_port_data(port); - if (edge_port->open) { + if (edge_port && edge_port->open) { spin_lock_irqsave(&edge_port->ep_lock, flags); edge_port->txCredits += txCredits; @@ -1825,7 +1825,7 @@ static void process_rcvd_data(struct edgeport_serial *edge_serial, port = edge_serial->serial->port[ edge_serial->rxPort]; edge_port = usb_get_serial_port_data(port); - if (edge_port->open) { + if (edge_port && edge_port->open) { dev_dbg(dev, "%s - Sending %d bytes to TTY for port %d\n", __func__, rxLen, edge_serial->rxPort);