{"id":"CVE-2022-50379","aliases":["CVE-2022-50379"],"related":[],"kind":"vulnerability","state":"published","title":"btrfs: fix race between quota enable and quota rescan ioctl","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: fix race between quota enable and quota rescan ioctl\n\nWhen enabling quotas, at btrfs_quota_enable(), after committing the\ntransaction, we change fs_info->quota_root to point to the quota root we\ncreated and set BTRFS_FS_QUOTA_ENABLED at fs_info->flags. Then we try\nto start the qgroup rescan worker, first by initializing it with a call\nto qgroup_rescan_init() - however if that fails we end up freeing the\nquota root but we leave fs_info->quota_root still pointing to it, this\ncan later result in a use-after-free somewhere else.\n\nWe have previously set the flags BTRFS_FS_QUOTA_ENABLED and\nBTRFS_QGROUP_STATUS_FLAG_ON, so we can only fail with -EINPROGRESS at\nbtrfs_quota_enable(), which is possible if someone already called the\nquota rescan ioctl, and therefore started the rescan worker.\n\nSo fix this by ignoring an -EINPROGRESS and asserting we can't get any\nother error.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: fix race between quota enable and quota rescan ioctl\n\nWhen enabling quotas, at btrfs_quota_enable(), after committing the\ntransaction, we change fs_info->quota_root to point to the quota root we\ncreated and set BTRFS_FS_QUOTA_ENABLED at fs_info->flags. Then we try\nto start the qgroup rescan worker, first by initializing it with a call\nto qgroup_rescan_init() - however if that fails we end up freeing the\nquota root but we leave fs_info->quota_root still pointing to it, this\ncan later result in a use-after-free somewhere else.\n\nWe have previously set the flags BTRFS_FS_QUOTA_ENABLED and\nBTRFS_QGROUP_STATUS_FLAG_ON, so we can only fail with -EINPROGRESS at\nbtrfs_quota_enable(), which is possible if someone already called the\nquota rescan ioctl, and therefore started the rescan worker.\n\nSo fix this by ignoring an -EINPROGRESS and asserting we can't get any\nother error.","source":"cvelist"}],"published":"2025-09-18T13:33:01.502Z","modified":"2026-06-17T05:23:22.983Z","severity":{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H","score":4.7,"rating":"MEDIUM"},"severities":[{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H","score":4.7,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H","score":4.7,"rating":"MEDIUM"}],"cwes":["CWE-362"],"affected":[{"ranges":[{"type":"git","introduced":"5d23515be66904fa3b1b5d6bd72d2199cd2447ab","fixed":"c97f6d528c3f1c83a6b792a8a7928c236c80b8fe","status":"affected"},{"type":"git","introduced":"5d23515be66904fa3b1b5d6bd72d2199cd2447ab","fixed":"26b7c0ac49a3eea15559c9d84863736a6d1164b4","status":"affected"},{"type":"git","introduced":"5d23515be66904fa3b1b5d6bd72d2199cd2447ab","fixed":"47b5ffe86332af95f0f52be0a63d4da7c2b37b55","status":"affected"},{"type":"git","introduced":"5d23515be66904fa3b1b5d6bd72d2199cd2447ab","fixed":"4b996a3014ef014af8f97b60c35f5289210a4720","status":"affected"},{"type":"git","introduced":"5d23515be66904fa3b1b5d6bd72d2199cd2447ab","fixed":"0efd9dfc00d677a1d0929319a6103cb2dfc41c22","status":"affected"},{"type":"git","introduced":"5d23515be66904fa3b1b5d6bd72d2199cd2447ab","fixed":"6c22f86dd221eba0c7af645b1af73dcbc04ee27b","status":"affected"},{"type":"git","introduced":"5d23515be66904fa3b1b5d6bd72d2199cd2447ab","fixed":"331cd9461412e103d07595a10289de90004ac890","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"4.17","status":"affected"},{"type":"semver","introduced":"0","fixed":"4.17","status":"unaffected"},{"type":"semver","introduced":"4.19.262","lastAffected":"4.19.*","status":"unaffected"},{"type":"semver","introduced":"5.4.220","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.150","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.75","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"5.19.17","lastAffected":"5.19.*","status":"unaffected"},{"type":"semver","introduced":"6.0.3","lastAffected":"6.0.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","fixed":"4.19.262"},{"status":"affected","introduced":"4.20","fixed":"5.4.220"},{"status":"affected","introduced":"5.5","fixed":"5.10.150"},{"status":"affected","introduced":"5.11","fixed":"5.15.75"},{"status":"affected","introduced":"5.16","fixed":"5.19.17"},{"status":"affected","introduced":"6.0","fixed":"6.0.3"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/c97f6d528c3f1c83a6b792a8a7928c236c80b8fe","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/26b7c0ac49a3eea15559c9d84863736a6d1164b4","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/47b5ffe86332af95f0f52be0a63d4da7c2b37b55","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/4b996a3014ef014af8f97b60c35f5289210a4720","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/0efd9dfc00d677a1d0929319a6103cb2dfc41c22","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6c22f86dd221eba0c7af645b1af73dcbc04ee27b","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/331cd9461412e103d07595a10289de90004ac890","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-01-14T18:47:13.915Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-50379","url":"https://www.cve.org/CVERecord?id=CVE-2022-50379","licence":"CVE Terms of Use","modified":"2026-05-11T19:18:23.937Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-50379","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-50379","licence":"Public domain","modified":"2026-06-17T05:23:22.983Z"}],"updatedAt":"2026-11-25T22:58:21.189Z","epss":{"score":0.00115,"percentile":0.01728,"date":"2026-12-01T12:00:22.000Z"}}