Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp831032pxu; Mon, 23 Nov 2020 05:24:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJyCfrMfzTG1WzMD2UNzE7ILnTE2CZYWaG2SFS6IrH27dXnMArJvpAjF+KTXmI9Gj3ocjs8u X-Received: by 2002:a50:da4b:: with SMTP id a11mr28917465edk.364.1606137891108; Mon, 23 Nov 2020 05:24:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606137891; cv=none; d=google.com; s=arc-20160816; b=Sr9hAkhjJc4+RvRQaq9ly1B1Ro9J0ELFZVcMWjvB6jyUBnv3CAfkU8jeOi62w964dY 5UbCApvS3mPI05v0wTM/1UWOCseDz1cPn6B5avaLISnZKnEMLPLfwWrWj6zMI1hRY8ex tdVNZ+t8lmUwqDLfEHeoU555d36FWSZY+YcmhcaNYKalshMVhBqXXyinfldhkKTnXjJa /rDlhFRtEQb6jKt5a0njlGXDalJHl5b3B8uhJZvmeVZYPDaPxDWXPMDNCMCSvUfY/1RH J63TCdv7eH/0dEEVUegzG3xiTemGagT4zsmHaWie6284QSkWBoZJOEO+4SNadVn8cV34 OrCg== 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=VvZqbe/m57voXAbISfTER0UhIsmJDcNsg/56lrGRnVk=; b=ntB58M/WG4+74gWSv+QRhp2GPcjt63sVWycr4EeGnCUP7H4ZKgiOoFg5hvJ1YJD6bt QJC49Lu7jOPjf4pATTrcVmEX/6GiuFT+k90VAZSrJV4BpIPhmNSwfRLmXHi310MRMz9P 9z12tdjS3a2TQpYwhVCOZVsC0Khdn/OxOYoan7+hu60/MTHlipaDZBnz5NcJPcU6y3G9 Cf8xaoZtfggCvJhhau7uKBiM4FPbhaOBROjm3cstCbHV8JquGrzQFIbaQVIioBS6NAjw aRW66pyrNXS7HwRjf9fy45iNhB6MkoA+01nd+TKQdCGTqUVj4BxuaR5KzxgjSAD6ZzTw GHVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uqLyNM5i; 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 p18si6526754eds.125.2020.11.23.05.24.28; Mon, 23 Nov 2020 05:24:51 -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=uqLyNM5i; 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 S2388958AbgKWNVx (ORCPT + 99 others); Mon, 23 Nov 2020 08:21:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:49206 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731836AbgKWMhF (ORCPT ); Mon, 23 Nov 2020 07:37:05 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 3FECE2076E; Mon, 23 Nov 2020 12:37:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606135025; bh=Fc+q8plv77TCEO0lkPydaAS+X4W4FvBQ8GetlqcipGk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uqLyNM5iUoFV3blwLP6taebPn7Q8R8Uodw1T+c+YljX2OO3hpLmK69rtk7wlIvp5w BHKU/80Caa/lVuhpmaVQ1eaqrtVcfOrA+fN8KywMCB6AjPeQfXPuJbvYGVEM+OMKSD Q/CXrmNGHhbqFrc8iJrcSuM/RmeE5BZXOJ7VmhRo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Loris Fauster , Alejandro Concepcion Rodriguez , Marc Kleine-Budde , Sasha Levin Subject: [PATCH 5.4 077/158] can: dev: can_restart(): post buffer from the right context Date: Mon, 23 Nov 2020 13:21:45 +0100 Message-Id: <20201123121823.653901394@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121819.943135899@linuxfoundation.org> References: <20201123121819.943135899@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: Alejandro Concepcion Rodriguez [ Upstream commit a1e654070a60d5d4f7cce59c38f4ca790bb79121 ] netif_rx() is meant to be called from interrupt contexts. can_restart() may be called by can_restart_work(), which is called from a worqueue, so it may run in process context. Use netif_rx_ni() instead. Fixes: 39549eef3587 ("can: CAN Network device driver and Netlink interface") Co-developed-by: Loris Fauster Signed-off-by: Loris Fauster Signed-off-by: Alejandro Concepcion Rodriguez Link: https://lore.kernel.org/r/4e84162b-fb31-3a73-fa9a-9438b4bd5234@acoro.eu [mkl: use netif_rx_ni() instead of netif_rx_any_context()] Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- drivers/net/can/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index 448d1548cca39..5b8791135de13 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c @@ -567,7 +567,7 @@ static void can_restart(struct net_device *dev) } cf->can_id |= CAN_ERR_RESTARTED; - netif_rx(skb); + netif_rx_ni(skb); stats->rx_packets++; stats->rx_bytes += cf->can_dlc; -- 2.27.0