{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2022-48733",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2024-06-20T11:09:39.053Z",
        "datePublished": "2024-06-20T11:13:20.737Z",
        "dateUpdated": "2026-08-05T08:52:01.350Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-08-05T08:52:01.350Z"
            },
            "descriptions": [
                {
                    "lang": "en",
                    "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: fix use-after-free after failure to create a snapshot\n\nAt ioctl.c:create_snapshot(), we allocate a pending snapshot structure and\nthen attach it to the transaction's list of pending snapshots. After that\nwe call btrfs_commit_transaction(), and if that returns an error we jump\nto 'fail' label, where we kfree() the pending snapshot structure. This can\nresult in a later use-after-free of the pending snapshot:\n\n1) We allocated the pending snapshot and added it to the transaction's\n   list of pending snapshots;\n\n2) We call btrfs_commit_transaction(), and it fails either at the first\n   call to btrfs_run_delayed_refs() or btrfs_start_dirty_block_groups().\n   In both cases, we don't abort the transaction and we release our\n   transaction handle. We jump to the 'fail' label and free the pending\n   snapshot structure. We return with the pending snapshot still in the\n   transaction's list;\n\n3) Another task commits the transaction. This time there's no error at\n   all, and then during the transaction commit it accesses a pointer\n   to the pending snapshot structure that the snapshot creation task\n   has already freed, resulting in a user-after-free.\n\nThis issue could actually be detected by smatch, which produced the\nfollowing warning:\n\n  fs/btrfs/ioctl.c:843 create_snapshot() warn: '&pending_snapshot->list' not removed from list\n\nSo fix this by not having the snapshot creation ioctl directly add the\npending snapshot to the transaction's list. Instead add the pending\nsnapshot to the transaction handle, and then at btrfs_commit_transaction()\nwe add the snapshot to the list only when we can guarantee that any error\nreturned after that point will result in a transaction abort, in which\ncase the ioctl code can safely free the pending snapshot and no one can\naccess it anymore."
                }
            ],
            "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 - The bug is reached only via local BTRFS_IOC_SNAP_CREATE/SNAP_CREATE_V2 ioctls on a mounted btrfs filesystem; it is not reachable from network packet or remote filesystem protocol paths.\nAC:L - An unprivileged attacker who can create snapshots can drive the failing commit path and separately force another transaction commit, and between the free and reuse can spray the heap; the UAF does not depend on a race the attacker cannot influence.\nPR:L - Snapshot creation needs only directory write/exec permission and ownership of the source subvolume (inode_owner_or_capable), not real root or init-namespace CAP_SYS_ADMIN.\nUI:N - The attacker triggers the vulnerable ioctl themselves; no separate victim action is required.\nS:U - Impact is standard in-kernel memory corruption and privilege escalation within the host kernel's security authority, not a VM/IOMMU/sandbox boundary crossing.\nC:H - Use-after-free of btrfs_pending_snapshot leaves attacker-controllable freed memory that create_pending_snapshot later dereferences (dentry/dir/root/path/root_item), enabling arbitrary kernel read primitives.\nI:H - The same UAF of a pointer-rich structure during snapshot commit enables heap spraying and arbitrary write/control-flow hijacking.\nA:H - Dereferencing the freed pending snapshot during a later transaction commit can oops/panic the kernel even without a full exploit."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "fs/btrfs/ioctl.c",
                        "fs/btrfs/transaction.c",
                        "fs/btrfs/transaction.h"
                    ],
                    "versions": [
                        {
                            "version": "c37b2b6269ee4637fb7cdb5da0d1e47215d57ce2",
                            "lessThan": "7e4c72dbaf62f8978af8321a24dbd35566d3a78a",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "c37b2b6269ee4637fb7cdb5da0d1e47215d57ce2",
                            "lessThan": "a7b717fa15165d3d9245614680bebc48a52ac05d",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "c37b2b6269ee4637fb7cdb5da0d1e47215d57ce2",
                            "lessThan": "9372fa1d73da5f1673921e365d0cd2c27ec7adc2",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "c37b2b6269ee4637fb7cdb5da0d1e47215d57ce2",
                            "lessThan": "28b21c558a3753171097193b6f6602a94169093a",
                            "status": "affected",
                            "versionType": "git"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "fs/btrfs/ioctl.c",
                        "fs/btrfs/transaction.c",
                        "fs/btrfs/transaction.h"
                    ],
                    "versions": [
                        {
                            "version": "3.7",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "3.7",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.10.226",
                            "lessThanOrEqual": "5.10.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.15.22",
                            "lessThanOrEqual": "5.15.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.16.8",
                            "lessThanOrEqual": "5.16.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.17",
                            "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": "3.7",
                                    "versionEndExcluding": "5.10.226"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "3.7",
                                    "versionEndExcluding": "5.15.22"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "3.7",
                                    "versionEndExcluding": "5.16.8"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "3.7",
                                    "versionEndExcluding": "5.17"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "url": "https://git.kernel.org/stable/c/7e4c72dbaf62f8978af8321a24dbd35566d3a78a"
                },
                {
                    "url": "https://git.kernel.org/stable/c/a7b717fa15165d3d9245614680bebc48a52ac05d"
                },
                {
                    "url": "https://git.kernel.org/stable/c/9372fa1d73da5f1673921e365d0cd2c27ec7adc2"
                },
                {
                    "url": "https://git.kernel.org/stable/c/28b21c558a3753171097193b6f6602a94169093a"
                }
            ],
            "title": "btrfs: fix use-after-free after failure to create a snapshot",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        },
        "adp": [
            {
                "title": "CVE Program Container",
                "references": [
                    {
                        "url": "https://git.kernel.org/stable/c/a7b717fa15165d3d9245614680bebc48a52ac05d",
                        "tags": [
                            "x_transferred"
                        ]
                    },
                    {
                        "url": "https://git.kernel.org/stable/c/9372fa1d73da5f1673921e365d0cd2c27ec7adc2",
                        "tags": [
                            "x_transferred"
                        ]
                    },
                    {
                        "url": "https://git.kernel.org/stable/c/28b21c558a3753171097193b6f6602a94169093a",
                        "tags": [
                            "x_transferred"
                        ]
                    },
                    {
                        "url": "https://lists.debian.org/debian-lts-announce/2024/10/msg00003.html"
                    }
                ],
                "providerMetadata": {
                    "orgId": "af854a3a-2127-422b-91ae-364da2661108",
                    "shortName": "CVE",
                    "dateUpdated": "2025-11-03T21:46:47.137Z"
                }
            },
            {
                "metrics": [
                    {
                        "other": {
                            "type": "ssvc",
                            "content": {
                                "id": "CVE-2022-48733",
                                "role": "CISA Coordinator",
                                "options": [
                                    {
                                        "Exploitation": "none"
                                    },
                                    {
                                        "Automatable": "no"
                                    },
                                    {
                                        "Technical Impact": "partial"
                                    }
                                ],
                                "version": "2.0.3",
                                "timestamp": "2024-09-10T17:10:54.149503Z"
                            }
                        }
                    }
                ],
                "title": "CISA ADP Vulnrichment",
                "providerMetadata": {
                    "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
                    "shortName": "CISA-ADP",
                    "dateUpdated": "2024-09-11T17:34:48.869Z"
                }
            }
        ]
    }
}