From: Song Liu <song@kernel.org>
To: "Loftus, Ciara" <ciara.loftus@intel.com>
Cc: "Björn Töpel" <bjorn.topel@gmail.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
"ast@kernel.org" <ast@kernel.org>,
"daniel@iogearbox.net" <daniel@iogearbox.net>,
"Topel, Bjorn" <bjorn.topel@intel.com>,
"maximmi@nvidia.com" <maximmi@nvidia.com>,
"Karlsson, Magnus" <magnus.karlsson@intel.com>,
"jonathan.lemon@gmail.com" <jonathan.lemon@gmail.com>
Subject: Re: [PATCH bpf] xsk: fix number of pinned pages/umem size discrepancy
Date: Mon, 14 Sep 2020 10:14:38 -0700 [thread overview]
Message-ID: <CAPhsuW7nhHV=SzgeW3fxQ0t=ciKczJLbouarYVSJP=oS6j6WbA@mail.gmail.com> (raw)
In-Reply-To: <f83087dfb41043648825c382ce6efa61@intel.com>
On Thu, Sep 10, 2020 at 2:29 AM Loftus, Ciara <ciara.loftus@intel.com> wrote:
>
> >
> > From: Björn Töpel <bjorn.topel@intel.com>
> >
> > For AF_XDP sockets, there was a discrepancy between the number of of
> > pinned pages and the size of the umem region.
> >
> > The size of the umem region is used to validate the AF_XDP descriptor
> > addresses. The logic that pinned the pages covered by the region only
> > took whole pages into consideration, creating a mismatch between the
> > size and pinned pages. A user could then pass AF_XDP addresses outside
> > the range of pinned pages, but still within the size of the region,
> > crashing the kernel.
> >
> > This change correctly calculates the number of pages to be
> > pinned. Further, the size check for the aligned mode is
> > simplified. Now the code simply checks if the size is divisible by the
> > chunk size.
> >
> > Fixes: bbff2f321a86 ("xsk: new descriptor addressing scheme")
> > Reported-by: Ciara Loftus <ciara.loftus@intel.com>
> > Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
>
> Thanks for the patch Björn.
>
> Tested-by: Ciara Loftus <ciara.loftus@intel.com>
Acked-by: Song Liu <songliubraving@fb.com>
next prev parent reply other threads:[~2020-09-14 17:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-10 7:56 [PATCH bpf] xsk: fix number of pinned pages/umem size discrepancy Björn Töpel
2020-09-10 9:24 ` Loftus, Ciara
2020-09-14 17:14 ` Song Liu [this message]
2020-09-15 1:37 ` Alexei Starovoitov
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='CAPhsuW7nhHV=SzgeW3fxQ0t=ciKczJLbouarYVSJP=oS6j6WbA@mail.gmail.com' \
--to=song@kernel.org \
--cc=ast@kernel.org \
--cc=bjorn.topel@gmail.com \
--cc=bjorn.topel@intel.com \
--cc=bpf@vger.kernel.org \
--cc=ciara.loftus@intel.com \
--cc=daniel@iogearbox.net \
--cc=jonathan.lemon@gmail.com \
--cc=magnus.karlsson@intel.com \
--cc=maximmi@nvidia.com \
--cc=netdev@vger.kernel.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.