{"id":"CVE-2026-46289","aliases":["CVE-2026-46289"],"related":[],"kind":"vulnerability","state":"published","title":"lib/scatterlist: fix length calculations in extract_kvec_to_sg","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nlib/scatterlist: fix length calculations in extract_kvec_to_sg\n\nPatch series \"Fix bugs in extract_iter_to_sg()\", v3.\n\nFix bugs in the kvec and user variants of extract_iter_to_sg.  This series\nis growing due to useful remarks made by sashiko.dev.\n\nThe main bugs are:\n- The length for an sglist entry when extracting from\n  a kvec can exceed the number of bytes in the page. This\n  is obviously not intended.\n- When extracting a user buffer the sglist is temporarily\n  used as a scratch buffer for extracted page pointers.\n  If the sglist already contains some elements this scratch\n  buffer could overlap with existing entries in the sglist.\n\nThe series adds test cases to the kunit_iov_iter test that demonstrate all\nof these bugs.  Additionally, there is a memory leak fix for the test\nitself.\n\nThe bugs were orignally introduced into kernel v6.3 where the function\nlived in fs/netfs/iterator.c.  It was later moved to lib/scatterlist.c in\nv6.5.  Thus the actual fix is only marked for backports to v6.5+.\n\n\nThis patch (of 5):\n\nWhen extracting from a kvec to a scatterlist, do not cross page\nboundaries.  The required length was already calculated but not used as\nintended.\n\nAdjust the copied length if the loop runs out of sglist entries without\nextracting everything.\n\nWhile there, return immediately from extract_iter_to_sg if there are no\nsglist entries at all.\n\nA subsequent commit will add kunit test cases that demonstrate that the\npatch is necessary.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nlib/scatterlist: fix length calculations in extract_kvec_to_sg\n\nPatch series \"Fix bugs in extract_iter_to_sg()\", v3.\n\nFix bugs in the kvec and user variants of extract_iter_to_sg.  This series\nis growing due to useful remarks made by sashiko.dev.\n\nThe main bugs are:\n- The length for an sglist entry when extracting from\n  a kvec can exceed the number of bytes in the page. This\n  is obviously not intended.\n- When extracting a user buffer the sglist is temporarily\n  used as a scratch buffer for extracted page pointers.\n  If the sglist already contains some elements this scratch\n  buffer could overlap with existing entries in the sglist.\n\nThe series adds test cases to the kunit_iov_iter test that demonstrate all\nof these bugs.  Additionally, there is a memory leak fix for the test\nitself.\n\nThe bugs were orignally introduced into kernel v6.3 where the function\nlived in fs/netfs/iterator.c.  It was later moved to lib/scatterlist.c in\nv6.5.  Thus the actual fix is only marked for backports to v6.5+.\n\n\nThis patch (of 5):\n\nWhen extracting from a kvec to a scatterlist, do not cross page\nboundaries.  The required length was already calculated but not used as\nintended.\n\nAdjust the copied length if the loop runs out of sglist entries without\nextracting everything.\n\nWhile there, return immediately from extract_iter_to_sg if there are no\nsglist entries at all.\n\nA subsequent commit will add kunit test cases that demonstrate that the\npatch is necessary.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nlib/scatterlist: corrige los cálculos de longitud en extract_kvec_to_sg\n\nSerie de parches 'Corrige errores en extract_iter_to_sg()', v3.\n\nCorrige errores en las variantes kvec y de usuario de extract_iter_to_sg. Esta serie está creciendo debido a comentarios útiles hechos por sashiko.dev.\n\nLos principales errores son:\n- La longitud para una entrada de sglist al extraer de un kvec puede exceder el número de bytes en la página. Esto obviamente no está previsto.\n- Al extraer un búfer de usuario, el sglist se utiliza temporalmente como un búfer temporal para punteros de página extraídos. Si el sglist ya contiene algunos elementos, este búfer temporal podría superponerse con entradas existentes en el sglist.\n\nLa serie añade casos de prueba a la prueba kunit_iov_iter que demuestran todos estos errores. Además, hay una corrección de fuga de memoria para la propia prueba.\n\nLos errores fueron introducidos originalmente en el kernel v6.3 donde la función residía en fs/netfs/iterator.c. Posteriormente fue movida a lib/scatterlist.c en v6.5. Por lo tanto, la corrección real solo está marcada para backports a v6.5+.\n\nEste parche (de 5):\n\nAl extraer de un kvec a un scatterlist, no cruzar los límites de página. La longitud requerida ya estaba calculada pero no se usó como se pretendía.\n\nAjustar la longitud copiada si el bucle se queda sin entradas de sglist sin extraer todo.\n\nMientras tanto, regresar inmediatamente de extract_iter_to_sg si no hay ninguna entrada de sglist en absoluto.\n\nUn commit posterior añadirá casos de prueba kunit que demuestran que el parche es necesario.","source":"nvd"}],"published":"2026-06-08T15:46:15.888Z","modified":"2026-08-05T12:31:03.214Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-401"],"affected":[{"ranges":[{"type":"git","introduced":"0185846975339a5c348373aa450a977f5242366b","fixed":"3f17500e86d730c76db638bb3ae52f9b5e496c76","status":"affected"},{"type":"git","introduced":"0185846975339a5c348373aa450a977f5242366b","fixed":"e5e22fc9963469e678c4f4bb38d26adcec107f1e","status":"affected"},{"type":"git","introduced":"0185846975339a5c348373aa450a977f5242366b","fixed":"8fbba6829057979149d1b37d65690c037f3ddf4d","status":"affected"},{"type":"git","introduced":"0185846975339a5c348373aa450a977f5242366b","fixed":"9d38756d0a93b66163554219fa9c3365f40c4035","status":"affected"},{"type":"git","introduced":"0185846975339a5c348373aa450a977f5242366b","fixed":"07b7d66e65d9cfe6b9c2c34aa22cfcaac37a5c45","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.3","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.3","status":"unaffected"},{"type":"semver","introduced":"6.6.140","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.88","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.30","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.0.7","lastAffected":"7.0.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.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","introduced":"6.3","fixed":"6.6.140"},{"status":"affected","introduced":"6.7","fixed":"6.12.88"},{"status":"affected","introduced":"6.13","fixed":"6.18.30"},{"status":"affected","introduced":"6.19","fixed":"7.0.7"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/3f17500e86d730c76db638bb3ae52f9b5e496c76","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/e5e22fc9963469e678c4f4bb38d26adcec107f1e","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/8fbba6829057979149d1b37d65690c037f3ddf4d","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/9d38756d0a93b66163554219fa9c3365f40c4035","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/07b7d66e65d9cfe6b9c2c34aa22cfcaac37a5c45","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-46289","url":"https://www.cve.org/CVERecord?id=CVE-2026-46289","licence":"CVE Terms of Use","modified":"2026-08-05T12:31:03.214Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-46289","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-46289","licence":"Public domain","modified":"2026-07-23T08:10:00.137Z"}],"updatedAt":"2026-11-25T22:59:24.006Z","epss":{"score":0.00457,"percentile":0.41375,"date":"2026-12-01T12:00:22.000Z"}}