Skip to content

Commit 7400bb4

Browse files
Tejaswi Tanikellaummakynes
authored andcommitted
netfilter: nf_reject_ipv4: Fix use-after-free in send_reset
niph is not updated after pskb_expand_head changes the skb head. It still points to the freed data, which is then used to update tot_len and checksum. This could cause use-after-free poison crash. Update niph, if ip_route_me_harder does not fail. This only affects the interaction with REJECT targets and br_netfilter. Signed-off-by: Tejaswi Tanikella <tejaswit@codeaurora.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent 0414c78 commit 7400bb4

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

net/ipv4/netfilter/nf_reject_ipv4.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ void nf_send_reset(struct net *net, struct sk_buff *oldskb, int hook)
132132
if (ip_route_me_harder(net, nskb, RTN_UNSPEC))
133133
goto free_nskb;
134134

135+
niph = ip_hdr(nskb);
136+
135137
/* "Never happens" */
136138
if (nskb->len > dst_mtu(skb_dst(nskb)))
137139
goto free_nskb;

0 commit comments

Comments
 (0)