netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: virtualphtn@gmail.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-2.6] tcp_probe buffer overflow and incorrect return value
Date: Thu, 24 Apr 2008 21:12:35 -0700 (PDT)	[thread overview]
Message-ID: <20080424.211235.08123917.davem@davemloft.net> (raw)
In-Reply-To: <4810FDB6.2060805@gmail.com>

From: Tom Quetchenbach <virtualphtn@gmail.com>
Date: Thu, 24 Apr 2008 14:37:58 -0700

> tcp_probe has a bounds-checking bug that causes many programs (less, python) to
> crash reading /proc/net/tcp_probe. When it outputs a log line to the reader, it
> only checks if that line alone will fit in the reader's buffer, rather than that
> line and all the previous lines it has already written.
> 
> tcpprobe_read also returns the wrong value if copy_to_user fails--it just passes
> on the return value of copy_to_user (number of bytes not copied), which makes a
> failure look like a success.
> 
> This patch fixes the buffer overflow and sets the return value to -EFAULT if
> copy_to_user fails.
> 
> Patch is against latest net-2.6; tested briefly and seems to fix the crashes in
> less and python.
> 
> Signed-off-by: Tom Quetchenbach <virtualphtn@gmail.com>

Thanks a lot for fixing this bug.

I've applied this patch and I'll queue it up for -stable too.

Thanks again.

      reply	other threads:[~2008-04-25  4:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-24 21:37 [PATCH net-2.6] tcp_probe buffer overflow and incorrect return value Tom Quetchenbach
2008-04-25  4:12 ` David Miller [this message]

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=20080424.211235.08123917.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=virtualphtn@gmail.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).