{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2025-38150",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2025-04-16T04:51:23.988Z",
        "datePublished": "2025-07-03T08:35:55.257Z",
        "dateUpdated": "2026-08-05T11:59:53.344Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-08-05T11:59:53.344Z"
            },
            "descriptions": [
                {
                    "lang": "en",
                    "value": "In the Linux kernel, the following vulnerability has been resolved:\n\naf_packet: move notifier's packet_dev_mc out of rcu critical section\n\nSyzkaller reports the following issue:\n\n BUG: sleeping function called from invalid context at kernel/locking/mutex.c:578\n __mutex_lock+0x106/0xe80 kernel/locking/mutex.c:746\n team_change_rx_flags+0x38/0x220 drivers/net/team/team_core.c:1781\n dev_change_rx_flags net/core/dev.c:9145 [inline]\n __dev_set_promiscuity+0x3f8/0x590 net/core/dev.c:9189\n netif_set_promiscuity+0x50/0xe0 net/core/dev.c:9201\n dev_set_promiscuity+0x126/0x260 net/core/dev_api.c:286 packet_dev_mc net/packet/af_packet.c:3698 [inline]\n packet_dev_mclist_delete net/packet/af_packet.c:3722 [inline]\n packet_notifier+0x292/0xa60 net/packet/af_packet.c:4247\n notifier_call_chain+0x1b3/0x3e0 kernel/notifier.c:85\n call_netdevice_notifiers_extack net/core/dev.c:2214 [inline]\n call_netdevice_notifiers net/core/dev.c:2228 [inline]\n unregister_netdevice_many_notify+0x15d8/0x2330 net/core/dev.c:11972\n rtnl_delete_link net/core/rtnetlink.c:3522 [inline]\n rtnl_dellink+0x488/0x710 net/core/rtnetlink.c:3564\n rtnetlink_rcv_msg+0x7cf/0xb70 net/core/rtnetlink.c:6955\n netlink_rcv_skb+0x219/0x490 net/netlink/af_netlink.c:2534\n\nCalling `PACKET_ADD_MEMBERSHIP` on an ops-locked device can trigger\nthe `NETDEV_UNREGISTER` notifier, which may require disabling promiscuous\nand/or allmulti mode. Both of these operations require acquiring\nthe netdev instance lock.\n\nMove the call to `packet_dev_mc` outside of the RCU critical section.\nThe `mclist` modifications (add, del, flush, unregister) are protected by\nthe RTNL, not the RCU. The RCU only protects the `sklist` and its\nassociated `sks`. The delayed operation on the `mclist` entry remains\nwithin the RTNL."
                }
            ],
            "metrics": [
                {
                    "cvssV3_1": {
                        "version": "3.1",
                        "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
                        "baseScore": 7.8,
                        "baseSeverity": "HIGH"
                    },
                    "scenarios": [
                        {
                            "lang": "en",
                            "value": "AV:L - Triggering requires local syscalls — an AF_PACKET socket with `setsockopt(PACKET_ADD_MEMBERSHIP)` plus an rtnetlink `RTM_DELLINK` (or netns teardown) to fire `NETDEV_UNREGISTER`. No remote peer can reach `packet_notifier()`.\nAC:L - The attacker performs every step deterministically: create the ops-locked/team device, add the promisc membership, then delete the device — the promiscuity 1→0 transition guarantees the sleeping call under RCU. Mutex contention and the concurrent `packet_release()` needed for the memory-safety outcome are both created by the attacker's own threads and sockets.\nPR:L - `packet_create()` checks only `ns_capable(net->user_ns, CAP_NET_RAW)`, and device create/delete needs CAP_NET_ADMIN in the netns — both granted to an unprivileged user inside `unshare -Urn`. No real root is required.\nUI:N - The attacking process performs the setsockopt and the device unregister itself; no victim action or cooperating process is involved.\nS:U - The fault and its consequences are confined to the kernel of the same host; no VM, IOMMU, or hypervisor boundary is crossed.\nC:H - Blocking inside the RCU read-side section lets a grace period (and a racing `packet_release()`'s `synchronize_net()`) complete early on non-preemptible-RCU kernels, so `sk_for_each_rcu()` keeps dereferencing a freed `packet_sock` — an attacker-groomable slab object that yields a kernel-memory read primitive.\nI:H - The same stale iteration then writes into the freed object (`spin_lock(&po->bind_lock)`, `sk->sk_err = ENETDOWN`, `WRITE_ONCE(po->ifindex, -1)`), and the forced `preempt_count_set()` in `schedule_debug()` corrupts preemption bookkeeping — both usable for controlled corruption and control-flow hijack.\nA:H - The confirmed syzbot outcome is a \"BUG: sleeping function called from invalid context\" oops (a panic under `panic_on_warn`/`panic_on_oops`), and blocking under RCU while holding RTNL causes grace-period stalls that can wedge the entire networking stack."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "net/packet/af_packet.c",
                        "net/packet/internal.h"
                    ],
                    "versions": [
                        {
                            "version": "ad7c7b2172c388818a111455643491d75f535e90",
                            "lessThan": "2dd4781c5af99415ebbd2f7cc763feb109863c05",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "ad7c7b2172c388818a111455643491d75f535e90",
                            "lessThan": "d8d85ef0a631df9127f202e6371bb33a0b589952",
                            "status": "affected",
                            "versionType": "git"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "net/packet/af_packet.c",
                        "net/packet/internal.h"
                    ],
                    "versions": [
                        {
                            "version": "6.15",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "6.15",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.15.3",
                            "lessThanOrEqual": "6.15.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.16",
                            "lessThanOrEqual": "*",
                            "status": "unaffected",
                            "versionType": "original_commit_for_fix"
                        }
                    ]
                }
            ],
            "cpeApplicability": [
                {
                    "nodes": [
                        {
                            "operator": "OR",
                            "negate": false,
                            "cpeMatch": [
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.15",
                                    "versionEndExcluding": "6.15.3"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.15",
                                    "versionEndExcluding": "6.16"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "url": "https://git.kernel.org/stable/c/2dd4781c5af99415ebbd2f7cc763feb109863c05"
                },
                {
                    "url": "https://git.kernel.org/stable/c/d8d85ef0a631df9127f202e6371bb33a0b589952"
                }
            ],
            "title": "af_packet: move notifier's packet_dev_mc out of rcu critical section",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        }
    }
}