Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5450861imm; Tue, 16 Oct 2018 10:24:31 -0700 (PDT) X-Google-Smtp-Source: ACcGV61z2LOhSOkUusxb5NI4KRhKPUmNQshs44HwiG1CkVAGxpNttj2203byPDgskAjR0rybE8aO X-Received: by 2002:a63:82c6:: with SMTP id w189-v6mr20837306pgd.211.1539710671685; Tue, 16 Oct 2018 10:24:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539710671; cv=none; d=google.com; s=arc-20160816; b=e5qv7bvtCN+3wn+tjTtwQAJds2v7hMqiJ7aDHm+/22AR9C2L/9d5O61eSlheMQn1jO henPiiRL8sTk/Ez0vJueIo9hjSeM821ex0VsSrrUkzDUSwv8jHQ3OTarM4oKPXVWO5Fh C/TPRh6PI5WnkXaDOPOoO0SSHmPFm7bBe/5Lu4ecPcVZFB2zi4MgRgyBurMBvBlo1XDu CDKsEuOTAno0wEIWd4wL12gg6mGoKmZ4js2MdB8EO/hoWYzNNcc2b6hqfyOgKL++gq7Q zBeIz07zHO1WJB3sI3TONDnZ+cjDn8/zn21Xl1L3zSNqtHO45H9fLjbIrfIbLSX04Bkx 8YHg== 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=BuQUq3yYs+NY83xOx07Jyk0qc5In0C5myxzcRfrs15Q=; b=QyuYbQaYUFznjHOmCR2czubLcSUz3Y6Fq1O3Y1Jp4SRdsiOgpwOJRywuMxahfPMNTj hcvkLub1rtwt3qFnXOLFUJXGxPnYjvxw2Avg5WjvPBqbdC6ETAZXU7T14e64bXmT6w2X +ks1wFQEKAnXKpVhklM6mQUUrOZ04vVK6JtknjQbRJcIRNCLSz+lSxz7Ilml2qiavbwt IdrbzhgXgyTHIt4Pl6UiZmZel0xLLy5BRuzY8vfZN2yTKeeY9kW3lDsoMye/NS2iKsjX yrhQu3phk6yIQPOuqDc5qOdiC/inu35GsXXZ9b7U2XfIY7MWp/e+7mXvFkIrAvVSi76u anPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=B24+AzOT; 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 31-v6si11294952plk.329.2018.10.16.10.24.15; Tue, 16 Oct 2018 10:24:31 -0700 (PDT) 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=B24+AzOT; 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 S1731512AbeJQBPR (ORCPT + 99 others); Tue, 16 Oct 2018 21:15:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:33830 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730396AbeJQBPP (ORCPT ); Tue, 16 Oct 2018 21:15:15 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (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 85C3220658; Tue, 16 Oct 2018 17:23:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539710630; bh=q9pg6onKtId0S1eej/hzEEnbQLVbx0JdJDekhYnYHnY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B24+AzOT1pUVqhcbB5m0lSaBQCNAk2vMtRCn7EsiuusgZtF8CXWK05K0hS8KrWV7F bLJ//yaq5ua9UpLZnUIBW62Pl34bxHRqCSFTd1jWVYhbFbCX7VZfiGmu3RZXCepZv3 P8NyljorbkGqrcla10V/wVgXQUWD4+Bq1QGlyvVM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yu Zhao , "David S. Miller" Subject: [PATCH 4.9 33/71] net/usb: cancel pending work when unbinding smsc75xx Date: Tue, 16 Oct 2018 19:09:30 +0200 Message-Id: <20181016170541.053284987@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181016170539.315587743@linuxfoundation.org> References: <20181016170539.315587743@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yu Zhao [ Upstream commit f7b2a56e1f3dcbdb4cf09b2b63e859ffe0e09df8 ] Cancel pending work before freeing smsc75xx private data structure during binding. This fixes the following crash in the driver: BUG: unable to handle kernel NULL pointer dereference at 0000000000000050 IP: mutex_lock+0x2b/0x3f Workqueue: events smsc75xx_deferred_multicast_write [smsc75xx] task: ffff8caa83e85700 task.stack: ffff948b80518000 RIP: 0010:mutex_lock+0x2b/0x3f Call Trace: smsc75xx_deferred_multicast_write+0x40/0x1af [smsc75xx] process_one_work+0x18d/0x2fc worker_thread+0x1a2/0x269 ? pr_cont_work+0x58/0x58 kthread+0xfa/0x10a ? pr_cont_work+0x58/0x58 ? rcu_read_unlock_sched_notrace+0x48/0x48 ret_from_fork+0x22/0x40 Signed-off-by: Yu Zhao Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/usb/smsc75xx.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/usb/smsc75xx.c +++ b/drivers/net/usb/smsc75xx.c @@ -1518,6 +1518,7 @@ static void smsc75xx_unbind(struct usbne { struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]); if (pdata) { + cancel_work_sync(&pdata->set_multicast); netif_dbg(dev, ifdown, dev->net, "free pdata\n"); kfree(pdata); pdata = NULL;