In the Linux kernel, the following vulnerability has been resolved:
watchdog: Fix kmemleak in watchdogcdevregister
kmemleak reports memory leaks in watchdogdevregister, as follows: unreferenced object 0xffff888116233000 (size 2048): comm ""modprobe"", pid 28147, jiffies 4353426116 (age 61.741s) hex dump (first 32 bytes): 80 fa b9 05 81 88 ff ff 08 30 23 16 81 88 ff ff .........0#..... 08 30 23 16 81 88 ff ff 00 00 00 00 00 00 00 00 .0#............. backtrace: [<000000007f001ffd>] _kmemcacheallocnode+0x157/0x220 [<000000006a389304>] kmalloctrace+0x21/0x110 [<000000008d640eea>] watchdogdevregister+0x4e/0x780 [watchdog] [<0000000053c9f248>] _watchdogregisterdevice+0x4f0/0x680 [watchdog] [<00000000b2979824>] watchdogregisterdevice+0xd2/0x110 [watchdog] [<000000001f730178>] 0xffffffffc10880ae [<000000007a1a8bcc>] dooneinitcall+0xcb/0x4d0 [<00000000b98be325>] doinitmodule+0x1ca/0x5f0 [<0000000046d08e7c>] load_module+0x6133/0x70f0 ...
unreferenced object 0xffff888105b9fa80 (size 16): comm ""modprobe"", pid 28147, jiffies 4353426116 (age 61.741s) hex dump (first 16 bytes): 77 61 74 63 68 64 6f 67 31 00 b9 05 81 88 ff ff watchdog1....... backtrace: [<000000007f001ffd>] _kmemcacheallocnode+0x157/0x220 [<00000000486ab89b>] _kmallocnodetrackcaller+0x44/0x1b0 [<000000005a39aab0>] kvasprintf+0xb5/0x140 [<0000000024806f85>] kvasprintfconst+0x55/0x180 [<000000009276cb7f>] kobjectsetnamevargs+0x56/0x150 [<00000000a92e820b>] devsetname+0xab/0xe0 [<00000000cec812c6>] watchdogdevregister+0x285/0x780 [watchdog] [<0000000053c9f248>] _watchdogregisterdevice+0x4f0/0x680 [watchdog] [<00000000b2979824>] watchdogregisterdevice+0xd2/0x110 [watchdog] [<000000001f730178>] 0xffffffffc10880ae [<000000007a1a8bcc>] dooneinitcall+0xcb/0x4d0 [<00000000b98be325>] doinitmodule+0x1ca/0x5f0 [<0000000046d08e7c>] loadmodule+0x6133/0x70f0 ...
The reason is that putdevice is not be called if cdevdevice_add fails and wdd->id != 0.
watchdogcdevregister wddata = kzalloc [1] err = devsetname [2] .. err = cdevdevice_add if (err) { if (wdd->id == 0) { // wdd->id != 0 .. } return err; // [1],[2] would be leaked
To fix it, call put_device in all wdd->id cases.
[
{
"id": "CVE-2023-53234-29f818fe",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bf26b0e430ce34261f45959989edaf680b64d538",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/watchdog/watchdog_dev.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"203334233816328410031583138344763108940",
"78106306351430730249524450188502339548",
"209061981589835101449623552957237543128",
"35512475718556658807159095342520336405",
"322582273554571543766080922298640162515"
]
},
"signature_type": "Line"
},
{
"id": "CVE-2023-53234-66aa46db",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@50808d034e199fe3ff7a9d2068a4eebeb6b4098a",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/watchdog/watchdog_dev.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"203334233816328410031583138344763108940",
"78106306351430730249524450188502339548",
"209061981589835101449623552957237543128",
"35512475718556658807159095342520336405",
"322582273554571543766080922298640162515"
]
},
"signature_type": "Line"
},
{
"id": "CVE-2023-53234-6e669da6",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@23cc41c3f19c4d858c3708f1c0a06e94958e6c3b",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/watchdog/watchdog_dev.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"203334233816328410031583138344763108940",
"78106306351430730249524450188502339548",
"209061981589835101449623552957237543128",
"35512475718556658807159095342520336405",
"322582273554571543766080922298640162515"
]
},
"signature_type": "Line"
},
{
"id": "CVE-2023-53234-74d1e65e",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c5a21a5501508ae3afa2fe6d5a3e74a37fa48df3",
"deprecated": false,
"signature_version": "v1",
"target": {
"function": "watchdog_cdev_register",
"file": "drivers/watchdog/watchdog_dev.c"
},
"digest": {
"function_hash": "311632920651588615982285934565914700643",
"length": 2069.0
},
"signature_type": "Function"
},
{
"id": "CVE-2023-53234-83828f72",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ac099d94e0480c937aa9172ab64074981ca1a4d3",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/watchdog/watchdog_dev.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"203334233816328410031583138344763108940",
"78106306351430730249524450188502339548",
"209061981589835101449623552957237543128",
"35512475718556658807159095342520336405",
"322582273554571543766080922298640162515"
]
},
"signature_type": "Line"
},
{
"id": "CVE-2023-53234-93b86b7d",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c5a21a5501508ae3afa2fe6d5a3e74a37fa48df3",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/watchdog/watchdog_dev.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"203334233816328410031583138344763108940",
"78106306351430730249524450188502339548",
"209061981589835101449623552957237543128",
"35512475718556658807159095342520336405",
"322582273554571543766080922298640162515"
]
},
"signature_type": "Line"
},
{
"id": "CVE-2023-53234-95732df3",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@59e391b3fc507a15b7e8e9d9f4de87cae177c366",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/watchdog/watchdog_dev.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"203334233816328410031583138344763108940",
"78106306351430730249524450188502339548",
"209061981589835101449623552957237543128",
"35512475718556658807159095342520336405",
"322582273554571543766080922298640162515"
]
},
"signature_type": "Line"
},
{
"id": "CVE-2023-53234-9a8b0eab",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ac099d94e0480c937aa9172ab64074981ca1a4d3",
"deprecated": false,
"signature_version": "v1",
"target": {
"function": "watchdog_cdev_register",
"file": "drivers/watchdog/watchdog_dev.c"
},
"digest": {
"function_hash": "4755909046260068398127531540737039680",
"length": 2152.0
},
"signature_type": "Function"
},
{
"id": "CVE-2023-53234-aaae3c22",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@23cc41c3f19c4d858c3708f1c0a06e94958e6c3b",
"deprecated": false,
"signature_version": "v1",
"target": {
"function": "watchdog_cdev_register",
"file": "drivers/watchdog/watchdog_dev.c"
},
"digest": {
"function_hash": "286326261520979373607166176400436481167",
"length": 2090.0
},
"signature_type": "Function"
},
{
"id": "CVE-2023-53234-b1be629d",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@13721a2ac66b246f5802ba1b75ad8637e53eeecc",
"deprecated": false,
"signature_version": "v1",
"target": {
"function": "watchdog_cdev_register",
"file": "drivers/watchdog/watchdog_dev.c"
},
"digest": {
"function_hash": "4755909046260068398127531540737039680",
"length": 2152.0
},
"signature_type": "Function"
},
{
"id": "CVE-2023-53234-bd7a59f8",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bf26b0e430ce34261f45959989edaf680b64d538",
"deprecated": false,
"signature_version": "v1",
"target": {
"function": "watchdog_cdev_register",
"file": "drivers/watchdog/watchdog_dev.c"
},
"digest": {
"function_hash": "313314128669020853711463083838001539799",
"length": 1850.0
},
"signature_type": "Function"
},
{
"id": "CVE-2023-53234-c6b1917b",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8c1655600f4f2839fb844fe8c70b2b65fadc7a56",
"deprecated": false,
"signature_version": "v1",
"target": {
"function": "watchdog_cdev_register",
"file": "drivers/watchdog/watchdog_dev.c"
},
"digest": {
"function_hash": "188132590197316029884818833886751146077",
"length": 2040.0
},
"signature_type": "Function"
},
{
"id": "CVE-2023-53234-d27bb049",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@59e391b3fc507a15b7e8e9d9f4de87cae177c366",
"deprecated": false,
"signature_version": "v1",
"target": {
"function": "watchdog_cdev_register",
"file": "drivers/watchdog/watchdog_dev.c"
},
"digest": {
"function_hash": "311632920651588615982285934565914700643",
"length": 2069.0
},
"signature_type": "Function"
},
{
"id": "CVE-2023-53234-e01f0fad",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@50808d034e199fe3ff7a9d2068a4eebeb6b4098a",
"deprecated": false,
"signature_version": "v1",
"target": {
"function": "watchdog_cdev_register",
"file": "drivers/watchdog/watchdog_dev.c"
},
"digest": {
"function_hash": "4755909046260068398127531540737039680",
"length": 2152.0
},
"signature_type": "Function"
},
{
"id": "CVE-2023-53234-e44ef2f3",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@13721a2ac66b246f5802ba1b75ad8637e53eeecc",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/watchdog/watchdog_dev.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"203334233816328410031583138344763108940",
"78106306351430730249524450188502339548",
"209061981589835101449623552957237543128",
"35512475718556658807159095342520336405",
"322582273554571543766080922298640162515"
]
},
"signature_type": "Line"
},
{
"id": "CVE-2023-53234-fcce7601",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8c1655600f4f2839fb844fe8c70b2b65fadc7a56",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/watchdog/watchdog_dev.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"203334233816328410031583138344763108940",
"78106306351430730249524450188502339548",
"209061981589835101449623552957237543128",
"35512475718556658807159095342520336405",
"322582273554571543766080922298640162515"
]
},
"signature_type": "Line"
}
]