mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Vegard Nossum" <vegard.nossum@gmail.com>
To: "Evgeniy Polyakov" <johnpol@2ka.mipt.ru>
Cc: netdev@vger.kernel.org, "Pekka Enberg" <penberg@cs.helsinki.fi>,
	"Ingo Molnar" <mingo@elte.hu>,
	linux-kernel@vger.kernel.org
Subject: Re: kmemcheck detected possible information leak to userspace?
Date: Tue, 1 Jul 2008 12:52:53 +0200	[thread overview]
Message-ID: <19f34abd0807010352t264fda16g826912a857e88140@mail.gmail.com> (raw)
In-Reply-To: <20080701102459.GB30248@2ka.mipt.ru>

On Tue, Jul 1, 2008 at 12:25 PM, Evgeniy Polyakov <johnpol@2ka.mipt.ru> wrote:
>> $ addr2line -e vmlinux -i c05325c7 # packet_recvmsg
>> net/packet/af_packet.c:1093
>
> This gives:
>        copied = skb->len;
>        if (copied > len)
>        {
>                copied=len;
>                msg->msg_flags|=MSG_TRUNC;
>        }
>
>        err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
>
> So everything looks ok, but driver could setup skb->len and/or
> skb->data_len to be slightly more than it placed data. Does
> above 'uuuu' bytes are at the end of the skb->data?

In fact I didn't give you the first such message. The first one looks like this:

kmemcheck: Caught 32-bit read from uninitialized memory (c72da052)
uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
                  ^

(with a similar stacktrace).

The u means uninitialized. So it seems not to be just the end. But I
am not sure where the end of the buffer is anyway.

But there is one thing I forgot: Is this memory initialized by DMA? If
so, the warning is bogus and I will go hide in shame.


Vegard

-- 
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
	-- E. W. Dijkstra, EWD1036

  reply	other threads:[~2008-07-01 10:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-01  9:16 Vegard Nossum
2008-07-01 10:25 ` Evgeniy Polyakov
2008-07-01 10:52   ` Vegard Nossum [this message]
2008-07-01 11:21     ` Evgeniy Polyakov
2008-07-01 11:47     ` Andi Kleen
2008-07-01 12:08       ` Pekka Enberg
2008-07-01 12:17       ` Vegard Nossum

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=19f34abd0807010352t264fda16g826912a857e88140@mail.gmail.com \
    --to=vegard.nossum@gmail.com \
    --cc=johnpol@2ka.mipt.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=netdev@vger.kernel.org \
    --cc=penberg@cs.helsinki.fi \
    /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®