)]}'
{
  "commit": "a51d233ccd4889aadb71dace863525cc2b00271e",
  "tree": "a3ccc2624764af44cb554a17afecbb4621ae3c91",
  "parents": [
    "7fadfc8dc63fe77b3a2dd1e023915f6fad7efdac"
  ],
  "author": {
    "name": "Eric Dumazet",
    "email": "edumazet@kernel.org",
    "time": "Wed Oct 07 07:17:47 2026 +0200"
  },
  "committer": {
    "name": "Jakub Kicinski",
    "email": "kuba@kernel.org",
    "time": "Wed Oct 07 17:53:31 2026 -0700"
  },
  "message": "bnxt_en: fix DMA mapping length for padded small packets\n\nStefan Fleischmann reported Intel IOMMU DMA Read faults on BCM57412\nNetXtreme-E NICs when transmitting packets on VLAN/macvlan interfaces:\n\n  DMAR: [DMA Read NO_PASID] Request device [18:00.0] fault addr 0xfc499000\n        [fault reason 0x06] PTE Read access is not set\n  bnxt_en 0000:18:00.0 eno1np0: Abandoning msg {0xb4 0x41a} len: 0 due to firmware status: 0x2000001\n  ...\n  NETDEV WATCHDOG: eno1np0 (bnxt_en): transmit queue 0 timed out\n\nThe fault address (0xfc499000) is on an exact 4KB page boundary,\npointing to a DMA read buffer overrun.\n\nIn bnxt_start_xmit(), packets smaller than BNXT_MIN_PKT_SIZE (52 bytes),\nsuch as 42-byte untagged ARP frames, are padded:\n\n    if (length \u003c BNXT_MIN_PKT_SIZE) {\n        pad \u003d BNXT_MIN_PKT_SIZE - length;\n        if (skb_pad(skb, pad))\n            goto tx_kick_pending;\n        length \u003d BNXT_MIN_PKT_SIZE;\n    }\n\n    mapping \u003d dma_map_single(\u0026pdev-\u003edev, skb-\u003edata, len, DMA_TO_DEVICE);\n    ...\n    dma_unmap_len_set(tx_buf, len, len);\n\nHowever, \u0027len\u0027 was initialized earlier to skb_headlen(skb) (e.g. 42 bytes)\nand is left unadjusted after padding. Consequently, dma_map_single() and\ndma_unmap_len_set() map and track only 42 bytes.\n\nLater, the hardware TX buffer descriptor is programmed with the padded length:\n\n    txbd-\u003etx_bd_len_flags_type \u003d\n        cpu_to_le32(((len + pad) \u003c\u003c TX_BD_LEN_SHIFT) | flags |\n                    TX_BD_FLAGS_PACKET_END);\n\nThe NIC DMA engine is thus instructed to read 52 bytes from a region where\nonly 42 bytes were DMA-mapped. If skb-\u003edata ends near the boundary of a 4KB\npage (within \u0027pad\u0027 bytes of the next page), the hardware DMA read overruns\ninto the unmapped adjacent page, triggering an IOMMU fault.\n\nThis issue was exposed after commit 447cbe95ebb9 (\"vlan: fix skb_under_panic\nand races when toggling HW VLAN offload\") because reserving extra VLAN\nheadroom rounded LL_RESERVED_SPACE from 48 up to 64 bytes, shifting skb-\u003edata\noffsets and potentially causing small frames to land right against page\nboundaries.\n\nFix this by using skb_put_padto(skb, BNXT_MIN_PKT_SIZE) in\nbnxt_start_xmit(), before skb_shinfo(skb)-\u003enr_frags is sampled,\nbecause padding might linearize the skb.\nThis ensures skb-\u003elen and skb_headlen(skb) reflect the padded size so\nthat dma_map_single() maps the full buffer and the descriptor length is\nconsistent. This also removes the temporary \u0027pad\u0027 variable and masking logic.\n\nThe padding is done after the SW USO branch, otherwise\nbnxt_sw_udp_gso_xmit() would account the padding as UDP payload\nand send it in extra segments.\n\nNote that SW USO segments are still not padded: with IPv4, a segment\ncarrying less than 10 bytes of UDP payload (small gso_size, or a short\nlast segment) is sent as a frame shorter than BNXT_MIN_PKT_SIZE.\nThis is a separate issue, left for a followup patch.\n\nFixes: c0c050c58d84 (\"bnxt_en: New Broadcom ethernet driver.\")\nCc: stable@vger.kernel.org\nReported-by: Stefan Fleischmann \u003csfle@kth.se\u003e\nCloses: https://lore.kernel.org/netdev/20261004122616.56714cbd@nargothrond/\nSigned-off-by: Eric Dumazet \u003cedumazet@google.com\u003e\nReviewed-by: Michael Chan \u003cmichael.chan@broadcom.com\u003e\nLink: https://patch.msgid.link/20261007051747.455273-1-edumazet@kernel.org\nSigned-off-by: Jakub Kicinski \u003ckuba@kernel.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "5bd817479d64242b86ae910af788a48cc045bb4d",
      "old_mode": 33188,
      "old_path": "drivers/net/ethernet/broadcom/bnxt/bnxt.c",
      "new_id": "15a8349ccf7b3fa836b7e8e0ea4aae6bccf90bfd",
      "new_mode": 33188,
      "new_path": "drivers/net/ethernet/broadcom/bnxt/bnxt.c"
    }
  ]
}
