Skip to contentSkip to conversation

nfnetlink_log: fix possible use-after-free

PATCH Applied Michał Mirosław 2 participants 2 messages Feb 12, 2007 – Feb 13, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/10 nfnetlink_log: fix possible use-after-free

Paranoia: instance_put() might have freed the inst pointer when we spin_unlock_bh().

net/netfilter/nfnetlink_log.c renamed from net/netfilter/nfnetlink_log.c.2 +1 -1
@@ -393,8 +393,8 @@ static void nfulnl_timer(unsigned long d
 
 	spin_lock_bh(&inst->lock);
 	__nfulnl_send(inst);
-	instance_put(inst);
 	spin_unlock_bh(&inst->lock);
+	instance_put(inst);
 }
 
 /* This is an inline function, we don't really care about a long
#1 lore raw
Quoted 2 lines · Micha³ Miros³aw

Paranoia: instance_put() might have freed the inst pointer when we spin_unlock_bh().

Applied, I'll forward this one to -stable as well.