Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ipv4: fix null-deref in ipv4_link_failure
Currently, we assume the skb is associated with a device before calling __ip_options_compile, which is not always the case if it is re-routed by ipvs. When skb->dev is NULL, dev_net(skb->dev) will become null-dereference. This patch adds a check for the edge case and switch to use the net_device from the rtable when skb->dev is NULL. Fixes: ed0de45 ("ipv4: recompile ip options in ipv4_link_failure") Suggested-by: David Ahern <[email protected]> Signed-off-by: Kyle Zeng <[email protected]> Cc: Stephen Suryaputra <[email protected]> Cc: Vadim Fedorenko <[email protected]> Reviewed-by: David Ahern <[email protected]> Signed-off-by: David S. Miller <[email protected]>
- Loading branch information