{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2024-50261",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2024-50261"
  ],
  "published": "2024-11-09T10:15:51Z",
  "summary": "macsec: Fix use-after-free while sending the offloading packet",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nmacsec: Fix use-after-free while sending the offloading packet\n\nKASAN reports the following UAF. The metadata_dst, which is used to\nstore the SCI value for macsec offload, is already freed by\nmetadata_dst_free() in macsec_free_netdev(), while driver still use it\nfor sending the packet.\n\nTo fix this issue, dst_release() is used instead to release\nmetadata_dst. So it is not freed instantly in macsec_free_netdev() if\nstill referenced by skb.\n\n BUG: KASAN: slab-use-after-free in mlx5e_xmit+0x1e8f/0x4190 [mlx5_core]\n Read of size 2 at addr ffff88813e42e038 by task kworker/7:2/714\n [...]\n Workqueue: mld mld_ifc_work\n Call Trace:\n  <TASK>\n  dump_stack_lvl+0x51/0x60\n  print_report+0xc1/0x600\n  kasan_report+0xab/0xe0\n  mlx5e_xmit+0x1e8f/0x4190 [mlx5_core]\n  dev_hard_start_xmit+0x120/0x530\n  sch_direct_xmit+0x149/0x11e0\n  __qdisc_run+0x3ad/0x1730\n  __dev_queue_xmit+0x1196/0x2ed0\n  vlan_dev_hard_start_xmit+0x32e/0x510 [8021q]\n  dev_hard_start_xmit+0x120/0x530\n  __dev_queue_xmit+0x14a7/0x2ed0\n  macsec_start_xmit+0x13e9/0x2340\n  dev_hard_start_xmit+0x120/0x530\n  __dev_queue_xmit+0x14a7/0x2ed0\n  ip6_finish_output2+0x923/0x1a70\n  ip6_finish_output+0x2d7/0x970\n  ip6_output+0x1ce/0x3a0\n  NF_HOOK.constprop.0+0x15f/0x190\n  mld_sendpack+0x59a/0xbd0\n  mld_ifc_work+0x48a/0xa80\n  process_one_work+0x5aa/0xe50\n  worker_thread+0x79c/0x1290\n  kthread+0x28f/0x350\n  ret_from_fork+0x2d/0x70\n  ret_from_fork_asm+0x11/0x20\n  </TASK>\n\n Allocated by task 3922:\n  kasan_save_stack+0x20/0x40\n  kasan_save_track+0x10/0x30\n  __kasan_kmalloc+0x77/0x90\n  __kmalloc_noprof+0x188/0x400\n  metadata_dst_alloc+0x1f/0x4e0\n  macsec_newlink+0x914/0x1410\n  __rtnl_newlink+0xe08/0x15b0\n  rtnl_newlink+0x5f/0x90\n  rtnetlink_rcv_msg+0x667/0xa80\n  netlink_rcv_skb+0x12c/0x360\n  netlink_unicast+0x551/0x770\n  netlink_sendmsg+0x72d/0xbd0\n  __sock_sendmsg+0xc5/0x190\n  ____sys_sendmsg+0x52e/0x6a0\n  ___sys_sendmsg+0xeb/0x170\n  __sys_sendmsg+0xb5/0x140\n  do_syscall_64+0x4c/0x100\n  entry_SYSCALL_64_after_hwframe+0x4b/0x53\n\n Freed by task 4011:\n  kasan_save_stack+0x20/0x40\n  kasan_save_track+0x10/0x30\n  kasan_save_free_info+0x37/0x50\n  poison_slab_object+0x10c/0x190\n  __kasan_slab_free+0x11/0x30\n  kfree+0xe0/0x290\n  macsec_free_netdev+0x3f/0x140\n  netdev_run_todo+0x450/0xc70\n  rtnetlink_rcv_msg+0x66f/0xa80\n  netlink_rcv_skb+0x12c/0x360\n  netlink_unicast+0x551/0x770\n  netlink_sendmsg+0x72d/0xbd0\n  __sock_sendmsg+0xc5/0x190\n  ____sys_sendmsg+0x52e/0x6a0\n  ___sys_sendmsg+0xeb/0x170\n  __sys_sendmsg+0xb5/0x140\n  do_syscall_64+0x4c/0x100\n  entry_SYSCALL_64_after_hwframe+0x4b/0x53",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:12",
        "name": "linux"
      },
      "versions": [
        "1:6.1.47-1+rpt4"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-2712",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v6",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7l",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v8",
            "binary_version": "1:6.1.47-1+rpt4"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.1.47-1+rpt4": {
            "linux_commit": "655fc658a15ae7a6f37103754adb39ba52a9a14e",
            "upstream_version": "6.1.47",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.1.116",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2024-50261"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/872932cf75cf859804370a265dd58118129386fa"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/9f5ae743dbe9a2458540a7d35fff0f990df025cf"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/4614640f1d5c93c22272117dc256e9940ccac8e8"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/f1e54d11b210b53d418ff1476c6b58a2f434dfc0"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T11:52:36Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 7.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - Triggering requires local rtnetlink/genetlink operations (creating a MACsec device with HW offload, transmitting through it, then deleting it), which are not reachable from a remote peer. No packet received from the network can drive the free side of the race.\nAC:L - The attacker controls both sides of the race \u2014 it queues the offloaded skbs that take the md_dst reference and it issues the RTM_DELLINK that frees the object, and can widen the window arbitrarily with a deep or rate-limited qdisc on the real device. The upstream report shows the UAF firing from ordinary incidental MLD traffic with no deliberate racing at all.\nPR:L - Only CAP_NET_ADMIN in the owning network namespace is needed, which an unprivileged user obtains via `unshare -Urn`, and in the SR-IOV/delegated-port container deployments where MACsec offload is deployed the container holds CAP_NET_ADMIN over an offload-capable NIC. No real root in the init namespace is required.\nUI:N - The attacker performs the link creation, traffic generation and deletion entirely on its own; no victim action is involved. The published reproducer triggered on kernel-generated MLD traffic with no user involvement whatsoever.\nS:U - The freed metadata_dst and all resulting corruption live in kernel slab memory within the same security authority; no VM, IOMMU, or hypervisor boundary is crossed.\nC:H - The driver reads the freed object's type/SCI fields directly, and the deferred `dst_release()` path dereferences `dst->ops` and `dst->dev` out of reallocatable slab memory, giving an attacker who grooms the freed slot a read primitive over kernel memory. Per kernel scoring guidance a use-after-free of a heap object is High.\nI:H - `rcuref_put()` performs an atomic read-modify-write into the freed object, `call_rcu_hurry()` writes and links the freed object's rcu_head, and `dst_destroy()` makes an indirect call through `dst->ops->destroy` read from attacker-reallocatable memory \u2014 a write plus control-flow hijack primitive. A stale SCI also causes frames to be offloaded under the wrong SecY, corrupting the protected link's association.\nA:H - The confirmed KASAN slab-use-after-free in the TX fast path, the refcount corruption, and the bogus RCU callback queued on freed memory readily produce an oops or panic on a live networking path. Any use-after-free is scored High for availability."
    }
  }
}
