CVE-2022-49373: watchdog: ts4800_wdt: Fix refcount leak in ts4800_wdt_probe
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
watchdog: ts4800_wdt: Fix refcount leak in ts4800_wdt_probe
of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() in some error paths.
The Linux kernel CVE team has assigned CVE-2022-49373 to this issue.
Affected and fixed versions
===========================
Issue introduced in 4.5 with commit bf9006399939762e6cd32445e848e56727df9d98 and fixed in 5.4.198 with commit 5b110d940417942bc87d9e4bea6d4f24e05ed483 Issue introduced in 4.5 with commit bf9006399939762e6cd32445e848e56727df9d98 and fixed in 5.10.122 with commit 910b1cdf6c50ae8fb222e46657d04fb181577017 Issue introduced in 4.5 with commit bf9006399939762e6cd32445e848e56727df9d98 and fixed in 5.15.47 with commit 7a4afd8a003d6abf1f5d159c2bb67e6b7cbde253 Issue introduced in 4.5 with commit bf9006399939762e6cd32445e848e56727df9d98 and fixed in 5.17.15 with commit 91fa5aa53f68b85e779164b3127c7e23cad5c457 Issue introduced in 4.5 with commit bf9006399939762e6cd32445e848e56727df9d98 and fixed in 5.18.4 with commit f067b5286edfd83d2d3903e8578b561599d62539 Issue introduced in 4.5 with commit bf9006399939762e6cd32445e848e56727df9d98 and fixed in 5.19 with commit 5d24df3d690809952528e7a19a43d84bc5b99d44
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2022-49373
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/watchdog/ts4800_wdt.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/5b110d940417942bc87d9e4bea6d4f24e05ed483 https://git.kernel.org/stable/c/910b1cdf6c50ae8fb222e46657d04fb181577017 https://git.kernel.org/stable/c/7a4afd8a003d6abf1f5d159c2bb67e6b7cbde253 https://git.kernel.org/stable/c/91fa5aa53f68b85e779164b3127c7e23cad5c457 https://git.kernel.org/stable/c/f067b5286edfd83d2d3903e8578b561599d62539 https://git.kernel.org/stable/c/5d24df3d690809952528e7a19a43d84bc5b99d44