Received: by 2002:aa6:c429:0:b029:98:93ff:f56f with SMTP id g9csp3387053lkq; Mon, 23 Nov 2020 04:31:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJzxXqXhtW7OZ1K2ZnTh3Vb3wuUFsZVmp/RRzTs+lP3FirWU5rVju0NI9y7w7F7g4ode8kjR X-Received: by 2002:a05:6402:a46:: with SMTP id bt6mr48224495edb.101.1606134715450; Mon, 23 Nov 2020 04:31:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606134715; cv=none; d=google.com; s=arc-20160816; b=wbDN3AUuP8VgbuplaBzsuiqTB3oazm9SXjsMwr45VspPDrWI0EAbkif0zMIJ+2webU 4O6O9X7+kbl/knto615eBvmiGKEjcPazkgENU1RHzwyRKezt3cUmlpXTroHElFYDhEV9 Qm64yXKn4qFzODwjGEH+ou5gNszVv/xxjBIIl76+lq7p6AaojwNMPJXxfN1xokty1ftG ByyyJLQeiKnksWLhFmbXTJ8mDLjp3nGiFbyNXUeYFAEbKsFJIA3RM1e6t7zvPvjvzfyv InSfjemQkPeVO22WMjgYOBnG/MOsa3/7wik3eS+0esQ9PS8AhV5vOmrw+U9zwVaVsEaR 4miw== 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=T3E1LVk/xyexa9uKY9x1ybwlqKESP3kuS/2kn4H3mIs=; b=dv9vweeuSZxz/2vCz7+bdMVdUdaSV7luKzC/ltfGyi+POwMq8MtVDCfeLVKc6rFJKZ xu255vD6zmul1Id/dLjS2fbghkqsfpz5lCek8gPR0P+thK6hYMO5vK0NIDzTmgMVys+Q exYSpuvkc9qfDbzBgjRB9oawlhCxdM1WHekaPzSsE+8K/+Z33n0MVBJ3/iVAny4Dd5Mv WLeMJY8GY5mIlZAexZzbtmylOe/cP0ZroETOERNi6oUGgMRHJdNe2Q9+vgTtcyNrqpRE fQVRlB60T7xLU31MUizb0fVUNjZWpVfatOvxrIkG9G65+obshoVdcKCGm8j+jOOt1kcq YXeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=O4wcGjaT; 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 bx14si6617074edb.13.2020.11.23.04.31.32; Mon, 23 Nov 2020 04:31:55 -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=O4wcGjaT; 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 S1730183AbgKWM0m (ORCPT + 99 others); Mon, 23 Nov 2020 07:26:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:36648 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730177AbgKWM0k (ORCPT ); Mon, 23 Nov 2020 07:26:40 -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 BF29020888; Mon, 23 Nov 2020 12:26:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134398; bh=C6kASmgT/t06JcXHUZD9iZn3SJeHYZBKtRITDhaAajE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O4wcGjaT1rfdmR1s0LVtiG96SmrPJVIUcOmYzYUMWoSq/WUYZ9SpCIx5uFQEPbnat ekRnSUYJJirGHcY/6O+cjuhkV+53nTfi5zmhaBAX2JxymfIefDtgvYakHzLrSOu1Nt 5zWCQ986LT0cwk2u055Bu3C9BFXzI+s+bUiH3cOM= 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.9 27/47] can: dev: can_restart(): post buffer from the right context Date: Mon, 23 Nov 2020 13:22:13 +0100 Message-Id: <20201123121806.860563786@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121805.530891002@linuxfoundation.org> References: <20201123121805.530891002@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 617eb75c7c0ce..c7508d9a4c6fb 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c @@ -555,7 +555,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