linux-ppp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guillaume Nault <gnault@redhat.com>
To: James Carlson <carlsonj@workingcode.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, netdev <netdev@vger.kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Paul Mackerras <paulus@samba.org>,
	linux-ppp@vger.kernel.org, syzbot <syzkaller@googlegroups.com>
Subject: Re: [PATCH net] ppp: ensure minimum packet size in ppp_write()
Date: Wed, 5 Jan 2022 17:29:54 +0100	[thread overview]
Message-ID: <20220105162954.GB17823@pc-1.home> (raw)
In-Reply-To: <dbde2a45-a7dd-0e8a-d04c-233f69631885@workingcode.com>

On Wed, Jan 05, 2022 at 10:30:09AM -0500, James Carlson wrote:
> On 1/5/22 08:19, Guillaume Nault wrote:
> > On Wed, Jan 05, 2022 at 03:48:42AM -0800, Eric Dumazet wrote:
> >> From: Eric Dumazet <edumazet@google.com>
> >>
> >> It seems pretty clear ppp layer assumed user space
> >> would always be kind to provide enough data
> >> in their write() to a ppp device.
> >>
> >> This patch makes sure user provides at least
> >> 2 bytes.
> >>
> >> It adds PPP_PROTO_LEN macro that could replace
> >> in net-next many occurrences of hard-coded 2 value.
> > 
> > The PPP header can be compressed to only 1 byte, but since 2 bytes is
> > assumed in several parts of the code, rejecting such packets in
> > ppp_xmit() is probably the best we can do.
> 
> The only ones that can be compressed are those less than 0x0100, which
> are (intentionally) all network layer protocols.  We should be getting
> only control protocol messages though the user-space interface, not
> network layer, so I'd say it's not just the best we can do, but indeed
> the right thing to do by design.

Well, I know of at least one implementation that used to transmit data
by writing on ppp unit file descriptors. That was a hack to work around
some other problems. Not a beautiful one, but it worked.


  reply	other threads:[~2022-01-05 16:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-05 11:48 [PATCH net] ppp: ensure minimum packet size in ppp_write() Eric Dumazet
2022-01-05 13:19 ` Guillaume Nault
2022-01-05 15:30   ` James Carlson
2022-01-05 16:29     ` Guillaume Nault [this message]
2022-01-05 16:35       ` James Carlson
2022-01-05 17:37         ` Guillaume Nault
2022-01-06 12:40 ` patchwork-bot+netdevbpf

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=20220105162954.GB17823@pc-1.home \
    --to=gnault@redhat.com \
    --cc=carlsonj@workingcode.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-ppp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=syzkaller@googlegroups.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).