From: Yonghong Song <yonghong.song@linux.dev>
To: bpf@vger.kernel.org
Cc: Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
kernel-team@fb.com, Martin KaFai Lau <martin.lau@kernel.org>
Subject: Re: [PATCH] bpf: Support shadow stack
Date: Tue, 4 Jun 2024 16:41:54 -0700 [thread overview]
Message-ID: <9ba46c8c-17b0-4600-8b49-1d2c9821be04@linux.dev> (raw)
In-Reply-To: <20240604175552.1339642-1-yonghong.song@linux.dev>
Please ignore this patch and the next one shadow stack patch as well.
These patches are my prototype before lsfmmbpf conference.
Alexei has suggested a better approach which I will implement and post
soon.
On 6/4/24 10:55 AM, Yonghong Song wrote:
> Try to add 3rd argument to bpf program where the 3rd argument
> is the frame pointer to bpf program stack.
>
> There are a few issues here:
> - Currently, only main bpf program is using shadow stack.
> other sub programs (static or global) still use stack.
> It is POSSIBLE to a hidden register to pass
> frame pointer (derived from main program) to those static
> or global functions.
> - But tail call and ext programs are not working now we
> we do not know at jit time what programs will be used
> in tail call and ext. It is possible to do some jit
> during text_poke time. But that will need additional
> stack allocation at jit time and that will be complicated.
> - For xdp program, need to patch jit for xdp dispatcher.
>
> Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
> ---
> arch/x86/net/bpf_jit_comp.c | 105 +++++++++++++++++++++++++++++-------
> include/linux/bpf-cgroup.h | 9 ++--
> include/linux/bpf.h | 29 ++++++----
> include/linux/filter.h | 25 +++++++--
> kernel/bpf/cgroup.c | 9 ++--
> kernel/bpf/core.c | 36 +++++++++++--
> kernel/bpf/offload.c | 3 +-
> 7 files changed, 173 insertions(+), 43 deletions(-)
[...]
next prev parent reply other threads:[~2024-06-04 23:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-04 17:55 [PATCH bpf-next] selftests/bpf: Ignore .llvm.<hash> suffix in kallsyms_find() Yonghong Song
2024-06-04 17:55 ` [PATCH] bpf: Support shadow stack Yonghong Song
2024-06-04 23:41 ` Yonghong Song [this message]
2024-06-04 17:55 ` [PATCH] bpf: Support bpf " Yonghong Song
2024-06-04 17:58 ` [PATCH bpf-next] selftests/bpf: Ignore .llvm.<hash> suffix in kallsyms_find() Yonghong Song
2024-06-04 20:01 ` Andrii Nakryiko
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=9ba46c8c-17b0-4600-8b49-1d2c9821be04@linux.dev \
--to=yonghong.song@linux.dev \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kernel-team@fb.com \
--cc=martin.lau@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox