possible use of freed skbuff in netfilter.c
Subsystems (2)
RFC PATCH 1/1 possible use of freed skbuff in netfilter.c
Hello Dave,
When dev_put'ing bridge devices in netfilter.c::reinject the skb can already be freed. The patch below fixes this by delaying the freeing of the skb a bit. AFAIK, calling kfree_skb outside the read_lock causes no problems. Could someone of the netfilter core team approve or disapprove this change? This is bug 86 of the netfilter bugtracking system.
cheers,
Bart
net/core/netfilter.c renamed from net/core/netfilter.c.old +4 -4
@@ -559,10 +559,6 @@nf_queue (skb, elem, info->pf, info->hook, info->indev, info->outdev, info->okfn);break ; - -case NF_DROP : -kfree_skb (skb); -break ; }br_read_unlock_bh (BR_NETPROTO_LOCK );
@@ -578,6 +574,10 @@ }#endif + +if (verdict ==NF_DROP ) +kfree_skb (skb); +kfree (info);return ; }
Quoted 7 lines · Bart De Schuymer
Hello Dave,
When dev_put'ing bridge devices in
netfilter.c::reinjectthe skb can already be freed. The patch below fixes this by delaying the freeing of the skb a bit. AFAIK, callingkfree_skboutside theread_lockcauses no problems. Could someone of the netfilter core team approve or disapprove this change? This is bug 86 of the netfilter bugtracking system.
I'm fine with this fix, please apply (if it isn't already).
Quoted 2 lines
cheers,
Bart
Signature · 5 lines
- Harald Welte <[email protected]> http://www.netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie
From: Harald Welte <[email protected]>
Date: Tue, 29 Apr 2003 16:51:29 +0200
I'm fine with this fix, please apply (if it isn't already).
Applied. Should we be putting this fix into 2.4.x as well?
Quoted 3 lines · David S. Miller
I'm fine with this fix, please apply (if it isn't already).
Applied. Should we be putting this fix into 2.4.x as well?
No, this is only related to 2.5.
Signature · 2 lines
cheers, Bart
Quoted 6 lines · David S. Miller
From: Harald Welte <[email protected]>
Date: Tue, 29 Apr 2003 16:51:29 +0200I'm fine with this fix, please apply (if it isn't already).
Applied. Should we be putting this fix into 2.4.x as well?
Since 2.4.x doesn't have the physindev/physoutdev, the bug is not present in 2.4.x - and thus no fix needed.
Signature · 5 lines
- Harald Welte <[email protected]> http://www.netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie