Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1328882pxu; Mon, 23 Nov 2020 18:45:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2sWq1H1mXhwcQ2DXjHdbsfVL0ZAkBI1xi4ONj91Cb6AXInO3n0m62zs67OhdYcSZDKEeu X-Received: by 2002:a17:906:b80e:: with SMTP id dv14mr2198243ejb.528.1606185925869; Mon, 23 Nov 2020 18:45:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606185925; cv=none; d=google.com; s=arc-20160816; b=TpLZizPfNRyXb/DPM5d1GTLruWZp3ysPuBIO0ABZHGTQP/KB+eeeIPa9hwc08NHuDj O2+5sDZpGH4G9FebTvzu4HcI6iorsFw5bV3q21RC1KWbu964qJ77rBx9V9fIV+9qGZCe CthWPsfeJ28yXN+rQiP/ywIa4+OR1YdK61JBHw76sUiidz09D7NcUS53W5a9oNKonSrW az9oYeLYAsSetgfCTJoRf8vmGFMw4v3+jefNYZTuKwZ3DeydjOwRbwXE5u53Je6tn/Uv 7q7pihI5enA2u6A+qsAkY0RzXnTvBkoAulg5Hlcjxbo2MsVJKlZyBW/dBnm+LeYM0Wuj sPUg== 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=hY3fbQUzsxupICOGgNQNDrXMKFoG9xSgNfCGxOJDFC4=; b=0cF2tKrEwgGrD6BWsc/u3daLrNHIpMvENHomeGgW36fx38UKzt8RsqTwAw3L3Es2yI WsWsjSKGS/PdvLopAvYY8BfJQz6g8ADxuNGdEqFhJDHk14eendEgoIVbULgoSx3tbzib 9dcjxiw4EtkR+7n9Ex8NKJNqOubmW/SKAotqqkwALJ2Im0mOFuHiW0U6EZ74/0Xrbp0z 6lsfnuLIZMsb8EnEQbuCRJDvA/P4DrQU33DbXXCmG8WeVWzc4ZvCQv34WqtIHrARZTgL OTqeVKHhGHYODUMwxghpaCXvHInrZT7sB97qnPNM0PvY7krrr75l0ZOFgQNk/UV2rHj8 kOoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dLY56uSi; 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 n10si2148027edo.182.2020.11.23.18.45.03; Mon, 23 Nov 2020 18:45:25 -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=dLY56uSi; 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 S2389106AbgKWNa6 (ORCPT + 99 others); Mon, 23 Nov 2020 08:30:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:37832 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730356AbgKWM1t (ORCPT ); Mon, 23 Nov 2020 07:27:49 -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 868E320781; Mon, 23 Nov 2020 12:27:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134468; bh=ZCJqcz4NK4XgLhHbzm2dmosi4H9y9gxZcvC91eQtnlE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dLY56uSi2u4w8/cs1WAaT7ml47mNUfABATEjqh1LGB1WG/29eo0oA/fGLrH/kr6oC F2JoEkubK8k3VMfkh/QeKJevfcVKzLBXDRdz8D8Rjig5GywW1oUSTN7nhDiYbD+iBG 2Nw9h8fCahBV0KrjTSuF2wNaJL8aqc39LBGlCJd0= 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 4.14 31/60] can: dev: can_restart(): post buffer from the right context Date: Mon, 23 Nov 2020 13:22:13 +0100 Message-Id: <20201123121806.548861633@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121805.028396732@linuxfoundation.org> References: <20201123121805.028396732@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 e79965a390aab..c483c4b787fee 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c @@ -578,7 +578,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