]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: phy: micrel: Fix potential null pointer dereference
authorAleksandr Mishin <amishin@t-argos.ru>
Fri, 29 Mar 2024 06:16:31 +0000 (09:16 +0300)
committerJakub Kicinski <kuba@kernel.org>
Tue, 2 Apr 2024 03:41:49 +0000 (20:41 -0700)
commit96c155943a703f0655c0c4cab540f67055960e91
tree8bbe6115f428da9d5fb13c2ddc21a9465bc5a378
parent365af7ace014ef3fc6f5d0a373c96cc7193db4ce
net: phy: micrel: Fix potential null pointer dereference

In lan8814_get_sig_rx() and lan8814_get_sig_tx() ptp_parse_header() may
return NULL as ptp_header due to abnormal packet type or corrupted packet.
Fix this bug by adding ptp_header check.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: ece19502834d ("net: phy: micrel: 1588 support for LAN8814 phy")
Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20240329061631.33199-1-amishin@t-argos.ru
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/micrel.c