Go to file
Eyal Birger abc340b38b xfrm: interface: support collect metadata mode
This commit adds support for 'collect_md' mode on xfrm interfaces.

Each net can have one collect_md device, created by providing the
IFLA_XFRM_COLLECT_METADATA flag at creation. This device cannot be
altered and has no if_id or link device attributes.

On transmit to this device, the if_id is fetched from the attached dst
metadata on the skb. If exists, the link property is also fetched from
the metadata. The dst metadata type used is METADATA_XFRM which holds
these properties.

On the receive side, xfrmi_rcv_cb() populates a dst metadata for each
packet received and attaches it to the skb. The if_id used in this case is
fetched from the xfrm state, and the link is fetched from the incoming
device. This information can later be used by upper layers such as tc,
ebpf, and ip rules.

Because the skb is scrubed in xfrmi_rcv_cb(), the attachment of the dst
metadata is postponed until after scrubing. Similarly, xfrm_input() is
adapted to avoid dropping metadata dsts by only dropping 'valid'
(skb_valid_dst(skb) == true) dsts.

Policy matching on packets arriving from collect_md xfrmi devices is
done by using the xfrm state existing in the skb's sec_path.
The xfrm_if_cb.decode_cb() interface implemented by xfrmi_decode_session()
is changed to keep the details of the if_id extraction tucked away
in xfrm_interface.c.

Reviewed-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
2022-08-29 10:41:28 +02:00
Documentation Including fixes from bluetooth, bpf, can and netfilter. 2022-08-11 13:45:37 -07:00
LICENSES LICENSES/LGPL-2.1: Add LGPL-2.1-or-later as valid identifiers 2021-12-16 14:33:10 +01:00
arch Including fixes from bluetooth, bpf, can and netfilter. 2022-08-11 13:45:37 -07:00
block block: convert to advancing variants of iov_iter_get_pages{,_alloc}() 2022-08-08 22:37:22 -04:00
certs Kbuild updates for v5.20 2022-08-10 10:40:41 -07:00
crypto crypto: blake2b: effectively disable frame size warning 2022-08-10 17:59:11 -07:00
drivers Including fixes from bluetooth, bpf, can and netfilter. 2022-08-11 13:45:37 -07:00
fs New code for 6.0: 2022-08-11 13:11:49 -07:00
include xfrm: interface: support collect metadata mode 2022-08-29 10:41:28 +02:00
init Kbuild updates for v5.20 2022-08-10 10:40:41 -07:00
io_uring iov_iter work, part 1 - isolated cleanups and optimizations. 2022-08-03 13:50:22 -07:00
ipc Updates to various subsystems which I help look after. lib, ocfs2, 2022-08-07 10:03:24 -07:00
kernel Including fixes from bluetooth, bpf, can and netfilter. 2022-08-11 13:45:37 -07:00
lib iov_iter stuff, part 2, rebased 2022-08-08 20:04:35 -07:00
mm - hugetlb_vmemmap cleanups from Muchun Song 2022-08-10 11:18:00 -07:00
net xfrm: interface: support collect metadata mode 2022-08-29 10:41:28 +02:00
samples Tracing updates for 5.20 / 6.0 2022-08-05 09:41:12 -07:00
scripts Revert "Makefile.extrawarn: re-enable -Wformat for clang" 2022-08-11 08:40:01 -07:00
security + Features 2022-08-10 10:53:22 -07:00
sound sound updates for 6.0-rc1 2022-08-06 10:19:51 -07:00
tools selftests/net: Refactor xfrm_fill_key() to use array of structs 2022-08-16 11:28:13 +02:00
usr Not a lot of material this cycle. Many singleton patches against various 2022-05-27 11:22:03 -07:00
virt KVM: Actually create debugfs in kvm_create_vm() 2022-08-10 15:08:28 -04:00
.clang-format PCI/DOE: Add DOE mailbox support functions 2022-07-19 15:38:04 -07:00
.cocciconfig scripts: add Linux .cocciconfig for coccinelle 2016-07-22 12:13:39 +02:00
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl 2019-05-16 10:53:40 -07:00
.gitattributes .gitattributes: use 'dts' diff driver for dts files 2019-12-04 19:44:11 -08:00
.gitignore kbuild: split the second line of *.mod into *.usyms 2022-05-08 03:16:59 +09:00
.mailmap Updates to various subsystems which I help look after. lib, ocfs2, 2022-08-07 10:03:24 -07:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS drm for 5.20/6.0 2022-08-03 19:52:08 -07:00
Kbuild kbuild: rename hostprogs-y/always to hostprogs/always-y 2020-02-04 01:53:07 +09:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS Including fixes from bluetooth, bpf, can and netfilter. 2022-08-11 13:45:37 -07:00
Makefile Makefile: link with -z noexecstack --no-warn-rwx-segments 2022-08-10 18:29:34 -07:00
README Drop all 00-INDEX files from Documentation/ 2018-09-09 15:08:58 -06:00

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.