mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ISDN: fix double free bug in isdn_net
@ 2006-08-12 20:48 Jesper Juhl
  2006-08-15  9:00 ` David Miller
  0 siblings, 1 reply; 10+ messages in thread
From: Jesper Juhl @ 2006-08-12 20:48 UTC (permalink / raw)
  To: linux-kernel; +Cc: Karsten Keil, Kai Germaschewski, isdn4linux, Jesper Juhl

There's double-free bug in 
drivers/isdn/i4l/isdn_net.c::isdn_net_writebuf_skb().

If isdn_writebuf_skb_stub() doesn't handle the entire skb, then it will 
have freed the skb that was passed to it and when the code then jumps 
to the error label it'll result in a double free of the skb.

The easy way to fix this is to insert an assignment of skb = NULL in the
'if' following the call to isdn_writebuf_skb_stub() so that when the code
at the error label calls dev_kfree_skb(skb); the skb will be NULL and 
nothing will happen since dev_kfree_skb() just does a return if passed a
NULL.


Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---

 drivers/isdn/i4l/isdn_net.c |    1 +
 1 files changed, 1 insertion(+)

--- linux-2.6.18-rc4-orig/drivers/isdn/i4l/isdn_net.c	2006-08-11 00:10:55.000000000 +0200
+++ linux-2.6.18-rc4/drivers/isdn/i4l/isdn_net.c	2006-08-12 22:39:56.000000000 +0200
@@ -1023,6 +1023,7 @@ void isdn_net_writebuf_skb(isdn_net_loca
 	if (ret != len) {
 		/* we should never get here */
 		printk(KERN_WARNING "%s: HL driver queue full\n", lp->name);
+		skb = NULL;
 		goto error;
 	}
 	



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-08-16 20:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-12 20:48 [PATCH] ISDN: fix double free bug in isdn_net Jesper Juhl
2006-08-15  9:00 ` David Miller
2006-08-15  9:08   ` Jesper Juhl
2006-08-15  9:15     ` David Miller
2006-08-15 10:42       ` Jesper Juhl
2006-08-15 16:06       ` Karsten Keil
2006-08-16 20:22         ` Jesper Juhl
2006-08-16 20:39           ` Karsten Keil
2006-08-16 20:44             ` David Miller
2006-08-16 20:48             ` Jesper Juhl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®