Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp840717pxu; Mon, 23 Nov 2020 05:38:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJwRYdmDzeU5Fr/liWVymVq07ZrmcazKVoTv8gK0435hrsKrvb3LanWNy+4EtWf/DEfLJA5M X-Received: by 2002:a50:da46:: with SMTP id a6mr42536447edk.272.1606138682092; Mon, 23 Nov 2020 05:38:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606138682; cv=none; d=google.com; s=arc-20160816; b=yokHMlydCAC+xOS1zvwFBmCn22UtK5bdNSTgn2+IvDPMce6fsbVuWfIxruoQaX9Jty Pj4rG/2kEQkE26SwC07Htpissywp0I5Otwq+Ancvto8jZMLq023y2X0AvIztTPeK7X3a DbRoXUoFLjyao1yB0QCKno8k6y16MoaRymeUOPhhm2KJOhLfyYLhIhNtwH/u8zoN7j4h OdtAUHa1qC+NUIsaHh3wTi1mu9OEWiMfvqzx7XSV+DvYpMpYMGvkqIv//yNWeCQB9cBr U9mj6FPSu3vIR2PU3EQ+YtQy8aTz0Kx0f2mDyczE3fRb3znP3OjLnaBPwlya1z/kpt6r O3Hw== 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=FcifhftakDzpVMuIjnWi9XAre7ChFHSGusOaa46miPQ=; b=vNqSVXx68AD4vnC7pvNiVYHJ5+nLQhVO/o/7oJZ4jXM+KjX9cpqhjbh9QYH7z3pYHb AC9xWOF3y0sruvjjf3BuVLK/muYu+dRDaCq02dfdNsK9zFvpliR0tc46j+oHE8HJUeZx s4IFUoaX9hSQflE1RZa9BaC3wOoBHFiD9ougtenhMlTYYUEvM0H2Yz68P2Xj6E8zqnYA T/BKMsr52BkjF0s8K5HHixWQFckO1dWvKARXIk/y3vn7jruvL1XDTuE/uzEBkRizKTbz 1mbndHcyqw6fAnQLohAH6kk4jOrmhalryriRtRcNdWWIE/1L52eDwv6PuFPzI1k4nxII 21mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tkSR69PO; 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 q4si6241168edb.455.2020.11.23.05.37.38; Mon, 23 Nov 2020 05:38:02 -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=tkSR69PO; 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 S1730152AbgKWNeY (ORCPT + 99 others); Mon, 23 Nov 2020 08:34:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:33802 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729765AbgKWMYR (ORCPT ); Mon, 23 Nov 2020 07:24:17 -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 25EB220781; Mon, 23 Nov 2020 12:24:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134257; bh=Ngse9KP/8iA9t6jkdoMpqaJR5e5EVQ7uFmB10fruDw8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tkSR69POylKE00q6tWDIKc+/foryDaepp0TEopJUT7PJSwT3NsxCAF1H29u0naJrA /wYHmiD1CFbtdZAFVEZRi8Os7997/kX5WGZCWHBVbUOf2WwFLdEP9WQQAfocw72Bh2 xLh+598PvfE7unEfU9zebv4Yo+JGwjG2OyTdmfYQ= 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.4 20/38] can: dev: can_restart(): post buffer from the right context Date: Mon, 23 Nov 2020 13:22:06 +0100 Message-Id: <20201123121805.280479467@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121804.306030358@linuxfoundation.org> References: <20201123121804.306030358@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 9579dae54af29..52110017fd401 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c @@ -525,7 +525,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