All of lore.kernel.org
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: David Howells <dhowells@redhat.com>,
	netdev@vger.kernel.org,
	syzbot+d8486855ef44506fd675@syzkaller.appspotmail.com,
	David Ahern <dsahern@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Jens Axboe <axboe@kernel.dk>,
	Matthew Wilcox <willy@infradead.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] ip, ip6: Fix splice to raw and ping sockets
Date: Fri, 16 Jun 2023 10:34:41 +0200	[thread overview]
Message-ID: <CAF=yD-LLCoSTH1Jb+EFmpmTVO+Oo7Hjg6xcF4T2wR96QkjHZRw@mail.gmail.com> (raw)
In-Reply-To: <20230615222327.15e85c55@kernel.org>

On Fri, Jun 16, 2023 at 7:23 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Wed, 14 Jun 2023 09:04:16 +0100 David Howells wrote:
> > Splicing to SOCK_RAW sockets may set MSG_SPLICE_PAGES, but in such a case,
> > __ip_append_data() will call skb_splice_from_iter() to access the 'from'
> > data, assuming it to point to a msghdr struct with an iter, instead of
> > using the provided getfrag function to access it.
> >
> > In the case of raw_sendmsg(), however, this is not the case and 'from' will
> > point to a raw_frag_vec struct and raw_getfrag() will be the frag-getting
> > function.  A similar issue may occur with rawv6_sendmsg().
> >
> > Fix this by ignoring MSG_SPLICE_PAGES if getfrag != ip_generic_getfrag as
> > ip_generic_getfrag() expects "from" to be a msghdr*, but the other getfrags
> > don't.  Note that this will prevent MSG_SPLICE_PAGES from being effective
> > for udplite.
> >
> > This likely affects ping sockets too.  udplite looks like it should be okay
> > as it expects "from" to be a msghdr.
>
> Willem, looks good?

Reviewed-by: Willem de Bruijn <willemb@google.com>

Disabling splicing if not ip_generic_getfrag sounds great to me.

  reply	other threads:[~2023-06-16  8:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-14  8:04 [PATCH net-next] ip, ip6: Fix splice to raw and ping sockets David Howells
2023-06-16  5:23 ` Jakub Kicinski
2023-06-16  8:34   ` Willem de Bruijn [this message]
2023-06-16  9:59   ` David Howells
2023-06-16 19:00 ` 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='CAF=yD-LLCoSTH1Jb+EFmpmTVO+Oo7Hjg6xcF4T2wR96QkjHZRw@mail.gmail.com' \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=syzbot+d8486855ef44506fd675@syzkaller.appspotmail.com \
    --cc=willy@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.