Re: [PATCH net-next] net: phylink: fix NULL pl->pcs dereference during phylink_pcs_poll_start
From: Gerhard Engleder <hidden>
Date: 2022-06-29 20:14:43
From: Gerhard Engleder <hidden>
Date: 2022-06-29 20:14:43
On 29.06.22 21:42, Russell King (Oracle) wrote:
On Wed, Jun 29, 2022 at 10:33:58PM +0300, Vladimir Oltean wrote:quoted
The current link mode of the phylink instance may not require an attached PCS. However, phylink_major_config() unconditionally dereferences this potentially NULL pointer when restarting the link poll timer, which will panic the kernel. Fix the problem by checking whether a PCS exists in phylink_pcs_poll_start(), otherwise do nothing. The code prior to the blamed patch also only looked at pcs->poll within an "if (pcs)" block. Fixes: bfac8c490d60 ("net: phylink: disable PCS polling over major configuration") Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>Thanks. Reviewed-by: Russell King (Oracle) <redacted>
Fixes the problem on my side. Tested-by: Gerhard Engleder <redacted>