Joanne Koong 361f129f3c bpf: Add bpf_dynptr_clone
The cloned dynptr will point to the same data as its parent dynptr,
with the same type, offset, size and read-only properties.

Any writes to a dynptr will be reflected across all instances
(by 'instance', this means any dynptrs that point to the same
underlying data).

Please note that data slice and dynptr invalidations will affect all
instances as well. For example, if bpf_dynptr_write() is called on an
skb-type dynptr, all data slices of dynptr instances to that skb
will be invalidated as well (eg data slices of any clones, parents,
grandparents, ...). Another example is if a ringbuf dynptr is submitted,
any instance of that dynptr will be invalidated.

Changing the view of the dynptr (eg advancing the offset or
trimming the size) will only affect that dynptr and not affect any
other instances.

One example use case where cloning may be helpful is for hashing or
iterating through dynptr data. Cloning will allow the user to maintain
the original view of the dynptr for future use, while also allowing
views to smaller subsets of the data after the offset is advanced or the
size is trimmed.

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20230420071414.570108-5-joannelkoong@gmail.com
2023-04-27 10:40:47 +02:00
2023-04-26 16:07:23 -07:00
2023-04-26 12:52:58 -07:00
2023-04-26 16:07:23 -07:00
2023-04-26 16:07:23 -07:00
2023-04-26 16:07:23 -07:00
2023-04-27 10:40:41 +02:00
2023-04-25 13:00:41 -07:00
2023-04-26 16:07:23 -07:00
2023-04-27 10:40:47 +02:00
2023-04-26 16:07:23 -07:00
2023-04-26 16:07:23 -07:00
2023-04-26 16:07:23 -07:00
2023-04-26 16:07:23 -07:00
2023-04-26 16:07:23 -07:00
2023-04-26 16:07:23 -07:00
2023-04-24 10:29:28 -07:00
2023-04-26 16:07:23 -07:00
2023-04-24 12:31:32 -07:00
2022-09-28 09:02:20 +02:00
2023-03-14 12:56:30 -06:00
2022-10-10 12:00:45 -07:00
2023-04-26 16:07:23 -07:00
2023-04-23 12:02:52 -07:00

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.
Description
No description provided
Readme 5.7 GiB
Languages
C 97.6%
Assembly 1%
Shell 0.5%
Python 0.3%
Makefile 0.3%