{"id":"CVE-2023-53234","summary":"watchdog: Fix kmemleak in watchdog_cdev_register","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nwatchdog: Fix kmemleak in watchdog_cdev_register\n\nkmemleak reports memory leaks in watchdog_dev_register, as follows:\nunreferenced object 0xffff888116233000 (size 2048):\n  comm \"\"modprobe\"\", pid 28147, jiffies 4353426116 (age 61.741s)\n  hex dump (first 32 bytes):\n    80 fa b9 05 81 88 ff ff 08 30 23 16 81 88 ff ff  .........0#.....\n    08 30 23 16 81 88 ff ff 00 00 00 00 00 00 00 00  .0#.............\n  backtrace:\n    [\u003c000000007f001ffd\u003e] __kmem_cache_alloc_node+0x157/0x220\n    [\u003c000000006a389304\u003e] kmalloc_trace+0x21/0x110\n    [\u003c000000008d640eea\u003e] watchdog_dev_register+0x4e/0x780 [watchdog]\n    [\u003c0000000053c9f248\u003e] __watchdog_register_device+0x4f0/0x680 [watchdog]\n    [\u003c00000000b2979824\u003e] watchdog_register_device+0xd2/0x110 [watchdog]\n    [\u003c000000001f730178\u003e] 0xffffffffc10880ae\n    [\u003c000000007a1a8bcc\u003e] do_one_initcall+0xcb/0x4d0\n    [\u003c00000000b98be325\u003e] do_init_module+0x1ca/0x5f0\n    [\u003c0000000046d08e7c\u003e] load_module+0x6133/0x70f0\n    ...\n\nunreferenced object 0xffff888105b9fa80 (size 16):\n  comm \"\"modprobe\"\", pid 28147, jiffies 4353426116 (age 61.741s)\n  hex dump (first 16 bytes):\n    77 61 74 63 68 64 6f 67 31 00 b9 05 81 88 ff ff  watchdog1.......\n  backtrace:\n    [\u003c000000007f001ffd\u003e] __kmem_cache_alloc_node+0x157/0x220\n    [\u003c00000000486ab89b\u003e] __kmalloc_node_track_caller+0x44/0x1b0\n    [\u003c000000005a39aab0\u003e] kvasprintf+0xb5/0x140\n    [\u003c0000000024806f85\u003e] kvasprintf_const+0x55/0x180\n    [\u003c000000009276cb7f\u003e] kobject_set_name_vargs+0x56/0x150\n    [\u003c00000000a92e820b\u003e] dev_set_name+0xab/0xe0\n    [\u003c00000000cec812c6\u003e] watchdog_dev_register+0x285/0x780 [watchdog]\n    [\u003c0000000053c9f248\u003e] __watchdog_register_device+0x4f0/0x680 [watchdog]\n    [\u003c00000000b2979824\u003e] watchdog_register_device+0xd2/0x110 [watchdog]\n    [\u003c000000001f730178\u003e] 0xffffffffc10880ae\n    [\u003c000000007a1a8bcc\u003e] do_one_initcall+0xcb/0x4d0\n    [\u003c00000000b98be325\u003e] do_init_module+0x1ca/0x5f0\n    [\u003c0000000046d08e7c\u003e] load_module+0x6133/0x70f0\n    ...\n\nThe reason is that put_device is not be called if cdev_device_add fails\nand wdd-\u003eid != 0.\n\nwatchdog_cdev_register\n  wd_data = kzalloc                             [1]\n  err = dev_set_name                            [2]\n  ..\n  err = cdev_device_add\n  if (err) {\n    if (wdd-\u003eid == 0) {  // wdd-\u003eid != 0\n      ..\n    }\n    return err;  // [1],[2] would be leaked\n\nTo fix it, call put_device in all wdd-\u003eid cases.","modified":"2026-05-15T11:54:47.910378617Z","published":"2025-09-15T14:22:07.219Z","related":["SUSE-SU-2025:03615-1","SUSE-SU-2025:03628-1","SUSE-SU-2025:3716-1","SUSE-SU-2025:3761-1"],"database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/53xxx/CVE-2023-53234.json","cna_assigner":"Linux"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/13721a2ac66b246f5802ba1b75ad8637e53eeecc"},{"type":"WEB","url":"https://git.kernel.org/stable/c/23cc41c3f19c4d858c3708f1c0a06e94958e6c3b"},{"type":"WEB","url":"https://git.kernel.org/stable/c/50808d034e199fe3ff7a9d2068a4eebeb6b4098a"},{"type":"WEB","url":"https://git.kernel.org/stable/c/59e391b3fc507a15b7e8e9d9f4de87cae177c366"},{"type":"WEB","url":"https://git.kernel.org/stable/c/8c1655600f4f2839fb844fe8c70b2b65fadc7a56"},{"type":"WEB","url":"https://git.kernel.org/stable/c/ac099d94e0480c937aa9172ab64074981ca1a4d3"},{"type":"WEB","url":"https://git.kernel.org/stable/c/bf26b0e430ce34261f45959989edaf680b64d538"},{"type":"WEB","url":"https://git.kernel.org/stable/c/c5a21a5501508ae3afa2fe6d5a3e74a37fa48df3"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/53xxx/CVE-2023-53234.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-53234"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.14.308"}]},{"type":"ECOSYSTEM","events":[{"introduced":"4.15.0"},{"fixed":"4.19.276"}]},{"type":"ECOSYSTEM","events":[{"introduced":"4.20.0"},{"fixed":"5.4.235"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.5.0"},{"fixed":"5.10.173"},{"fixed":"5.15.100"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.11.0"},{"fixed":"6.1.18"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.16.0"},{"fixed":"6.2.5"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2023-53234.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"}]}