{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2024-39502",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2024-39502"
  ],
  "published": "2024-07-12T12:21:19Z",
  "summary": "ionic: fix use after netif_napi_del()",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nionic: fix use after netif_napi_del()\n\nWhen queues are started, netif_napi_add() and napi_enable() are called.\nIf there are 4 queues and only 3 queues are used for the current\nconfiguration, only 3 queues' napi should be registered and enabled.\nThe ionic_qcq_enable() checks whether the .poll pointer is not NULL for\nenabling only the using queue' napi. Unused queues' napi will not be\nregistered by netif_napi_add(), so the .poll pointer indicates NULL.\nBut it couldn't distinguish whether the napi was unregistered or not\nbecause netif_napi_del() doesn't reset the .poll pointer to NULL.\nSo, ionic_qcq_enable() calls napi_enable() for the queue, which was\nunregistered by netif_napi_del().\n\nReproducer:\n   ethtool -L <interface name> rx 1 tx 1 combined 0\n   ethtool -L <interface name> rx 0 tx 0 combined 1\n   ethtool -L <interface name> rx 0 tx 0 combined 4\n\nSplat looks like:\nkernel BUG at net/core/dev.c:6666!\nOops: invalid opcode: 0000 [#1] PREEMPT SMP NOPTI\nCPU: 3 PID: 1057 Comm: kworker/3:3 Not tainted 6.10.0-rc2+ #16\nWorkqueue: events ionic_lif_deferred_work [ionic]\nRIP: 0010:napi_enable+0x3b/0x40\nCode: 48 89 c2 48 83 e2 f6 80 b9 61 09 00 00 00 74 0d 48 83 bf 60 01 00 00 00 74 03 80 ce 01 f0 4f\nRSP: 0018:ffffb6ed83227d48 EFLAGS: 00010246\nRAX: 0000000000000000 RBX: ffff97560cda0828 RCX: 0000000000000029\nRDX: 0000000000000001 RSI: 0000000000000000 RDI: ffff97560cda0a28\nRBP: ffffb6ed83227d50 R08: 0000000000000400 R09: 0000000000000001\nR10: 0000000000000001 R11: 0000000000000001 R12: 0000000000000000\nR13: ffff97560ce3c1a0 R14: 0000000000000000 R15: ffff975613ba0a20\nFS:  0000000000000000(0000) GS:ffff975d5f780000(0000) knlGS:0000000000000000\nCS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033\nCR2: 00007f8f734ee200 CR3: 0000000103e50000 CR4: 00000000007506f0\nPKRU: 55555554\nCall Trace:\n <TASK>\n ? die+0x33/0x90\n ? do_trap+0xd9/0x100\n ? napi_enable+0x3b/0x40\n ? do_error_trap+0x83/0xb0\n ? napi_enable+0x3b/0x40\n ? napi_enable+0x3b/0x40\n ? exc_invalid_op+0x4e/0x70\n ? napi_enable+0x3b/0x40\n ? asm_exc_invalid_op+0x16/0x20\n ? napi_enable+0x3b/0x40\n ionic_qcq_enable+0xb7/0x180 [ionic 59bdfc8a035436e1c4224ff7d10789e3f14643f8]\n ionic_start_queues+0xc4/0x290 [ionic 59bdfc8a035436e1c4224ff7d10789e3f14643f8]\n ionic_link_status_check+0x11c/0x170 [ionic 59bdfc8a035436e1c4224ff7d10789e3f14643f8]\n ionic_lif_deferred_work+0x129/0x280 [ionic 59bdfc8a035436e1c4224ff7d10789e3f14643f8]\n process_one_work+0x145/0x360\n worker_thread+0x2bb/0x3d0\n ? __pfx_worker_thread+0x10/0x10\n kthread+0xcc/0x100\n ? __pfx_kthread+0x10/0x10\n ret_from_fork+0x2d/0x50\n ? __pfx_kthread+0x10/0x10\n ret_from_fork_asm+0x1a/0x30",
  "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.95",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2024-39502"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/0d19267cb150e8f76ade210e16ee820a77f684e7"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/ff9c2a9426ecf5b9631e9fd74993b357262387d6"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/8edd18dab443863e9e48f084e7f123fca3065e4e"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/60cd714871cd5a683353a355cbb17a685245cf84"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/183ebc167a8a19e916b885d4bb61a3491991bfa5"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/a87d72b37b9ec2c1e18fe36b09241d8b30334a2e"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/79f18a41dd056115d685f3b0a419c7cd40055e13"
    }
  ],
  "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 - The trigger is a local `ethtool -L` operation on the netdev, delivered via the ethtool ioctl or the ethtool generic-netlink family \u2014 no network packet from a remote peer reaches the vulnerable code. Attack requires local access to the system or container hosting the ionic netdev.\nAC:L - The upstream reproducer is a deterministic three-command sequence (`ethtool -L ... rx 1 tx 1 combined 0`, then `combined 1`, then `combined 4`) with no race and no dependence on memory layout or system state the attacker cannot influence. The link-status event that drives the crashing deferred work is generated by the reconfiguration itself via `ionic_link_status_check_request()`.\nPR:L - Both entry points gate on namespace-relative CAP_NET_ADMIN (`ns_capable(net->user_ns, CAP_NET_ADMIN)` in net/ethtool/ioctl.c:2912 and `GENL_UNS_ADMIN_PERM` in net/ethtool/netlink.c:921), which an unprivileged user holds inside their own user namespace. ionic exposes SR-IOV VFs that are routinely delegated into container network namespaces by SR-IOV CNI, so a basic container user reaches `ionic_set_channels` without any host-root privilege.\nUI:N - The entire sequence is attacker-driven from a single process; no administrator or victim action is needed. The queue restart that reaches `ionic_qcq_enable()` is triggered automatically by the attacker's own reconfiguration.\nS:U - The corruption and the crash are confined to the kernel's own security authority \u2014 there is no hypervisor, IOMMU, or DMA boundary being crossed. This is standard in-kernel memory corruption, so the vulnerable component and impacted component share one authority.\nC:H - Re-enabling a NAPI that `netif_napi_del()` already unlinked leaves it schedulable from the still-registered IRQ while the containing `struct ionic_qcq` is `devm_kfree()`d, so `net_rx_action()` polls freed slab memory \u2014 a use-after-free that yields an arbitrary kernel-memory read primitive once the object is resprayed.\nI:H - The same use-after-free makes `n->poll` an indirect call through freed, attacker-sprayable slab memory, giving a control-flow-hijack and arbitrary-write primitive. Per UAF scoring guidance this is High integrity impact, not a mere crash.\nA:H - `napi_enable()` hits `BUG_ON(!test_bit(NAPI_STATE_SCHED, &val))` (net/core/dev.c:6665) and kills the kworker while it holds `lif->queue_lock`, which is then leaked permanently \u2014 every subsequent `ionic_open`/`ionic_stop`/ethtool path blocks on it while holding `rtnl_lock`, deadlocking the whole networking control plane until reboot (immediate panic with `panic_on_oops=1`)."
    }
  }
}
