The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Steen Hegelund <steen.hegelund@microchip.com>,
	kernel test robot <lkp@intel.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Jakub Kicinski <kuba@kernel.org>, Sasha Levin <sashal@kernel.org>,
	davem@davemloft.net, lars.povlsen@microchip.com,
	Steen.Hegelund@microchip.com, UNGLinuxDriver@microchip.com,
	bjarni.jonasson@microchip.com, netdev@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH AUTOSEL 5.15 29/36] net: sparx5: do not refer to skb after passing it on
Date: Wed,  9 Feb 2022 13:37:52 -0500	[thread overview]
Message-ID: <20220209183759.47134-29-sashal@kernel.org> (raw)
In-Reply-To: <20220209183759.47134-1-sashal@kernel.org>

From: Steen Hegelund <steen.hegelund@microchip.com>

[ Upstream commit 81eb8b0b18789e647e65579303529fd52d861cc2 ]

Do not try to use any SKB fields after the packet has been passed up in the
receive stack.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com>
Link: https://lore.kernel.org/r/20220202083039.3774851-1-steen.hegelund@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/microchip/sparx5/sparx5_packet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_packet.c b/drivers/net/ethernet/microchip/sparx5/sparx5_packet.c
index dc7e5ea6ec158..148d431fcde42 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_packet.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_packet.c
@@ -145,9 +145,9 @@ static void sparx5_xtr_grp(struct sparx5 *sparx5, u8 grp, bool byte_swap)
 	skb_put(skb, byte_cnt - ETH_FCS_LEN);
 	eth_skb_pad(skb);
 	skb->protocol = eth_type_trans(skb, netdev);
-	netif_rx(skb);
 	netdev->stats.rx_bytes += skb->len;
 	netdev->stats.rx_packets++;
+	netif_rx(skb);
 }
 
 static int sparx5_inject(struct sparx5 *sparx5,
-- 
2.34.1


  parent reply	other threads:[~2022-02-09 18:42 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-09 18:37 [PATCH AUTOSEL 5.15 01/36] platform/x86: touchscreen_dmi: Add info for the RWC NANOTE P8 AY07J 2-in-1 Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 02/36] platform/x86: ISST: Fix possible circular locking dependency detected Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 03/36] kunit: tool: Import missing importlib.abc Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 04/36] selftests: rtc: Increase test timeout so that all tests run Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 05/36] kselftest: signal all child processes Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 06/36] selftests: netfilter: check stateless nat udp checksum fixup Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 07/36] net: ieee802154: at86rf230: Stop leaking skb's Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 08/36] selftests/zram: Skip max_comp_streams interface on newer kernel Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 09/36] selftests/zram01.sh: Fix compression ratio calculation Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 10/36] selftests/zram: Adapt the situation that /dev/zram0 is being used Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 11/36] selftests: openat2: Print also errno in failure messages Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 12/36] selftests: openat2: Add missing dependency in Makefile Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 13/36] selftests: openat2: Skip testcases that fail with EOPNOTSUPP Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 14/36] selftests: skip mincore.check_file_mmap when fs lacks needed support Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 15/36] ax25: improve the incomplete fix to avoid UAF and NPD bugs Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 16/36] pinctrl: bcm63xx: fix unmet dependency on REGMAP for GPIO_REGMAP Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 17/36] vfs: make freeze_super abort when sync_filesystem returns error Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 18/36] quota: make dquot_quota_sync return errors from ->sync_fs Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 19/36] iommu: Fix potential use-after-free during probe Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 20/36] scsi: pm80xx: Fix double completion for SATA devices Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 21/36] kselftest: Fix vdso_test_abi return status Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 22/36] scsi: core: Reallocate device's budget map on queue depth change Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 23/36] scsi: pm8001: Fix use-after-free for aborted TMF sas_task Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 24/36] scsi: pm8001: Fix use-after-free for aborted SSP/STP sas_task Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 25/36] drm/amd: Warn users about potential s0ix problems Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 26/36] nvme: fix a possible use-after-free in controller reset during load Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 27/36] nvme-tcp: fix possible use-after-free in transport error_recovery work Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 28/36] nvme-rdma: " Sasha Levin
2022-02-09 18:37 ` Sasha Levin [this message]
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 30/36] drm/amd: add support to check whether the system is set to s3 Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 31/36] drm/amd: Only run s3 or s0ix if system is configured properly Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 32/36] drm/amdgpu: fix logic inversion in check Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 33/36] x86/Xen: streamline (and fix) PV CPU enumeration Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 34/36] Revert "module, async: async_synchronize_full() on module init iff async is used" Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 35/36] gcc-plugins/stackleak: Use noinstr in favor of notrace Sasha Levin
2022-02-09 18:37 ` [PATCH AUTOSEL 5.15 36/36] random: wake up /dev/random writers after zap Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220209183759.47134-29-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=bjarni.jonasson@microchip.com \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=lars.povlsen@microchip.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=steen.hegelund@microchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox