Skip to content

ipv4: fix null-deref in ipv4_link_failure

Felix Maurer requested to merge fmaurer-rh/centos-stream-9:RHEL-5426 into main

JIRA: https://issues.redhat.com/browse/RHEL-5426
CVE: CVE-2023-42754

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.  

Signed-off-by: Felix Maurer fmaurer@redhat.com

Edited by Felix Maurer

Merge request reports