{"api_version":"1","generated_at":"2026-12-01T15:25:28+00:00","cve":"CVE-2026-139642","urls":{"html":"https://cve.report/CVE-2026-139642","api":"https://cve.report/api/cve/CVE-2026-139642.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-139642","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-139642"},"summary":{"title":"swim: Fix buffer overflow","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nswim: Fix buffer overflow\n\nThe effect of this bug can be observed as swim_read_sector_data()\ninexplicably returning -5, or an error flag indicating that a mark byte\nwas read from the data register, or other odd behviour.\n\nWhen copying bytes from the chip FIFO to the read buffer, the driver\nkeeps count of the remaining buffer space using register %d4. A counter\nin register %d2 serves as a timeout. The driver polls (%a2), the handshake\nregister, until flags indicate that byte(s) have arrived in the FIFO.\n\n        movel   #sector_size-1, %d4\nread_new_data:\n        movew   #max_retry, %d2\nread_data_loop:\n        moveb   %a2@, %d5\n        andb    #0xc0, %d5\n        dbne    %d2, read_data_loop\n        beq     data_exit\n        moveb   %a5@, %a4@+\n        andb    #0x40, %d5\n        dbne    %d4, read_new_data\n        beq     exit_loop\n\nNote that the exit_loop branch depends upon a flag in the handshake\nregister and not on the remaining buffer space. Hence there may be no\nbranch to exit_loop after %d4 is decremented to -1 (i.e. full buffer).\n\n        moveb   %a5@, %a4@+\n        dbra    %d4, read_new_data\nexit_loop:\n\nHere is a second decrement of %d4 which can now reach -2. But the buffer\nbounds check is a comparison with -1, which is now ineffective. Hence the\nloop will continue copying until %d2 eventually reaches -1.\n\nFix this bug by terminating the loop as soon as %d4 or %d2 reach -1.\nReset the timeout whenever a byte is copied.","state":"PUBLISHED","assigner":"Linux","published_at":"2026-11-30 14:19:47","updated_at":"2026-11-30 14:19:47"},"problem_types":[],"metrics":[],"references":[{"url":"https://git.kernel.org/stable/c/759e236477c30e75653dc050f18ab3d1c5127c9c","name":"https://git.kernel.org/stable/c/759e236477c30e75653dc050f18ab3d1c5127c9c","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/29381bf1af7faf118cbb90b2a00e7fef7992417d","name":"https://git.kernel.org/stable/c/29381bf1af7faf118cbb90b2a00e7fef7992417d","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/ec567485ac9f46d2cfaa0c444a3ddd03be8836e5","name":"https://git.kernel.org/stable/c/ec567485ac9f46d2cfaa0c444a3ddd03be8836e5","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/b2f91fb5087c49828ea61da2f95263a1ff14872c","name":"https://git.kernel.org/stable/c/b2f91fb5087c49828ea61da2f95263a1ff14872c","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/a54870a4ae4962acf341eb6ca010cae02af1a6ea","name":"https://git.kernel.org/stable/c/a54870a4ae4962acf341eb6ca010cae02af1a6ea","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/504285224519be0f39e01da9fbabfc8d69b60871","name":"https://git.kernel.org/stable/c/504285224519be0f39e01da9fbabfc8d69b60871","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/f7c4e7e402fc2b4b74679119a8ad42ea28b3cdff","name":"https://git.kernel.org/stable/c/f7c4e7e402fc2b4b74679119a8ad42ea28b3cdff","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/382147d4bf4fc371ae1c9beb892dfd6aacabc6b4","name":"https://git.kernel.org/stable/c/382147d4bf4fc371ae1c9beb892dfd6aacabc6b4","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-139642","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139642","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 8852ecd97488249ca7fe2c0d3eb44cae95886881 f7c4e7e402fc2b4b74679119a8ad42ea28b3cdff git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 8852ecd97488249ca7fe2c0d3eb44cae95886881 ec567485ac9f46d2cfaa0c444a3ddd03be8836e5 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 8852ecd97488249ca7fe2c0d3eb44cae95886881 382147d4bf4fc371ae1c9beb892dfd6aacabc6b4 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 8852ecd97488249ca7fe2c0d3eb44cae95886881 504285224519be0f39e01da9fbabfc8d69b60871 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 8852ecd97488249ca7fe2c0d3eb44cae95886881 29381bf1af7faf118cbb90b2a00e7fef7992417d git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 8852ecd97488249ca7fe2c0d3eb44cae95886881 b2f91fb5087c49828ea61da2f95263a1ff14872c git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 8852ecd97488249ca7fe2c0d3eb44cae95886881 759e236477c30e75653dc050f18ab3d1c5127c9c git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 8852ecd97488249ca7fe2c0d3eb44cae95886881 a54870a4ae4962acf341eb6ca010cae02af1a6ea git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 2.6.30","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 2.6.30 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.10.275 5.10.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.15.226 5.15.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.1.193 6.1.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.6.163 6.6.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.12.119 6.12.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.18.65 6.18.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.3.6 7.3.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.4-rc1 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["drivers/block/swim_asm.S"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"f7c4e7e402fc2b4b74679119a8ad42ea28b3cdff","status":"affected","version":"8852ecd97488249ca7fe2c0d3eb44cae95886881","versionType":"git"},{"lessThan":"ec567485ac9f46d2cfaa0c444a3ddd03be8836e5","status":"affected","version":"8852ecd97488249ca7fe2c0d3eb44cae95886881","versionType":"git"},{"lessThan":"382147d4bf4fc371ae1c9beb892dfd6aacabc6b4","status":"affected","version":"8852ecd97488249ca7fe2c0d3eb44cae95886881","versionType":"git"},{"lessThan":"504285224519be0f39e01da9fbabfc8d69b60871","status":"affected","version":"8852ecd97488249ca7fe2c0d3eb44cae95886881","versionType":"git"},{"lessThan":"29381bf1af7faf118cbb90b2a00e7fef7992417d","status":"affected","version":"8852ecd97488249ca7fe2c0d3eb44cae95886881","versionType":"git"},{"lessThan":"b2f91fb5087c49828ea61da2f95263a1ff14872c","status":"affected","version":"8852ecd97488249ca7fe2c0d3eb44cae95886881","versionType":"git"},{"lessThan":"759e236477c30e75653dc050f18ab3d1c5127c9c","status":"affected","version":"8852ecd97488249ca7fe2c0d3eb44cae95886881","versionType":"git"},{"lessThan":"a54870a4ae4962acf341eb6ca010cae02af1a6ea","status":"affected","version":"8852ecd97488249ca7fe2c0d3eb44cae95886881","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["drivers/block/swim_asm.S"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"2.6.30"},{"lessThan":"2.6.30","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"5.10.*","status":"unaffected","version":"5.10.275","versionType":"semver"},{"lessThanOrEqual":"5.15.*","status":"unaffected","version":"5.15.226","versionType":"semver"},{"lessThanOrEqual":"6.1.*","status":"unaffected","version":"6.1.193","versionType":"semver"},{"lessThanOrEqual":"6.6.*","status":"unaffected","version":"6.6.163","versionType":"semver"},{"lessThanOrEqual":"6.12.*","status":"unaffected","version":"6.12.119","versionType":"semver"},{"lessThanOrEqual":"6.18.*","status":"unaffected","version":"6.18.65","versionType":"semver"},{"lessThanOrEqual":"7.3.*","status":"unaffected","version":"7.3.6","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.4-rc1","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"5.10.275","versionStartIncluding":"2.6.30","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"5.15.226","versionStartIncluding":"2.6.30","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.1.193","versionStartIncluding":"2.6.30","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.6.163","versionStartIncluding":"2.6.30","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.12.119","versionStartIncluding":"2.6.30","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.18.65","versionStartIncluding":"2.6.30","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3.6","versionStartIncluding":"2.6.30","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.4-rc1","versionStartIncluding":"2.6.30","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nswim: Fix buffer overflow\n\nThe effect of this bug can be observed as swim_read_sector_data()\ninexplicably returning -5, or an error flag indicating that a mark byte\nwas read from the data register, or other odd behviour.\n\nWhen copying bytes from the chip FIFO to the read buffer, the driver\nkeeps count of the remaining buffer space using register %d4. A counter\nin register %d2 serves as a timeout. The driver polls (%a2), the handshake\nregister, until flags indicate that byte(s) have arrived in the FIFO.\n\n        movel   #sector_size-1, %d4\nread_new_data:\n        movew   #max_retry, %d2\nread_data_loop:\n        moveb   %a2@, %d5\n        andb    #0xc0, %d5\n        dbne    %d2, read_data_loop\n        beq     data_exit\n        moveb   %a5@, %a4@+\n        andb    #0x40, %d5\n        dbne    %d4, read_new_data\n        beq     exit_loop\n\nNote that the exit_loop branch depends upon a flag in the handshake\nregister and not on the remaining buffer space. Hence there may be no\nbranch to exit_loop after %d4 is decremented to -1 (i.e. full buffer).\n\n        moveb   %a5@, %a4@+\n        dbra    %d4, read_new_data\nexit_loop:\n\nHere is a second decrement of %d4 which can now reach -2. But the buffer\nbounds check is a comparison with -1, which is now ineffective. Hence the\nloop will continue copying until %d2 eventually reaches -1.\n\nFix this bug by terminating the loop as soon as %d4 or %d2 reach -1.\nReset the timeout whenever a byte is copied."}],"providerMetadata":{"dateUpdated":"2026-11-30T13:36:38.542Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/f7c4e7e402fc2b4b74679119a8ad42ea28b3cdff"},{"url":"https://git.kernel.org/stable/c/ec567485ac9f46d2cfaa0c444a3ddd03be8836e5"},{"url":"https://git.kernel.org/stable/c/382147d4bf4fc371ae1c9beb892dfd6aacabc6b4"},{"url":"https://git.kernel.org/stable/c/504285224519be0f39e01da9fbabfc8d69b60871"},{"url":"https://git.kernel.org/stable/c/29381bf1af7faf118cbb90b2a00e7fef7992417d"},{"url":"https://git.kernel.org/stable/c/b2f91fb5087c49828ea61da2f95263a1ff14872c"},{"url":"https://git.kernel.org/stable/c/759e236477c30e75653dc050f18ab3d1c5127c9c"},{"url":"https://git.kernel.org/stable/c/a54870a4ae4962acf341eb6ca010cae02af1a6ea"}],"title":"swim: Fix buffer overflow","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-139642","datePublished":"2026-11-30T13:36:38.542Z","dateReserved":"2026-11-30T13:22:15.945Z","dateUpdated":"2026-11-30T13:36:38.542Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-11-30 14:19:47","lastModifiedDate":"2026-11-30 14:19:47","problem_types":[],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"139642","Ordinal":"1","Title":"swim: Fix buffer overflow","CVE":"CVE-2026-139642","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"139642","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\nswim: Fix buffer overflow\n\nThe effect of this bug can be observed as swim_read_sector_data()\ninexplicably returning -5, or an error flag indicating that a mark byte\nwas read from the data register, or other odd behviour.\n\nWhen copying bytes from the chip FIFO to the read buffer, the driver\nkeeps count of the remaining buffer space using register %d4. A counter\nin register %d2 serves as a timeout. The driver polls (%a2), the handshake\nregister, until flags indicate that byte(s) have arrived in the FIFO.\n\n        movel   #sector_size-1, %d4\nread_new_data:\n        movew   #max_retry, %d2\nread_data_loop:\n        moveb   %a2@, %d5\n        andb    #0xc0, %d5\n        dbne    %d2, read_data_loop\n        beq     data_exit\n        moveb   %a5@, %a4@+\n        andb    #0x40, %d5\n        dbne    %d4, read_new_data\n        beq     exit_loop\n\nNote that the exit_loop branch depends upon a flag in the handshake\nregister and not on the remaining buffer space. Hence there may be no\nbranch to exit_loop after %d4 is decremented to -1 (i.e. full buffer).\n\n        moveb   %a5@, %a4@+\n        dbra    %d4, read_new_data\nexit_loop:\n\nHere is a second decrement of %d4 which can now reach -2. But the buffer\nbounds check is a comparison with -1, which is now ineffective. Hence the\nloop will continue copying until %d2 eventually reaches -1.\n\nFix this bug by terminating the loop as soon as %d4 or %d2 reach -1.\nReset the timeout whenever a byte is copied.","Type":"Description","Title":"swim: Fix buffer overflow"}]}}}