linux/net/dsa
Weiming Shi 5be081b83a net: dsa: tag_brcm: legacy FCS: request needed tailroom
The legacy FCS tagger calculates the CRC over skb->len bytes starting at
skb->data. When a nonlinear skb reaches the tagger, this reads past the
linear head into unrelated slab memory.

The tagger appends an Ethernet FCS but does not declare that tailroom. As a
result, DSA leaves NETIF_F_SG and NETIF_F_FRAGLIST enabled on the user
port, and nonlinear skbs can reach the CRC calculation.

Declare the required tailroom. DSA will then clear those features and the
networking core will linearize skbs before the tagger runs.

A KASAN-enabled dsa_loop test using this tagger reports:

  BUG: KASAN: slab-out-of-bounds in crc32_le
  Read of size 1 at addr ffff8880397086c0 by task exp/135

  Call Trace:
   crc32_le (lib/crc/crc32-main.c:38)
   brcm_leg_fcs_tag_xmit (net/dsa/tag_brcm.c:343)
   dsa_user_xmit (net/dsa/user.c:942)
   dev_hard_start_xmit (net/core/dev.c:3937)
   __dev_queue_xmit (net/core/dev.c:4926)
   packet_sendmsg (net/packet/af_packet.c:3110)
   __sys_sendto (net/socket.c:2281)

  The buggy address belongs to the object at ffff888039708400
   which belongs to the cache skbuff_small_head of size 704
  The buggy address is located 0 bytes to the right of
   allocated 704-byte region [ffff888039708400, ffff8880397086c0)

Fixes: ef07df397a ("net: dsa: tag_brcm: add support for legacy FCS tags")
Cc: stable@vger.kernel.org
Reported-by: co+28eef7d8af9428e6@bugs.sh
Closes: https://lore.kernel.org/all/jH6u350kaBRuqklDjd3k3BW4nWzp0tYRjq3p%40bugs.sh/
Signed-off-by: Weiming Shi <bestswngs@gmail.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20260908165047.2786340-1-bestswngs@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-09 13:31:08 -07:00
..
conduit.c net: dsa: remove redundant netdev_lock_ops() from conduit ethtool ops 2026-04-16 19:10:48 -07:00
conduit.h net: dsa: Use conduit and user terms 2023-10-24 13:08:14 -07:00
devlink.c devlink: pass extack through to devlink_param::get() 2025-11-20 19:01:22 -08:00
devlink.h net: dsa: move rest of devlink setup/teardown to devlink.c 2022-11-22 20:41:47 -08:00
dsa.c net: dsa: drop explicit NULL comparisons 2026-08-14 13:57:27 -07:00
dsa.h net: dsa: Use conduit and user terms 2023-10-24 13:08:14 -07:00
Kconfig net: dsa: initial MT7628 tagging driver 2026-08-18 15:50:13 +02:00
Makefile net: dsa: initial MT7628 tagging driver 2026-08-18 15:50:13 +02:00
netlink.c net: dsa: Rename IFLA_DSA_MASTER to IFLA_DSA_CONDUIT 2023-10-24 13:08:14 -07:00
netlink.h net: dsa: kill off dsa_priv.h 2022-11-22 20:41:54 -08:00
port.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
port.h net: dsa: Use conduit and user terms 2023-10-24 13:08:14 -07:00
stubs.c net: dsa: replace NETDEV_PRE_CHANGE_HWTSTAMP notifier with a stub 2023-04-09 15:35:49 +01:00
switch.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
switch.h net: dsa: Use conduit and user terms 2023-10-24 13:08:14 -07:00
tag_8021q.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
tag_8021q.h net: dsa: tag_sja1105: refactor skb->dev assignment to dsa_tag_8021q_find_user() 2024-07-15 06:55:15 -07:00
tag_ar9331.c net: dsa: Fix skb ownership in taggers 2026-06-27 15:44:12 -07:00
tag_brcm.c net: dsa: tag_brcm: legacy FCS: request needed tailroom 2026-09-09 13:31:08 -07:00
tag_dsa.c net: dsa: Fix skb ownership in taggers 2026-06-27 15:44:12 -07:00
tag_gswip.c net: dsa: Fix skb ownership in taggers 2026-06-27 15:44:12 -07:00
tag_hellcreek.c net: dsa: Fix skb ownership in taggers 2026-06-27 15:44:12 -07:00
tag_ksz.c net: dsa: microchip: add KSZ8463 tail tag handling 2026-07-31 16:29:56 -07:00
tag_lan9303.c net: dsa: Fix skb ownership in taggers 2026-06-27 15:44:12 -07:00
tag_mt7628.c net: dsa: initial MT7628 tagging driver 2026-08-18 15:50:13 +02:00
tag_mtk.c net: dsa: Fix skb ownership in taggers 2026-06-27 15:44:12 -07:00
tag_mxl-gsw1xx.c net: dsa: Fix skb ownership in taggers 2026-06-27 15:44:12 -07:00
tag_mxl862xx.c net: dsa: Fix skb ownership in taggers 2026-06-27 15:44:12 -07:00
tag_netc.c net: dsa: Fix skb ownership in taggers 2026-06-27 15:44:12 -07:00
tag_none.c net: fill in MODULE_DESCRIPTION()s for DSA tags 2024-01-05 08:06:19 -08:00
tag_ocelot_8021q.c net: dsa: Fix skb ownership in taggers 2026-06-27 15:44:12 -07:00
tag_ocelot.c net: dsa: Fix skb ownership in taggers 2026-06-27 15:44:12 -07:00
tag_qca.c net: dsa: Fix skb ownership in taggers 2026-06-27 15:44:12 -07:00
tag_rtl4_a.c net: dsa: Fix skb ownership in taggers 2026-06-27 15:44:12 -07:00
tag_rtl8_4.c net: dsa: Fix skb ownership in taggers 2026-06-27 15:44:12 -07:00
tag_rzn1_a5psw.c net: dsa: Fix skb ownership in taggers 2026-06-27 15:44:12 -07:00
tag_sja1105.c net: dsa: Fix skb ownership in taggers 2026-06-27 15:44:12 -07:00
tag_trailer.c net: dsa: Fix skb ownership in taggers 2026-06-27 15:44:12 -07:00
tag_vsc73xx_8021q.c net: dsa: Fix skb ownership in taggers 2026-06-27 15:44:12 -07:00
tag_xrs700x.c net: dsa: Fix skb ownership in taggers 2026-06-27 15:44:12 -07:00
tag_yt921x.c net: dsa: Fix skb ownership in taggers 2026-06-27 15:44:12 -07:00
tag.c net: dsa: Fix skb ownership in taggers 2026-06-27 15:44:12 -07:00
tag.h net: dsa: introduce the dsa_xmit_port_mask() tagging protocol helper 2025-11-28 20:03:39 -08:00
trace.c net: dsa: add trace points for FDB/MDB operations 2023-04-12 08:36:07 +01:00
trace.h tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
user.c net: dsa: drop explicit NULL comparisons 2026-08-14 13:57:27 -07:00
user.h net: dsa: update the unicast MAC address when changing conduit 2024-06-10 13:48:06 +01:00