Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9093603pxu; Mon, 28 Dec 2020 06:29:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJwhZ9+vkgoNVhg3yvZuFeHYpsyZ//EpDLcPG3wJZnMtDjZc+VcVOdBEiBa/ydf9bQz9hA62 X-Received: by 2002:aa7:c891:: with SMTP id p17mr14740349eds.309.1609165760481; Mon, 28 Dec 2020 06:29:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609165760; cv=none; d=google.com; s=arc-20160816; b=yy7+QBrDrW3dKK35DZ/2LiYpwJvo2uDXLmQoxYhZ4jxDaJytV+ZaxyuKnoZizEJqTR yMSLRcqyEN87Wf7qiTdWlSoD/jVzNDwCgw8Ievc+TH+193nLzDeNLy7JitbEki4mugtp RMx1KxhKcXngq5sbbYJkQgnlo0+AbJ25P48KBhhr1K9F7QUXTDFIYA3uNB4rWsGEh8+E WbiMq53aPb/XQO2B4V8BkTGpTsOt++Y1Qvxhln4OvD8+VI9fvVb2rtp22zrFJCPToeVX q2CnGkYHViouPZUHoSg3NExSUAPTY4JEqtEkpezLetAwg+LkLQj04jvxJfzvsodhX4kr ix7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QZLvzUzOLGn7sVcaDhKpc2BxN5x8uk8zX4EFVjLfnxs=; b=mN8Fbd1/cjeCwoksqbilBLVVCYWoQTcLrvzvpQ4FKIEhKk2brio0UQtA1OS+DgPwcW BwKVCBMWyhUvXy85PMoEiafa3oai6qYBvP8aHnvNZOWUpKf2tfDunw6fzypv6k6JDnjW nDaWDxD028tPOipdS7yjiqzhdv6DNndEWZF2tUNxEQSe9h7o7T70UoFVGiePvfHLQjeJ t/HRI1nHB4hgUvXGUhYGfTzNqVNASPJuRuakrgFsyYHpw8HzE2HSQRSidURhsfmvBKrz 3wiEUqw34Bk0Jlc6PwJlArbG9CoeFgaPiTWwGo3cEov6mIv1/xlRgkdC23oLXgTk81r8 +FHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aqfDRoE6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s25si18507906ejz.414.2020.12.28.06.28.56; Mon, 28 Dec 2020 06:29:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aqfDRoE6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2503908AbgL1O0v (ORCPT + 99 others); Mon, 28 Dec 2020 09:26:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:34320 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2503871AbgL1O0n (ORCPT ); Mon, 28 Dec 2020 09:26:43 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E7F7B22C9E; Mon, 28 Dec 2020 14:26:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165588; bh=ZVH6mPmmfFa3nYou8QGvUJ84cqwMDtba7EMR8XuKack=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aqfDRoE6gF0R44zcwM289BhlBZyLmHWZdvgyptEHUn7VIGF2SapXpMhjJCVOS4/aw n5FcJzsUMw30NO7NPoA8tor0TaGiAUthjFOYWtr6jQ69MDBcnXV/Queh1H7sNhVqhp 3mYJJHt4kltq8nASNrspmjJpo+MVcFPYsqqFQYxI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sebastian Andrzej Siewior , Johan Hovold Subject: [PATCH 5.10 585/717] USB: serial: keyspan_pda: fix tx-unthrottle use-after-free Date: Mon, 28 Dec 2020 13:49:43 +0100 Message-Id: <20201228125048.942385623@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johan Hovold commit 49fbb8e37a961396a5b6c82937c70df91de45e9d upstream. The driver's transmit-unthrottle work was never flushed on disconnect, something which could lead to the driver port data being freed while the unthrottle work is still scheduled. Fix this by cancelling the unthrottle work when shutting down the port. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Acked-by: Sebastian Andrzej Siewior Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/keyspan_pda.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/usb/serial/keyspan_pda.c +++ b/drivers/usb/serial/keyspan_pda.c @@ -647,8 +647,12 @@ error: } static void keyspan_pda_close(struct usb_serial_port *port) { + struct keyspan_pda_private *priv = usb_get_serial_port_data(port); + usb_kill_urb(port->write_urb); usb_kill_urb(port->interrupt_in_urb); + + cancel_work_sync(&priv->unthrottle_work); }