Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: "Zidenberg, Tsahi" <tsahee@amazon.com>
Cc: stable@vger.kernel.org
Subject: Re: [PATCH 1/2] bpf: fix userspace access for bpf_probe_read{, str}()
Date: Tue, 30 Mar 2021 13:21:38 -0400	[thread overview]
Message-ID: <YGNeIhMNjQ0RGUGr@sashalap> (raw)
In-Reply-To: <358062d4-fdf8-f3da-fd8e-c55cf1a089ec@amazon.com>

On Mon, Mar 29, 2021 at 01:58:21PM +0300, Zidenberg, Tsahi wrote:
>commit 8d92db5c04d10381f4db70ed99b1b576f5db18a7 upstream.
>
>This is an adaptation of parts from above commit to kernel 5.4.

This is very different from the upstream commit, let's not annotate it
as that commit.

>bpf_probe_read{,str}() BPF helpers are broken on arm64, where user
>addresses cannot be accessed with normal kernelspace access.
>
>Upstream solution got into v5.8 and cannot directly be cherry picked. We
>implement the same mechanism in kernel 5.4.
>
>Detection is only enabled for machines with non-overlapping address spaces
>using CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE from commits:
>commit 0ebeea8ca8a4 ("bpf: Restrict bpf_probe_read{, str}() only to archs where they work")
>commit d195b1d1d119 ("powerpc/bpf: Enable bpf_probe_read{, str}() on powerpc again")
>
>To generally fix the issue, upstream includes new BPF helpers:
>bpf_probe_read_{user,kernel}_str(). For details on them, see
>commit 6ae08ae3dea2 ("bpf: Add probe_read_{user, kernel} and probe_read_{user, kernel}_str helpers")

What stops us from taking that API back to 5.4? I took a look at the
dependencies and they don't look too scary.

Can we try that route instead? We really don't want to diverge from
upstream that much.

-- 
Thanks,
Sasha

  reply	other threads:[~2021-03-30 17:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-29 10:56 [PATCH 0/2] fix userspace access on arm64 for linux 5.4 Zidenberg, Tsahi
2021-03-29 10:58 ` [PATCH 1/2] bpf: fix userspace access for bpf_probe_read{, str}() Zidenberg, Tsahi
2021-03-30 17:21   ` Sasha Levin [this message]
2021-03-31 18:37     ` Zidenberg, Tsahi
2021-04-03  9:56       ` Greg KH
2021-04-04  9:13         ` Zidenberg, Tsahi
2021-04-10 11:29           ` Greg KH
2021-04-12 20:01             ` Zidenberg, Tsahi
2021-04-13  7:28               ` Greg KH
2021-03-29 10:59 ` [PATCH 2/2] tracing/kprobes: handle userspace access on unified probes Zidenberg, Tsahi
2021-04-10 11:29   ` Greg KH
2021-04-10 11:30 ` [PATCH 0/2] fix userspace access on arm64 for linux 5.4 Greg KH
2021-04-12 19:46   ` Zidenberg, Tsahi
2021-04-13  7:27     ` Greg KH
2021-04-21 13:04       ` Zidenberg, Tsahi
2021-04-21 13:26         ` Greg KH

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=YGNeIhMNjQ0RGUGr@sashalap \
    --to=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tsahee@amazon.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