{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2022-48822",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2024-07-16T11:38:08.902Z",
        "datePublished": "2024-07-16T11:44:08.638Z",
        "dateUpdated": "2026-08-05T08:52:31.008Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-08-05T08:52:31.008Z"
            },
            "descriptions": [
                {
                    "lang": "en",
                    "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nusb: f_fs: Fix use-after-free for epfile\n\nConsider a case where ffs_func_eps_disable is called from\nffs_func_disable as part of composition switch and at the\nsame time ffs_epfile_release get called from userspace.\nffs_epfile_release will free up the read buffer and call\nffs_data_closed which in turn destroys ffs->epfiles and\nmark it as NULL. While this was happening the driver has\nalready initialized the local epfile in ffs_func_eps_disable\nwhich is now freed and waiting to acquire the spinlock. Once\nspinlock is acquired the driver proceeds with the stale value\nof epfile and tries to free the already freed read buffer\ncausing use-after-free.\n\nFollowing is the illustration of the race:\n\n      CPU1                                  CPU2\n\n   ffs_func_eps_disable\n   epfiles (local copy)\n\t\t\t\t\tffs_epfile_release\n\t\t\t\t\tffs_data_closed\n\t\t\t\t\tif (last file closed)\n\t\t\t\t\tffs_data_reset\n\t\t\t\t\tffs_data_clear\n\t\t\t\t\tffs_epfiles_destroy\nspin_lock\ndereference epfiles\n\nFix this races by taking epfiles local copy & assigning it under\nspinlock and if epfiles(local) is null then update it in ffs->epfiles\nthen finally destroy it.\nExtending the scope further from the race, protecting the ep related\nstructures, and concurrent accesses."
                }
            ],
            "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 race is driven by local FunctionFS epfile close() racing gadget disable/unbind (configfs UDC rewrite or Android USB composition switch), not by USB wire traffic alone; like other f_fs UAFs, reachability is via local VFS/gadget management, which is also the higher-severity vector versus Physical.\nAC:L - The attacker controls both sides by concurrently closing FunctionFS endpoint files while triggering composition switch/UDC unbind from a process they influence, and can retry until the stale epfiles snapshot is used.\nPR:L - Although functionfs lacks FS_USERNS_MOUNT, mounts commonly use uid=/gid=/fmode= to delegate epfile access to non-root gadget daemons (adbd, MTP, USB HAL helpers), so a low-privileged local service account can open/close the vulnerable paths.\nUI:N - The attacker performs the close and composition-switch operations themselves; no separate victim action is required beyond the already-running FunctionFS gadget setup.\nS:U - The use-after-free corrupts host kernel heap state within the same security authority and does not cross a VM, IOMMU, or sandbox boundary.\nC:H - The race frees epfile/read_buffer objects while ffs_func_eps_disable still holds a stale pointer and re-enters __ffs_epfile_read_buffer_free, a classic UAF/double-free that heap spraying can turn into arbitrary kernel memory disclosure.\nI:H - UAF/double-free of the epfile array and read_buffer slab objects enables reclaim and corruption of adjacent heap state, yielding arbitrary write and control-flow hijacking primitives under standard UAF exploitation.\nA:H - Dereferencing or double-freeing the destroyed epfile/read_buffer state causes kernel oops/panic even without a full exploit, so availability impact is High for any UAF."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "drivers/usb/gadget/function/f_fs.c"
                    ],
                    "versions": [
                        {
                            "version": "a9e6f83c2df199187a5248f824f31b6787ae23ae",
                            "lessThan": "32048f4be071f9a6966744243f1786f45bb22dc2",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "a9e6f83c2df199187a5248f824f31b6787ae23ae",
                            "lessThan": "cfe5f6fd335d882bcc829a1c8a7d462a455c626e",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "a9e6f83c2df199187a5248f824f31b6787ae23ae",
                            "lessThan": "c9fc422c9a43e3d58d246334a71f3390401781dc",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "a9e6f83c2df199187a5248f824f31b6787ae23ae",
                            "lessThan": "0042178a69eb77a979e36a50dcce9794a3140ef8",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "a9e6f83c2df199187a5248f824f31b6787ae23ae",
                            "lessThan": "72a8aee863af099d4434314c4536d6c9a61dcf3c",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "a9e6f83c2df199187a5248f824f31b6787ae23ae",
                            "lessThan": "3e078b18753669615301d946297bafd69294ad2c",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "a9e6f83c2df199187a5248f824f31b6787ae23ae",
                            "lessThan": "ebe2b1add1055b903e2acd86b290a85297edc0b3",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "5cd8f6788ff34999dbd4cbec81a6adfc215e1e60",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "4.8.10",
                            "lessThan": "4.9",
                            "status": "affected",
                            "versionType": "semver"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "drivers/usb/gadget/function/f_fs.c"
                    ],
                    "versions": [
                        {
                            "version": "4.9",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "4.9",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "4.14.267",
                            "lessThanOrEqual": "4.14.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "4.19.230",
                            "lessThanOrEqual": "4.19.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.4.180",
                            "lessThanOrEqual": "5.4.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.10.101",
                            "lessThanOrEqual": "5.10.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.15.24",
                            "lessThanOrEqual": "5.15.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.16.10",
                            "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": "4.9",
                                    "versionEndExcluding": "4.14.267"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.9",
                                    "versionEndExcluding": "4.19.230"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.9",
                                    "versionEndExcluding": "5.4.180"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.9",
                                    "versionEndExcluding": "5.10.101"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.9",
                                    "versionEndExcluding": "5.15.24"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.9",
                                    "versionEndExcluding": "5.16.10"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.9",
                                    "versionEndExcluding": "5.17"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.8.10"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "url": "https://git.kernel.org/stable/c/32048f4be071f9a6966744243f1786f45bb22dc2"
                },
                {
                    "url": "https://git.kernel.org/stable/c/cfe5f6fd335d882bcc829a1c8a7d462a455c626e"
                },
                {
                    "url": "https://git.kernel.org/stable/c/c9fc422c9a43e3d58d246334a71f3390401781dc"
                },
                {
                    "url": "https://git.kernel.org/stable/c/0042178a69eb77a979e36a50dcce9794a3140ef8"
                },
                {
                    "url": "https://git.kernel.org/stable/c/72a8aee863af099d4434314c4536d6c9a61dcf3c"
                },
                {
                    "url": "https://git.kernel.org/stable/c/3e078b18753669615301d946297bafd69294ad2c"
                },
                {
                    "url": "https://git.kernel.org/stable/c/ebe2b1add1055b903e2acd86b290a85297edc0b3"
                }
            ],
            "title": "usb: f_fs: Fix use-after-free for epfile",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        },
        "adp": [
            {
                "providerMetadata": {
                    "orgId": "af854a3a-2127-422b-91ae-364da2661108",
                    "shortName": "CVE",
                    "dateUpdated": "2024-08-03T15:25:01.599Z"
                },
                "title": "CVE Program Container",
                "references": [
                    {
                        "url": "https://git.kernel.org/stable/c/32048f4be071f9a6966744243f1786f45bb22dc2",
                        "tags": [
                            "x_transferred"
                        ]
                    },
                    {
                        "url": "https://git.kernel.org/stable/c/cfe5f6fd335d882bcc829a1c8a7d462a455c626e",
                        "tags": [
                            "x_transferred"
                        ]
                    },
                    {
                        "url": "https://git.kernel.org/stable/c/c9fc422c9a43e3d58d246334a71f3390401781dc",
                        "tags": [
                            "x_transferred"
                        ]
                    },
                    {
                        "url": "https://git.kernel.org/stable/c/0042178a69eb77a979e36a50dcce9794a3140ef8",
                        "tags": [
                            "x_transferred"
                        ]
                    },
                    {
                        "url": "https://git.kernel.org/stable/c/72a8aee863af099d4434314c4536d6c9a61dcf3c",
                        "tags": [
                            "x_transferred"
                        ]
                    },
                    {
                        "url": "https://git.kernel.org/stable/c/3e078b18753669615301d946297bafd69294ad2c",
                        "tags": [
                            "x_transferred"
                        ]
                    },
                    {
                        "url": "https://git.kernel.org/stable/c/ebe2b1add1055b903e2acd86b290a85297edc0b3",
                        "tags": [
                            "x_transferred"
                        ]
                    }
                ]
            },
            {
                "metrics": [
                    {
                        "other": {
                            "type": "ssvc",
                            "content": {
                                "id": "CVE-2022-48822",
                                "role": "CISA Coordinator",
                                "options": [
                                    {
                                        "Exploitation": "none"
                                    },
                                    {
                                        "Automatable": "no"
                                    },
                                    {
                                        "Technical Impact": "partial"
                                    }
                                ],
                                "version": "2.0.3",
                                "timestamp": "2024-09-10T16:57:56.394722Z"
                            }
                        }
                    }
                ],
                "title": "CISA ADP Vulnrichment",
                "providerMetadata": {
                    "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
                    "shortName": "CISA-ADP",
                    "dateUpdated": "2024-09-11T17:34:12.015Z"
                }
            }
        ]
    }
}