{"id":"CVE-2022-50293","aliases":["CVE-2022-50293"],"related":[],"kind":"vulnerability","state":"published","title":"btrfs: do not BUG_ON() on ENOMEM when dropping extent items for a range","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: do not BUG_ON() on ENOMEM when dropping extent items for a range\n\nIf we get -ENOMEM while dropping file extent items in a given range, at\nbtrfs_drop_extents(), due to failure to allocate memory when attempting to\nincrement the reference count for an extent or drop the reference count,\nwe handle it with a BUG_ON(). This is excessive, instead we can simply\nabort the transaction and return the error to the caller. In fact most\ncallers of btrfs_drop_extents(), directly or indirectly, already abort\nthe transaction if btrfs_drop_extents() returns any error.\n\nAlso, we already have error paths at btrfs_drop_extents() that may return\n-ENOMEM and in those cases we abort the transaction, like for example\nanything that changes the b+tree may return -ENOMEM due to a failure to\nallocate a new extent buffer when COWing an existing extent buffer, such\nas a call to btrfs_duplicate_item() for example.\n\nSo replace the BUG_ON() calls with proper logic to abort the transaction\nand return the error.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: do not BUG_ON() on ENOMEM when dropping extent items for a range\n\nIf we get -ENOMEM while dropping file extent items in a given range, at\nbtrfs_drop_extents(), due to failure to allocate memory when attempting to\nincrement the reference count for an extent or drop the reference count,\nwe handle it with a BUG_ON(). This is excessive, instead we can simply\nabort the transaction and return the error to the caller. In fact most\ncallers of btrfs_drop_extents(), directly or indirectly, already abort\nthe transaction if btrfs_drop_extents() returns any error.\n\nAlso, we already have error paths at btrfs_drop_extents() that may return\n-ENOMEM and in those cases we abort the transaction, like for example\nanything that changes the b+tree may return -ENOMEM due to a failure to\nallocate a new extent buffer when COWing an existing extent buffer, such\nas a call to btrfs_duplicate_item() for example.\n\nSo replace the BUG_ON() calls with proper logic to abort the transaction\nand return the error.","source":"cvelist"}],"published":"2025-09-15T14:45:49.338Z","modified":"2026-06-17T05:23:10.223Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-617"],"affected":[{"ranges":[{"type":"git","introduced":"39279cc3d2704cfbf9c35dcb5bdd392159ae4625","fixed":"50f993da945074b2a069da099a0331b23a0c89a0","status":"affected"},{"type":"git","introduced":"39279cc3d2704cfbf9c35dcb5bdd392159ae4625","fixed":"7fbcb635c8fc927d139f3302babcf1b42c09265c","status":"affected"},{"type":"git","introduced":"39279cc3d2704cfbf9c35dcb5bdd392159ae4625","fixed":"1baf3370e2dc5e6bd1368348736189457dab2a27","status":"affected"},{"type":"git","introduced":"39279cc3d2704cfbf9c35dcb5bdd392159ae4625","fixed":"162d053e15fe985f754ef495a96eb3db970c43ed","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"2.6.29","status":"affected"},{"type":"semver","introduced":"0","fixed":"2.6.29","status":"unaffected"},{"type":"semver","introduced":"5.15.86","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.0.16","lastAffected":"6.0.*","status":"unaffected"},{"type":"semver","introduced":"6.1.2","lastAffected":"6.1.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.2","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":"5.15.86"},{"status":"affected","introduced":"5.16","fixed":"6.0.16"},{"status":"affected","introduced":"6.1","fixed":"6.1.2"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/50f993da945074b2a069da099a0331b23a0c89a0","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/7fbcb635c8fc927d139f3302babcf1b42c09265c","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/1baf3370e2dc5e6bd1368348736189457dab2a27","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/162d053e15fe985f754ef495a96eb3db970c43ed","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-50293","url":"https://www.cve.org/CVERecord?id=CVE-2022-50293","licence":"CVE Terms of Use","modified":"2026-05-11T19:16:30.736Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-50293","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-50293","licence":"Public domain","modified":"2026-06-17T05:23:10.223Z"}],"updatedAt":"2026-11-25T22:58:21.151Z","epss":{"score":0.00165,"percentile":0.06046,"date":"2026-12-01T12:00:22.000Z"}}