Netdev List
 help / color / mirror / Atom feed
From: David Laight <david.laight.linux@gmail.com>
To: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
	jiri@resnulli.us, victor@mojatatu.com, yimingqian591@gmail.com,
	keenanat2000@gmail.com, 2045gemini@gmail.com,
	rollkingzzc@gmail.com, toke@redhat.com, dcaratti@redhat.com,
	security@kernel.org, linux-kernel@vger.kernel.org,
	stable@kernel.org, Rajat Gupta <rajat.gupta@oss.qualcomm.com>
Subject: Re: [PATCH net v5 1/1] net/sched: fix pedit partial COW leading to page cache corruption
Date: Sun, 31 May 2026 19:52:18 +0100	[thread overview]
Message-ID: <20260531195218.5fe29990@pumpkin> (raw)
In-Reply-To: <20260531194241.7d5d7e6e@pumpkin>

On Sun, 31 May 2026 19:42:41 +0100
David Laight <david.laight.linux@gmail.com> wrote:

> On Sun, 31 May 2026 13:25:36 -0400
> Jamal Hadi Salim <jhs@mojatatu.com> wrote:
....
> > >    
> > > > +                             goto bad;
> > > > +                     if (skb_ensure_writable(skb, min_t(int, skb->len,
> > > > +                                                        write_len)))    
> 
> You've completely missed that the above has to include the write_offset.

And I've missed that write_len isn't the length you are going to write :-(

This version is unreadable....

A few one line comments can make all the difference.
I put these two in for a reason.
It took some effort to find out exactly what they did.

> >         /* Ensure any needed headroom is writeable */
> >         if (hoffset < 0 && skb_cow(skb, -hoffset)
> >                 goto bad;
> >         /* Ensure the skb is writeable to the end of the area to be written.
> >          * The data is pulled into the skb header. */

-- David

      reply	other threads:[~2026-05-31 18:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-31 12:32 [PATCH net v5 1/1] net/sched: fix pedit partial COW leading to page cache corruption Jamal Hadi Salim
2026-05-31 16:15 ` David Laight
2026-05-31 17:25   ` Jamal Hadi Salim
2026-05-31 17:28     ` Jamal Hadi Salim
2026-05-31 18:42     ` David Laight
2026-05-31 18:52       ` David Laight [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=20260531195218.5fe29990@pumpkin \
    --to=david.laight.linux@gmail.com \
    --cc=2045gemini@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dcaratti@redhat.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=keenanat2000@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rajat.gupta@oss.qualcomm.com \
    --cc=rollkingzzc@gmail.com \
    --cc=security@kernel.org \
    --cc=stable@kernel.org \
    --cc=toke@redhat.com \
    --cc=victor@mojatatu.com \
    --cc=yimingqian591@gmail.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