mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ted Kremenek <kremenek@cs.stanford.edu>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [CHECKER] 12 potential leaks in kernel 2.5.69
Date: Fri, 23 May 2003 01:11:24 -0700	[thread overview]
Message-ID: <BAF325BC.8EEC%kremenek@cs.stanford.edu> (raw)
In-Reply-To: <20030522173453.GA9303@bougret.hpl.hp.com>

Thanks everyone for looking at these errors.

Regards,

Ted

> From: Jean Tourrilhes <jt@bougret.hpl.hp.com>
> Reply-To: jt@hpl.hp.com
> Date: Thu, 22 May 2003 10:34:53 -0700
> To: Linux kernel mailing list <linux-kernel@vger.kernel.org>, Ted Kremenek
> <kremenek@cs.stanford.edu>
> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
> Subject: Re: [CHECKER] 12 potential leaks in kernel 2.5.69
> 
> Ted Kremenek wrote :
>> 
>> linux-2.5.69/net/irda/af_irda.c (lines 868-911)
>> [BUG/LEAK, kfree_skb not called on error path]
> 
> Fixed in the mega "memory-leak" patch that I sent to Jeff a
> few days ago :
> http://marc.theaimsgroup.com/?l=linux-kernel&m=105286497718003&w=2
> 
>> linux-2.5.69/drivers/net/wireless/wavelan.c (lines 3012-3041)
>> [BUG/LEAK: skb_padto may return new address.  Note certain what
>>            the exact semantics are, but skb_padto returns possibly
>>            a new skb.  It also may free the skb pointer passed to
>>            it, meaning the calling function may have a dangling reference.]
>> 
>>     printk(KERN_DEBUG "%s: ->wavelan_packet_xmit(0x%X)\n", dev->name,
>>            (unsigned) skb);
>> #endif
>> 
>>     if (skb->len < ETH_ZLEN) {
>> Start --->
>>         skb = skb_padto(skb, ETH_ZLEN);
>> 
>>     ... DELETED 23 lines ...
>> 
>>         printk(KERN_INFO "skb has next\n");
>> #endif
>> 
>>     /* Write packet on the card */
>>     if(wv_packet_write(dev, skb->data, skb->len))
>> Error --->
>>         return 1;    /* We failed */
>> 
>>     dev_kfree_skb(skb);
> 
> This is very yucky. The memory leak is easy to fix, but the
> dandling reference is *very* serious. And I don't see how to fix that
> without either changing the behaviour of skb_padto or the semantic of
> the xmit API.
> Alan, would you mind thinking 2sec about this one ?
> Thanks...
> 
> Jean
> 


  reply	other threads:[~2003-05-23  7:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-22 17:34 Jean Tourrilhes
2003-05-23  8:11 ` Ted Kremenek [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-05-22  6:04 Ted Kremenek
2003-05-22  7:46 ` David S. Miller
2003-05-22 10:03 ` Jörn Engel
2003-05-22  9:50   ` Alan Cox
2003-05-26  9:42   ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BAF325BC.8EEC%kremenek@cs.stanford.edu \
    --to=kremenek@cs.stanford.edu \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®