netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@redhat.com>
To: jt@hpl.hp.com
Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com
Subject: Possible IRDA SKB leaks
Date: Mon, 24 Nov 2003 19:30:42 -0800	[thread overview]
Message-ID: <20031124193042.2c1013a2.davem@redhat.com> (raw)


Hello Jean, I think I've found some SKB handling bugs in
the IRDA stack.

I was verifying all the paths that use sock_queue_rcv_skb().
If any non-zero value is returned from this function the caller
must either free the SKB or queue the packet some place else.

Here is one example where IRDA appears to do the wrong thing.
In irttp_udata_indication(), we pass the packet down into the
next layer via self->notify.udata_indication().

One example implementation of this is af_irda.c:irda_data_indication().
This calls sock_queue_rcv_skb() and returns any error to the caller.

Our caller in this case, irttp_udata_indication(), for some reason
treats -ENOMEM specially.  This is wrong, there are many other errors
that sock_queue_rcv_skb() can return, for example -EPERM from socket
filtering.  All such error cases need to cause the SKB to be freed
or similar, it should not be done only for an error of -ENOMEM.

I have not done an exhaustive audit of this problem in the IRDA stack.
But I do suspect there are other places doing something similar.

If someone could finish the audit and submit a patch to fix this I'd
really appreciate it.  Thanks a lot.

             reply	other threads:[~2003-11-25  3:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-25  3:30 David S. Miller [this message]
2003-11-25  3:36 ` Possible IRDA SKB leaks Jean Tourrilhes
2003-11-26  2:33 ` Jean Tourrilhes
2003-11-26  2:56   ` David S. Miller

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=20031124193042.2c1013a2.davem@redhat.com \
    --to=davem@redhat.com \
    --cc=irda-users@lists.sourceforge.net \
    --cc=jt@hpl.hp.com \
    --cc=netdev@oss.sgi.com \
    /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;
as well as URLs for NNTP newsgroup(s).