From: David Laight <David.Laight@ACULAB.COM>
To: 'Matthew Wilcox' <willy@infradead.org>
Cc: 'Sagi Grimberg' <sagi@grimberg.me>,
kernel test robot <oliver.sang@intel.com>,
"oe-lkp@lists.linux.dev" <oe-lkp@lists.linux.dev>,
"lkp@intel.com" <lkp@intel.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>
Subject: RE: [PATCH] net: micro-optimize skb_datagram_iter
Date: Mon, 17 Jun 2024 10:18:18 +0000 [thread overview]
Message-ID: <e6a1eb41578c46609aa862b8f9148665@AcuMS.aculab.com> (raw)
In-Reply-To: <Zm9e0OpCaucP4836@casper.infradead.org>
From: Matthew Wilcox
> Sent: 16 June 2024 22:53
>
> On Sun, Jun 16, 2024 at 09:51:05PM +0000, David Laight wrote:
> > From: Sagi Grimberg
> > > Sent: 16 June 2024 10:24
> > ...
> > > > [ 13.498663][ T189] EIP: usercopy_abort (mm/usercopy.c:102 (discriminator 12))
> > > > [ 13.499424][ T194] usercopy: Kernel memory exposure attempt detected from kmap (offset 0,
> size
> > > 8192)!
> > >
> > > Hmm, not sure I understand exactly why changing kmap() to
> > > kmap_local_page() expose this,
> > > but it looks like mm/usercopy does not like size=8192 when copying for
> > > the skb frag.
> >
> > Can't a usercopy fault and have to read the page from swap?
> > So the process can sleep and then be rescheduled on a different cpu?
> > So you can't use kmap_local_page() here at all.
>
> I don't think you understand how kmap_local_page() works.
Quite likely :-)
But I thought it was a cheap way of temporarily mapping a physical memory
page into the current cpu's page tables without having to do any IPI to
tell other cpu about the insert or removal?
Which would require that the process not be migrated, which pretty much
implies that pre-emption be disabled.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2024-06-17 10:19 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-13 11:35 [PATCH] net: micro-optimize skb_datagram_iter Sagi Grimberg
2024-06-15 2:40 ` patchwork-bot+netdevbpf
2024-06-16 8:06 ` kernel test robot
2024-06-16 9:24 ` Sagi Grimberg
2024-06-16 21:51 ` David Laight
2024-06-16 21:53 ` Matthew Wilcox
2024-06-17 10:18 ` David Laight [this message]
2024-06-16 21:56 ` Matthew Wilcox
2024-06-17 6:29 ` Sagi Grimberg
2024-06-17 16:58 ` Jakub Kicinski
2024-06-18 6:37 ` Sagi Grimberg
2024-06-19 12:46 ` David Howells
2024-06-19 13:54 ` Sagi Grimberg
2024-06-19 14:51 ` Eric Dumazet
2024-06-19 14:56 ` Eric Dumazet
2024-06-19 15:25 ` Sagi Grimberg
2024-06-21 7:54 ` David Howells
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=e6a1eb41578c46609aa862b8f9148665@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=lkp@intel.com \
--cc=netdev@vger.kernel.org \
--cc=oe-lkp@lists.linux.dev \
--cc=oliver.sang@intel.com \
--cc=sagi@grimberg.me \
--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 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).