{"id":"CVE-2026-31715","aliases":["CVE-2026-31715"],"related":[],"kind":"vulnerability","state":"published","title":"f2fs: fix UAF caused by decrementing sbi->nr_pages[] in f2fs_write_end_io()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nf2fs: fix UAF caused by decrementing sbi->nr_pages[] in f2fs_write_end_io()\n\nThe xfstests case \"generic/107\" and syzbot have both reported a NULL\npointer dereference.\n\nThe concurrent scenario that triggers the panic is as follows:\n\nF2FS_WB_CP_DATA write callback          umount\n                                        - f2fs_write_checkpoint\n                                         - f2fs_wait_on_all_pages(sbi, F2FS_WB_CP_DATA)\n- blk_mq_end_request\n - bio_endio\n  - f2fs_write_end_io\n   : dec_page_count(sbi, F2FS_WB_CP_DATA)\n   : wake_up(&sbi->cp_wait)\n                                        - kill_f2fs_super\n                                         - kill_block_super\n                                          - f2fs_put_super\n                                           : iput(sbi->node_inode)\n                                           : sbi->node_inode = NULL\n   : f2fs_in_warm_node_list\n    - is_node_folio // sbi->node_inode is NULL and panic\n\nThe root cause is that f2fs_put_super() calls iput(sbi->node_inode) and\nsets sbi->node_inode to NULL after sbi->nr_pages[F2FS_WB_CP_DATA] is\ndecremented to zero. As a result, f2fs_in_warm_node_list() may\ndereference a NULL node_inode when checking whether a folio belongs to\nthe node inode, leading to a panic.\n\nThis patch fixes the issue by calling f2fs_in_warm_node_list() before\ndecrementing sbi->nr_pages[F2FS_WB_CP_DATA], thus preventing the\nuse-after-free condition.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nf2fs: fix UAF caused by decrementing sbi->nr_pages[] in f2fs_write_end_io()\n\nThe xfstests case \"generic/107\" and syzbot have both reported a NULL\npointer dereference.\n\nThe concurrent scenario that triggers the panic is as follows:\n\nF2FS_WB_CP_DATA write callback          umount\n                                        - f2fs_write_checkpoint\n                                         - f2fs_wait_on_all_pages(sbi, F2FS_WB_CP_DATA)\n- blk_mq_end_request\n - bio_endio\n  - f2fs_write_end_io\n   : dec_page_count(sbi, F2FS_WB_CP_DATA)\n   : wake_up(&sbi->cp_wait)\n                                        - kill_f2fs_super\n                                         - kill_block_super\n                                          - f2fs_put_super\n                                           : iput(sbi->node_inode)\n                                           : sbi->node_inode = NULL\n   : f2fs_in_warm_node_list\n    - is_node_folio // sbi->node_inode is NULL and panic\n\nThe root cause is that f2fs_put_super() calls iput(sbi->node_inode) and\nsets sbi->node_inode to NULL after sbi->nr_pages[F2FS_WB_CP_DATA] is\ndecremented to zero. As a result, f2fs_in_warm_node_list() may\ndereference a NULL node_inode when checking whether a folio belongs to\nthe node inode, leading to a panic.\n\nThis patch fixes the issue by calling f2fs_in_warm_node_list() before\ndecrementing sbi->nr_pages[F2FS_WB_CP_DATA], thus preventing the\nuse-after-free condition.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nf2fs: corrige UAF causada por la disminución de sbi  ->  nr_pages[] en f2fs_write_end_io()\n\nEl caso de xfstests ’generic/107’ y syzbot han reportado ambos una desreferencia de puntero NULL.\n\nEl escenario concurrente que desencadena el pánico es el siguiente:\n\nF2FS_WB_CP_DATA write callback          desmontar\n                                        - f2fs_write_checkpoint\n                                         - f2fs_wait_on_all_pages(sbi, F2FS_WB_CP_DATA)\n- blk_mq_end_request\n - bio_endio\n  - f2fs_write_end_io\n   : dec_page_count(sbi, F2FS_WB_CP_DATA)\n   : wake_up(&sbi  ->  cp_wait)\n                                        - kill_f2fs_super\n                                         - kill_block_super\n                                          - f2fs_put_super\n                                           : iput(sbi  ->  node_inode)\n                                           : sbi  ->  node_inode = NULL\n   : f2fs_in_warm_node_list\n    - is_node_folio // sbi  ->  node_inode es NULL y pánico\n\nLa causa raíz es que f2fs_put_super() llama a iput(sbi  ->  node_inode) y establece sbi  ->  node_inode en NULL después de que sbi  ->  nr_pages[F2FS_WB_CP_DATA] se decrementa a cero. Como resultado, f2fs_in_warm_node_list() puede desreferenciar un node_inode NULL al verificar si un folio pertenece al nodo inode, lo que lleva a un pánico.\n\nEste parche corrige el problema llamando a f2fs_in_warm_node_list() antes de decrementar sbi  ->  nr_pages[F2FS_WB_CP_DATA], evitando así la condición de uso después de liberación.","source":"nvd"}],"published":"2026-05-01T13:56:10.591Z","modified":"2026-11-11T21:10:00.200Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":["CWE-416"],"affected":[{"ranges":[{"type":"git","introduced":"50fa53eccf9f911a5b435248a2b0bd484fd82e5e","fixed":"7dbdab4430e4654db9aacef12b9b3b8b29ca25cb","status":"affected"},{"type":"git","introduced":"50fa53eccf9f911a5b435248a2b0bd484fd82e5e","fixed":"ffb94770dbdfb5411be5d9f44a960b010ec890ad","status":"affected"},{"type":"git","introduced":"50fa53eccf9f911a5b435248a2b0bd484fd82e5e","fixed":"0d40b26377f891e6dcb6efaf8ef9374c99be1b1d","status":"affected"},{"type":"git","introduced":"50fa53eccf9f911a5b435248a2b0bd484fd82e5e","fixed":"1171f329cf1c175321251ac40fd126150d7ad1e8","status":"affected"},{"type":"git","introduced":"50fa53eccf9f911a5b435248a2b0bd484fd82e5e","fixed":"7be222de96c0f9eee6e65eeb017ef855ee185cfa","status":"affected"},{"type":"git","introduced":"50fa53eccf9f911a5b435248a2b0bd484fd82e5e","fixed":"963d2e24d9d92a31e6773b0f642214f10013ebf7","status":"affected"},{"type":"git","introduced":"50fa53eccf9f911a5b435248a2b0bd484fd82e5e","fixed":"188bb65f247a7a7c62f287c9a263aee3cad96fa5","status":"affected"},{"type":"git","introduced":"50fa53eccf9f911a5b435248a2b0bd484fd82e5e","fixed":"2d9c4a4ed4eef1f82c5b16b037aee8bad819fd53","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"4.19","status":"affected"},{"type":"semver","introduced":"0","fixed":"4.19","status":"unaffected"},{"type":"semver","introduced":"5.10.259","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.210","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.176","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.140","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.86","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.25","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.0.2","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":"4.19","fixed":"6.18.25"},{"status":"affected","introduced":"6.19","fixed":"7.0.2"},{"status":"affected","version":"7.1"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/7dbdab4430e4654db9aacef12b9b3b8b29ca25cb","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ffb94770dbdfb5411be5d9f44a960b010ec890ad","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/0d40b26377f891e6dcb6efaf8ef9374c99be1b1d","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/1171f329cf1c175321251ac40fd126150d7ad1e8","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/7be222de96c0f9eee6e65eeb017ef855ee185cfa","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/963d2e24d9d92a31e6773b0f642214f10013ebf7","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/188bb65f247a7a7c62f287c9a263aee3cad96fa5","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/2d9c4a4ed4eef1f82c5b16b037aee8bad819fd53","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-31715","url":"https://www.cve.org/CVERecord?id=CVE-2026-31715","licence":"CVE Terms of Use","modified":"2026-06-19T11:58:02.837Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-31715","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31715","licence":"Public domain","modified":"2026-11-11T21:10:00.200Z"}],"updatedAt":"2026-11-25T22:59:20.346Z","epss":{"score":0.00122,"percentile":0.0215,"date":"2026-12-01T12:00:22.000Z"}}