]> git.dujemihanovic.xyz Git - linux.git/commit
net: hsr: prevent NULL pointer dereference in hsr_proxy_announce()
authorJeongjun Park <aha310510@gmail.com>
Sat, 7 Sep 2024 19:03:41 +0000 (04:03 +0900)
committerJakub Kicinski <kuba@kernel.org>
Wed, 11 Sep 2024 22:49:41 +0000 (15:49 -0700)
commita7789fd4caaf96ecfed5e28c4cddb927e6bebadb
tree5be1864be560a1a118cff4dcb093f726ad99df98
parent62540317771138c34dc87448366741bd7658681f
net: hsr: prevent NULL pointer dereference in hsr_proxy_announce()

In the function hsr_proxy_annouance() added in the previous commit
5f703ce5c981 ("net: hsr: Send supervisory frames to HSR network
with ProxyNodeTable data"), the return value of the hsr_port_get_hsr()
function is not checked to be a NULL pointer, which causes a NULL
pointer dereference.

To solve this, we need to add code to check whether the return value
of hsr_port_get_hsr() is NULL.

Reported-by: syzbot+02a42d9b1bd395cbcab4@syzkaller.appspotmail.com
Fixes: 5f703ce5c981 ("net: hsr: Send supervisory frames to HSR network with ProxyNodeTable data")
Signed-off-by: Jeongjun Park <aha310510@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Acked-by: Lukasz Majewski <lukma@denx.de>
Link: https://patch.msgid.link/20240907190341.162289-1-aha310510@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/hsr/hsr_device.c