diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2021-03-22 02:26:37 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-03-22 12:57:51 -0700 |
commit | a50a151e311bd3a793ebe4e5f233db8bfad0b78f (patch) | |
tree | d81a9fcf75885e0ff423382d1c03be500fe38a8c /drivers/isdn | |
parent | 6debc0fd71b947b03c1a39cc100f52b8238259d4 (diff) |
net: ipconfig: ic_dev can be NULL in ic_close_devs
ic_close_dev contains a generalization of the logic to not close a
network interface if it's the host port for a DSA switch. This logic is
disguised behind an iteration through the lowers of ic_dev in
ic_close_dev.
When no interface for ipconfig can be found, ic_dev is NULL, and
ic_close_dev:
- dereferences a NULL pointer when assigning selected_dev
- would attempt to search through the lower interfaces of a NULL
net_device pointer
So we should protect against that case.
The "lower_dev" iterator variable was shortened to "lower" in order to
keep the 80 character limit.
Fixes: f68cbaed67cb ("net: ipconfig: avoid use-after-free in ic_close_devs")
Fixes: 46acf7bdbc72 ("Revert "net: ipv4: handle DSA enabled master network devices"")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Heiko Thiery <heiko.thiery@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn')
0 files changed, 0 insertions, 0 deletions