No description
Find a file
Yonghong Song a35b9af4ec bpf: Add a kfunc for generic type cast
Implement bpf_rdonly_cast() which tries to cast the object
to a specified type. This tries to support use case like below:
  #define skb_shinfo(SKB) ((struct skb_shared_info *)(skb_end_pointer(SKB)))
where skb_end_pointer(SKB) is a 'unsigned char *' and needs to
be casted to 'struct skb_shared_info *'.

The signature of bpf_rdonly_cast() looks like
   void *bpf_rdonly_cast(void *obj, __u32 btf_id)
The function returns the same 'obj' but with PTR_TO_BTF_ID with
btf_id. The verifier will ensure btf_id being a struct type.

Since the supported type cast may not reflect what the 'obj'
represents, the returned btf_id is marked as PTR_UNTRUSTED, so
the return value and subsequent pointer chasing cannot be
used as helper/kfunc arguments.

Signed-off-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/r/20221120195437.3114585-1-yhs@fb.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2022-11-20 15:45:26 -08:00
arch net: remove skb->vlan_present 2022-11-11 18:18:05 -08:00
block
certs
crypto
Documentation bpf: Allow trusted pointers to be passed to KF_TRUSTED_ARGS kfuncs 2022-11-20 09:16:21 -08:00
drivers mlx5-updates-2022-11-12 2022-11-14 11:35:28 +00:00
fs
include bpf: Add a kfunc to type cast from bpf uapi ctx to kernel ctx 2022-11-20 15:43:37 -08:00
init
io_uring
ipc
kernel bpf: Add a kfunc for generic type cast 2022-11-20 15:45:26 -08:00
lib net: remove skb->vlan_present 2022-11-11 18:18:05 -08:00
LICENSES
mm
net bpf: Allow trusted pointers to be passed to KF_TRUSTED_ARGS kfuncs 2022-11-20 09:16:21 -08:00
rust
samples bpf, samples: Use "grep -E" instead of "egrep" 2022-11-18 23:55:02 +01:00
scripts
security
sound
tools bpf/selftests: Add selftests for new task kfuncs 2022-11-20 09:16:21 -08:00
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.