Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2234887imm; Thu, 18 Oct 2018 11:08:28 -0700 (PDT) X-Google-Smtp-Source: ACcGV60pp4sLbYDs6yGd9lB2CJrUNehJH4NsJ19IIRe93dBvYD836WTwljZhrfyajNTXwr4X3vwS X-Received: by 2002:a63:6d0a:: with SMTP id i10-v6mr6367804pgc.215.1539886108780; Thu, 18 Oct 2018 11:08:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539886108; cv=none; d=google.com; s=arc-20160816; b=auRb4me/8PMEXkWERjwoTgjqXVK4WDXTcdBZSjF4MfkyI6ak0FDa52Gr3djWxwnDRR OvYKCwYsq6uGkNrLqtO7yL/GzmqP4eCLNEf5Pc8d9p/jChvWZjSJJlniRtZPCIPa6Sko chkJplkdz6mHRMTtzosjvOC4Iu76PKoLa/tUceM+7pep67buGJmeMH1agsNKdFZVhvxh jnHvPpfJBjRK/P0mt+8Sr+LQHGmdhnSlQwzswSshyYytiMExfwMmCPS43eXOL35xk6hp 5WH26sqfyFYV/RqQT4h53+gZLvCoqSjKF4yGClZrJc7pP8a1oR0F7yDO3n35TkgW2O51 t7xw== 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=GtYbzMpBkMK7a2VwZQjG4y6LszV5MYuxNlMl5Sv6Nu0=; b=Yxco89pcrzI+HePiVKrG8cq1txGLBxrfbULlAF0VkdM14sFVMJWFup8pafvZzPh48E PBwwsZqBQJW3EoN7mpTYHw9oZygKrr5ye0avflSkkaolGzkKk6k8ES68g7YWUtW60fYT BZPUH1VWxiOIcRfAhJeoO+mvrsId9Oma9+F81zoWT/VOC7NuC9zPYLG7JvIJeezA4my4 jGOM3cN3dagb3EMBcPhqKgP6OoTJBb5AjErZA2w3rQFy6DlrNnEZ5kzcbfK4Fs5gGBfW 2pBAopwQAZACUL8DuRZSIkfBLOUMdUb2EpORLl9NfWh0tBTDbyNHmK5YuNvCLePlToxJ yJIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zxpAikMu; 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 s130-v6si22764581pfc.81.2018.10.18.11.08.13; Thu, 18 Oct 2018 11:08:28 -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=zxpAikMu; 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 S1730352AbeJSCHy (ORCPT + 99 others); Thu, 18 Oct 2018 22:07:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:56718 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726599AbeJSCHw (ORCPT ); Thu, 18 Oct 2018 22:07:52 -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 E47F520658; Thu, 18 Oct 2018 18:05:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539885945; bh=yzXk4Ds8kXJZgZ23D+BCghZ49CK1iwYKuAjN7TW/8wo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zxpAikMumGZ9ZymIls20mZLxbkOHHAXX9CNMNros//y8RAwvMKdj3vW9aPrveqIqM 40OMsP+B3SFpIN75hLk+qsLODgvvuuH2gSiVfplnuKgSw8dx92aI8+gBgkqB6qP3FN Uh2I40c05VpQjVy6Mnu2ysR1kealQWgQyqJH217U= 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.4 25/48] net/usb: cancel pending work when unbinding smsc75xx Date: Thu, 18 Oct 2018 19:55:00 +0200 Message-Id: <20181018175429.333929086@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181018175427.133690306@linuxfoundation.org> References: <20181018175427.133690306@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.4-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 @@ -1506,6 +1506,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;