{"id":"CVE-2022-49257","aliases":["CVE-2022-49257"],"related":[],"kind":"vulnerability","state":"published","title":"watch_queue: Fix NULL dereference in error cleanup","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nwatch_queue: Fix NULL dereference in error cleanup\n\nIn watch_queue_set_size(), the error cleanup code doesn't take account of\nthe fact that __free_page() can't handle a NULL pointer when trying to free\nup buffer pages that did get allocated.\n\nFix this by only calling __free_page() on the pages actually allocated.\n\nWithout the fix, this can lead to something like the following:\n\nBUG: KASAN: null-ptr-deref in __free_pages+0x1f/0x1b0 mm/page_alloc.c:5473\nRead of size 4 at addr 0000000000000034 by task syz-executor168/3599\n...\nCall Trace:\n <TASK>\n __dump_stack lib/dump_stack.c:88 [inline]\n dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106\n __kasan_report mm/kasan/report.c:446 [inline]\n kasan_report.cold+0x66/0xdf mm/kasan/report.c:459\n check_region_inline mm/kasan/generic.c:183 [inline]\n kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189\n instrument_atomic_read include/linux/instrumented.h:71 [inline]\n atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline]\n page_ref_count include/linux/page_ref.h:67 [inline]\n put_page_testzero include/linux/mm.h:717 [inline]\n __free_pages+0x1f/0x1b0 mm/page_alloc.c:5473\n watch_queue_set_size+0x499/0x630 kernel/watch_queue.c:275\n pipe_ioctl+0xac/0x2b0 fs/pipe.c:632\n vfs_ioctl fs/ioctl.c:51 [inline]\n __do_sys_ioctl fs/ioctl.c:874 [inline]\n __se_sys_ioctl fs/ioctl.c:860 [inline]\n __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:860\n do_syscall_x64 arch/x86/entry/common.c:50 [inline]\n do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80\n entry_SYSCALL_64_after_hwframe+0x44/0xae","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nwatch_queue: Fix NULL dereference in error cleanup\n\nIn watch_queue_set_size(), the error cleanup code doesn't take account of\nthe fact that __free_page() can't handle a NULL pointer when trying to free\nup buffer pages that did get allocated.\n\nFix this by only calling __free_page() on the pages actually allocated.\n\nWithout the fix, this can lead to something like the following:\n\nBUG: KASAN: null-ptr-deref in __free_pages+0x1f/0x1b0 mm/page_alloc.c:5473\nRead of size 4 at addr 0000000000000034 by task syz-executor168/3599\n...\nCall Trace:\n <TASK>\n __dump_stack lib/dump_stack.c:88 [inline]\n dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106\n __kasan_report mm/kasan/report.c:446 [inline]\n kasan_report.cold+0x66/0xdf mm/kasan/report.c:459\n check_region_inline mm/kasan/generic.c:183 [inline]\n kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189\n instrument_atomic_read include/linux/instrumented.h:71 [inline]\n atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline]\n page_ref_count include/linux/page_ref.h:67 [inline]\n put_page_testzero include/linux/mm.h:717 [inline]\n __free_pages+0x1f/0x1b0 mm/page_alloc.c:5473\n watch_queue_set_size+0x499/0x630 kernel/watch_queue.c:275\n pipe_ioctl+0xac/0x2b0 fs/pipe.c:632\n vfs_ioctl fs/ioctl.c:51 [inline]\n __do_sys_ioctl fs/ioctl.c:874 [inline]\n __se_sys_ioctl fs/ioctl.c:860 [inline]\n __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:860\n do_syscall_x64 arch/x86/entry/common.c:50 [inline]\n do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80\n entry_SYSCALL_64_after_hwframe+0x44/0xae","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: watch_queue: Se corrige la desreferencia NULL en la limpieza de errores En watch_queue_set_size(), el código de limpieza de errores no tiene en cuenta el hecho de que __free_page() no puede manejar un puntero NULL al intentar liberar páginas de búfer que sí se asignaron. Solucione esto llamando a __free_page() solo en las páginas realmente asignadas. Sin la corrección, esto puede llevar a algo como lo siguiente: ERROR: KASAN: null-ptr-deref en __free_pages+0x1f/0x1b0 mm/page_alloc.c:5473 Lectura de tamaño 4 en la dirección 0000000000000034 por la tarea syz-executor168/3599 ... Seguimiento de llamadas:  __dump_stack lib/dump_stack.c:88 [en línea] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 __kasan_report mm/kasan/report.c:446 [en línea] kasan_report.cold+0x66/0xdf mm/kasan/report.c:459 check_region_inline mm/kasan/generic.c:183 [en línea] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 instrument_atomic_read include/linux/instrumented.h:71 [en línea] atomic_read include/linux/atomic/atomic-instrumented.h:27 [en línea] page_ref_count include/linux/page_ref.h:67 [en línea] put_page_testzero include/linux/mm.h:717 [en línea] __free_pages+0x1f/0x1b0 mm/page_alloc.c:5473 watch_queue_set_size+0x499/0x630 kernel/watch_queue.c:275 pipe_ioctl+0xac/0x2b0 fs/pipe.c:632 vfs_ioctl fs/ioctl.c:51 [en línea] __do_sys_ioctl fs/ioctl.c:874 [en línea] __se_sys_ioctl fs/ioctl.c:860 [en línea] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [en línea] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae","source":"nvd"}],"published":"2025-02-26T01:56:11.072Z","modified":"2026-11-05T20:17:02.750Z","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-476"],"affected":[{"ranges":[{"type":"git","introduced":"c73be61cede5882f9605a852414db559c0ebedfd","fixed":"5ae75b4ed30322b42abaa75ef1b784addfdb7dc9","status":"affected"},{"type":"git","introduced":"c73be61cede5882f9605a852414db559c0ebedfd","fixed":"695c47cea02b9101e2fc2e7d36d552128592b347","status":"affected"},{"type":"git","introduced":"c73be61cede5882f9605a852414db559c0ebedfd","fixed":"112a2f9b0a8457794095a0450598f150724ec456","status":"affected"},{"type":"git","introduced":"c73be61cede5882f9605a852414db559c0ebedfd","fixed":"b6f5ad3e45d19f9c4ee3e8a2aff829f28d68591d","status":"affected"},{"type":"git","introduced":"c73be61cede5882f9605a852414db559c0ebedfd","fixed":"a635415a064e77bcfbf43da413fd9dfe0bbed9cb","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.8","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.8","status":"unaffected"},{"type":"semver","introduced":"5.10.110","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.33","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"5.16.19","lastAffected":"5.16.*","status":"unaffected"},{"type":"semver","introduced":"5.17.2","lastAffected":"5.17.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"5.18","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":"5.8","fixed":"5.10.110"},{"status":"affected","introduced":"5.11","fixed":"5.15.33"},{"status":"affected","introduced":"5.16","fixed":"5.16.19"},{"status":"affected","introduced":"5.17","fixed":"5.17.2"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/5ae75b4ed30322b42abaa75ef1b784addfdb7dc9","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/695c47cea02b9101e2fc2e7d36d552128592b347","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/112a2f9b0a8457794095a0450598f150724ec456","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/b6f5ad3e45d19f9c4ee3e8a2aff829f28d68591d","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/a635415a064e77bcfbf43da413fd9dfe0bbed9cb","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-11-05T19:44:49.727Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-49257","url":"https://www.cve.org/CVERecord?id=CVE-2022-49257","licence":"CVE Terms of Use","modified":"2026-11-05T19:49:37.858Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-49257","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-49257","licence":"Public domain","modified":"2026-11-05T20:17:02.750Z"}],"updatedAt":"2026-11-25T22:58:20.332Z","epss":{"score":0.00262,"percentile":0.19259,"date":"2026-12-01T12:00:22.000Z"}}