From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, kaber@trash.net
Subject: Re: [PATCH] af_packet: prevent information leak
Date: Tue, 07 Jun 2011 07:38:39 +0200 [thread overview]
Message-ID: <1307425119.2642.63.camel@edumazet-laptop> (raw)
In-Reply-To: <20110606.222416.1114593259198630297.davem@davemloft.net>
Le lundi 06 juin 2011 à 22:24 -0700, David Miller a écrit :
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Tue, 07 Jun 2011 07:02:19 +0200
>
> > In 2.6.27, commit 393e52e33c6c2 (packet: deliver VLAN TCI to userspace)
> > added a small information leak.
> >
> > Add padding field and make sure its zeroed before copy to user.
> >
> > Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> > CC: Patrick McHardy <kaber@trash.net>
>
> I fear this will change the size of these structures on some weird
> architecture. Doesn't ARM, for example, have weird rules
> wrt. alignment and structure sizing when "smaller than word" elements
> are involved?
>
> That's why we need __packed on:
>
> struct nd_opt_hdr {
> __u8 nd_opt_type;
> __u8 nd_opt_len;
> } __packed;
>
> for example.
>
> Probably safe to just do a memset of the tail, and the constant length
> will evaluate to zero on these weird platforms. On others, where the
> padding does matter, the memset will emit the same code as your new
> assignments do.
It should not matter for these structures, or 393e52e33c6c2 would have
break applications on all arches (not only ARM), since it enlarged them
without any warning ;)
next prev parent reply other threads:[~2011-06-07 5:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-07 5:02 [PATCH] af_packet: prevent information leak Eric Dumazet
2011-06-07 5:24 ` David Miller
2011-06-07 5:38 ` Eric Dumazet [this message]
2011-06-07 5:41 ` Eric Dumazet
2011-06-07 5:42 ` David 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=1307425119.2642.63.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=kaber@trash.net \
--cc=netdev@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