mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@ozlabs.org>
To: Yilin Zhang <yilinzhang@moonshot.ai>
Cc: linux-ppp@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Kimi Security Team <bug-report@moonshot.ai>,
	Weiming Shi <shiweiming@moonshot.ai>
Subject: Re: [PATCH net] ppp: deflate: validate output buffer sizes
Date: Mon, 7 Sep 2026 16:45:00 +1000	[thread overview]
Message-ID: <ap5dbA8dh0fT6bP-@bruin> (raw)
In-Reply-To: <20260907055809.3379942-1-yilinzhang@moonshot.ai>

On Mon, Sep 07, 2026 at 01:58:09PM +0800, Yilin Zhang wrote:
> z_compress() assumes that the output buffer can hold the six-byte
> PPP/Deflate header.  With an MTU of 1, pad_compress_skb() supplies an
> output size of 5.  The header write overruns the skb and subtracting the
> header length makes avail_out wrap, allowing zlib to continue writing
> past the allocation.

Why not rather enforce a reasonable minimum for the MTU?  I don't see
how an MTU of 1 is practically useful in any way.  A practical minimum
would be on the order or 100; when negotiating with the peer, pppd
naks anything less than 128 and proposes 128 instead.

Paul.

      reply	other threads:[~2026-09-07  6:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07  5:58 Yilin Zhang
2026-09-07  6:45 ` Paul Mackerras [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=ap5dbA8dh0fT6bP-@bruin \
    --to=paulus@ozlabs.org \
    --cc=bug-report@moonshot.ai \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-ppp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shiweiming@moonshot.ai \
    --cc=yilinzhang@moonshot.ai \
    /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®