{"id":"CVE-2026-139022","state":"PUBLISHED","title":"lib/842: reject output overflows from index and short data","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nlib/842: reject output overflows from index and short data\n\nThe output length passed to sw842_decompress() is the caller's buffer\ncapacity. Indexed copies write 2, 4 or 8 bytes and short-data templates\nwrite up to 7, but neither checks that capacity before writing and\ndecrementing p->olen.\n\nOverwriting an undersized destination then underflows p->olen, which is\nunsigned, so every later bounds check in the stream passes. Subsequent\noperations keep writing past the destination, and a matching CRC lets\nsw842_decompress() return success with an output length larger than the\ncapacity the caller supplied.\n\nThis is reachable through zram's compressed writeback path. With 842\nselected, targeted corruption of the compressed data on its backing device\nmade a KASAN kernel report vmalloc-out-of-bounds writes in __do_index() and\nsw842_decompress() when zram read the page back.\n\nCheck the remaining output before both operations and return -ENOSPC,\nmatching the other output-producing templates.","publishedAt":"2026-11-30T13:27:08.897Z","updatedAt":"2026-11-30T13:27:08.897Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"2da572c959dd5815aef153cf62010b16a498a0d3","status":"affected","lessThan":"5f1cc5c7c2ac4f431519f06c9fe539846f0537e7","versionType":"git"},{"version":"2da572c959dd5815aef153cf62010b16a498a0d3","status":"affected","lessThan":"19645460d0e23da2aad0bc78556cd2906d5e5338","versionType":"git"},{"version":"2da572c959dd5815aef153cf62010b16a498a0d3","status":"affected","lessThan":"e353f26dd53453919c3796c29f18d51118785208","versionType":"git"},{"version":"2da572c959dd5815aef153cf62010b16a498a0d3","status":"affected","lessThan":"c269cdad3c9c8d7b23bcaccb85d45d8ed4d17928","versionType":"git"},{"version":"2da572c959dd5815aef153cf62010b16a498a0d3","status":"affected","lessThan":"bf2fa75552d5962db8538278d282b454bd88dfff","versionType":"git"},{"version":"2da572c959dd5815aef153cf62010b16a498a0d3","status":"affected","lessThan":"a7c9d73df0489afb3b92a23ea326189237d5df67","versionType":"git"},{"version":"2da572c959dd5815aef153cf62010b16a498a0d3","status":"affected","lessThan":"b9652248b8d7142293edad46799dc80b56d29c04","versionType":"git"},{"version":"2da572c959dd5815aef153cf62010b16a498a0d3","status":"affected","lessThan":"38ed7182f3491ec1449ff246551e11ad82adba45","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["lib/842/842_decompress.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.2","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.2","versionType":"semver"},{"version":"5.10.275","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.226","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.193","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.163","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.117","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.63","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.4","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["lib/842/842_decompress.c"]}],"references":["https://git.kernel.org/stable/c/5f1cc5c7c2ac4f431519f06c9fe539846f0537e7","https://git.kernel.org/stable/c/19645460d0e23da2aad0bc78556cd2906d5e5338","https://git.kernel.org/stable/c/e353f26dd53453919c3796c29f18d51118785208","https://git.kernel.org/stable/c/c269cdad3c9c8d7b23bcaccb85d45d8ed4d17928","https://git.kernel.org/stable/c/bf2fa75552d5962db8538278d282b454bd88dfff","https://git.kernel.org/stable/c/a7c9d73df0489afb3b92a23ea326189237d5df67","https://git.kernel.org/stable/c/b9652248b8d7142293edad46799dc80b56d29c04","https://git.kernel.org/stable/c/38ed7182f3491ec1449ff246551e11ad82adba45"],"weaknesses":[],"ingestedAt":"2026-11-30T13:40:04.421Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139022.json","commit":"5317bbbde1916a58cb1fadabb726eb126daf44c1","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139022","state":"PUBLISHED","datePublished":"2026-11-30T13:27:08.897Z","dateUpdated":"2026-11-30T13:27:08.897Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.909Z"},"containers":{"cna":{"title":"lib/842: reject output overflows from index and short data","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nlib/842: reject output overflows from index and short data\n\nThe output length passed to sw842_decompress() is the caller's buffer\ncapacity. Indexed copies write 2, 4 or 8 bytes and short-data templates\nwrite up to 7, but neither checks that capacity before writing and\ndecrementing p->olen.\n\nOverwriting an undersized destination then underflows p->olen, which is\nunsigned, so every later bounds check in the stream passes. Subsequent\noperations keep writing past the destination, and a matching CRC lets\nsw842_decompress() return success with an output length larger than the\ncapacity the caller supplied.\n\nThis is reachable through zram's compressed writeback path. With 842\nselected, targeted corruption of the compressed data on its backing device\nmade a KASAN kernel report vmalloc-out-of-bounds writes in __do_index() and\nsw842_decompress() when zram read the page back.\n\nCheck the remaining output before both operations and return -ENOSPC,\nmatching the other output-producing templates."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"2da572c959dd5815aef153cf62010b16a498a0d3","status":"affected","lessThan":"5f1cc5c7c2ac4f431519f06c9fe539846f0537e7","versionType":"git"},{"version":"2da572c959dd5815aef153cf62010b16a498a0d3","status":"affected","lessThan":"19645460d0e23da2aad0bc78556cd2906d5e5338","versionType":"git"},{"version":"2da572c959dd5815aef153cf62010b16a498a0d3","status":"affected","lessThan":"e353f26dd53453919c3796c29f18d51118785208","versionType":"git"},{"version":"2da572c959dd5815aef153cf62010b16a498a0d3","status":"affected","lessThan":"c269cdad3c9c8d7b23bcaccb85d45d8ed4d17928","versionType":"git"},{"version":"2da572c959dd5815aef153cf62010b16a498a0d3","status":"affected","lessThan":"bf2fa75552d5962db8538278d282b454bd88dfff","versionType":"git"},{"version":"2da572c959dd5815aef153cf62010b16a498a0d3","status":"affected","lessThan":"a7c9d73df0489afb3b92a23ea326189237d5df67","versionType":"git"},{"version":"2da572c959dd5815aef153cf62010b16a498a0d3","status":"affected","lessThan":"b9652248b8d7142293edad46799dc80b56d29c04","versionType":"git"},{"version":"2da572c959dd5815aef153cf62010b16a498a0d3","status":"affected","lessThan":"38ed7182f3491ec1449ff246551e11ad82adba45","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["lib/842/842_decompress.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.2","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.2","versionType":"semver"},{"version":"5.10.275","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.226","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.193","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.163","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.117","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.63","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.4","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["lib/842/842_decompress.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/5f1cc5c7c2ac4f431519f06c9fe539846f0537e7"},{"url":"https://git.kernel.org/stable/c/19645460d0e23da2aad0bc78556cd2906d5e5338"},{"url":"https://git.kernel.org/stable/c/e353f26dd53453919c3796c29f18d51118785208"},{"url":"https://git.kernel.org/stable/c/c269cdad3c9c8d7b23bcaccb85d45d8ed4d17928"},{"url":"https://git.kernel.org/stable/c/bf2fa75552d5962db8538278d282b454bd88dfff"},{"url":"https://git.kernel.org/stable/c/a7c9d73df0489afb3b92a23ea326189237d5df67"},{"url":"https://git.kernel.org/stable/c/b9652248b8d7142293edad46799dc80b56d29c04"},{"url":"https://git.kernel.org/stable/c/38ed7182f3491ec1449ff246551e11ad82adba45"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:27:08.897Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.2","versionEndExcluding":"5.10.275"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.2","versionEndExcluding":"5.15.226"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.2","versionEndExcluding":"6.1.193"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.2","versionEndExcluding":"6.6.163"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.2","versionEndExcluding":"6.12.117"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.2","versionEndExcluding":"6.18.63"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.2","versionEndExcluding":"7.3.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.2","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}