From: Martijn van Oosterhout <kleptog@svana.org>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: davem@davemloft.net, jchapman@katalix.com, netdev@oss.sgi.com
Subject: Re: PPP-over-L2TP kernel support, patch for review
Date: Wed, 8 Sep 2004 18:38:28 +1000 [thread overview]
Message-ID: <20040908083828.GE18285@svana.org> (raw)
In-Reply-To: <E1C4xe9-0005xL-00@gondolin.me.apana.org.au>
[-- Attachment #1: Type: text/plain, Size: 2293 bytes --]
On Wed, Sep 08, 2004 at 06:17:41PM +1000, Herbert Xu wrote:
> Martijn van Oosterhout <kleptog@svana.org> wrote:
> > So the answer is: I think so. However, I'm not sure why this is an
> > issue. struct sockaddr is passed back and forth between userspace and
> > kernelspace has many varying sizes (sockaddr_un is quite large). What
> > could be affected? getsockname, connect and bind all take a length
> > argument. Or are you referring to the possibility of it affecting other
> > structures it's embedded in?
>
> Any existing user-space binary that has struct sockaddr_pppox in it will
> be broken by your change.
>
> Perhaps you can create a new sockaddr type?
But within a single binary, it knows how big the structure was at the
time it was compiled and has allocated the appropriate space. It also
was compiled with a particular version of PX_MAX_PROTO so it should
know if it's an unknown type. Any communication with the kernel
includes the size so there is no possibility of buffer overruns AFAICS.
The change is backward compatable in the sense that the sa_protocol
field determines which union member is appropriate and hence the
expected size of the structure.
However, it's possible I've not thought of a failure case. Maybe some
parts of kernel or userspace ignore the length or sa_protocol argument.
It's possible to create a new sockaddr type. I didn't do that as I
thought the point was to have all PPPoX sockets to use the same type.
You could create a socket type sockaddr_pppox2 which is bigger than the
current sockaddr_pppox but otherwise identical. Change the kernel to
use this new structure (no actual code changes needed, just argument
types). Worst case we get a new structure for each new type of PPPoX
socket. The AF_PPPOX will be the same for all of them.
Transistion userspace to use the new pppox2 structure for everything
and you're done. Again, no code changes required, only the type is
changed.
I can create a patch if you want...
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
next prev parent reply other threads:[~2004-09-08 8:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-06 11:59 PPP-over-L2TP kernel support, patch for review James Chapman
2004-09-07 22:56 ` David S. Miller
2004-09-08 7:32 ` Martijn van Oosterhout
2004-09-08 8:17 ` Herbert Xu
2004-09-08 8:38 ` Martijn van Oosterhout [this message]
2004-09-08 8:46 ` Herbert Xu
2004-09-08 9:04 ` Martijn van Oosterhout
2004-09-08 10:04 ` Herbert Xu
-- strict thread matches above, loose matches on Subject: below --
2004-09-06 11:55 James Chapman
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=20040908083828.GE18285@svana.org \
--to=kleptog@svana.org \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=jchapman@katalix.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).