All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin KaFai Lau <martin.lau@linux.dev>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>,
	Kui-Feng Lee <thinker.li@gmail.com>
Cc: bpf@vger.kernel.org, ast@kernel.org, song@kernel.org,
	kernel-team@meta.com, andrii@kernel.org, quentin@isovalent.com,
	sinquersw@gmail.com, kuifeng@meta.com,
	Eduard Zingerman <eddyz87@gmail.com>
Subject: Re: [PATCH bpf-next v5 3/6] libbpf: Convert st_ops->data to shadow type.
Date: Wed, 28 Feb 2024 10:18:28 -0800	[thread overview]
Message-ID: <7be9132d-476e-499c-9c56-464ffb0e3a0a@linux.dev> (raw)
In-Reply-To: <CAEf4BzZbE=2Kvrx_XK60jhtFfJuFsu18=pcZFry8UuF-s_Lg_A@mail.gmail.com>

On 2/28/24 9:58 AM, Andrii Nakryiko wrote:
> Also, even if the bpf_program pointer is correct, it could be a
> program of the wrong type, so I think we should add a bit more
> validation here, given these pointers are set by users directly after
> bpf_object is opened.

+1. The checking that is done at open time (collect_st_ops_relos) should have 
been moved here (init_kern_struct_ops, i.e. load time). I saw Eduard (thanks!) 
has already done that in his set: 
https://lore.kernel.org/bpf/20240227204556.17524-3-eddyz87@gmail.com/

  reply	other threads:[~2024-02-28 18:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-27  1:04 [PATCH bpf-next v5 0/6] Create shadow types for struct_ops maps in skeletons Kui-Feng Lee
2024-02-27  1:04 ` [PATCH bpf-next v5 1/6] libbpf: expose resolve_func_ptr() through libbpf_internal.h Kui-Feng Lee
2024-02-28 14:38   ` Quentin Monnet
2024-02-28 17:45   ` Andrii Nakryiko
2024-02-28 18:27     ` Kui-Feng Lee
2024-02-27  1:04 ` [PATCH bpf-next v5 2/6] libbpf: set btf_value_type_id of struct bpf_map for struct_ops Kui-Feng Lee
2024-02-28 17:48   ` Andrii Nakryiko
2024-02-28 21:24     ` Kui-Feng Lee
2024-02-27  1:04 ` [PATCH bpf-next v5 3/6] libbpf: Convert st_ops->data to shadow type Kui-Feng Lee
2024-02-28 17:58   ` Andrii Nakryiko
2024-02-28 18:18     ` Martin KaFai Lau [this message]
2024-02-28 19:27     ` Kui-Feng Lee
2024-02-27  1:04 ` [PATCH bpf-next v5 4/6] bpftool: generated shadow variables for struct_ops maps Kui-Feng Lee
2024-02-28 18:25   ` Andrii Nakryiko
2024-02-28 21:21     ` Kui-Feng Lee
2024-02-28 22:28       ` Kui-Feng Lee
2024-02-29  0:09         ` Andrii Nakryiko
2024-02-29  0:44           ` Kui-Feng Lee
2024-02-29  0:51             ` Kui-Feng Lee
2024-02-29  1:03             ` Andrii Nakryiko
2024-02-29  1:14               ` Kui-Feng Lee
2024-02-27  1:04 ` [PATCH bpf-next v5 5/6] bpftool: Add an example for struct_ops map and shadow type Kui-Feng Lee
2024-02-28 14:38   ` Quentin Monnet
2024-02-27  1:04 ` [PATCH bpf-next v5 6/6] selftests/bpf: Test if shadow types work correctly Kui-Feng Lee

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=7be9132d-476e-499c-9c56-464ffb0e3a0a@linux.dev \
    --to=martin.lau@linux.dev \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=eddyz87@gmail.com \
    --cc=kernel-team@meta.com \
    --cc=kuifeng@meta.com \
    --cc=quentin@isovalent.com \
    --cc=sinquersw@gmail.com \
    --cc=song@kernel.org \
    --cc=thinker.li@gmail.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 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.