forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller: "Highlights: 1) Support AES128-CCM ciphers in kTLS, from Vakul Garg. 2) Add fib_sync_mem to control the amount of dirty memory we allow to queue up between synchronize RCU calls, from David Ahern. 3) Make flow classifier more lockless, from Vlad Buslov. 4) Add PHY downshift support to aquantia driver, from Heiner Kallweit. 5) Add SKB cache for TCP rx and tx, from Eric Dumazet. This reduces contention on SLAB spinlocks in heavy RPC workloads. 6) Partial GSO offload support in XFRM, from Boris Pismenny. 7) Add fast link down support to ethtool, from Heiner Kallweit. 8) Use siphash for IP ID generator, from Eric Dumazet. 9) Pull nexthops even further out from ipv4/ipv6 routes and FIB entries, from David Ahern. 10) Move skb->xmit_more into a per-cpu variable, from Florian Westphal. 11) Improve eBPF verifier speed and increase maximum program size, from Alexei Starovoitov. 12) Eliminate per-bucket spinlocks in rhashtable, and instead use bit spinlocks. From Neil Brown. 13) Allow tunneling with GUE encap in ipvs, from Jacky Hu. 14) Improve link partner cap detection in generic PHY code, from Heiner Kallweit. 15) Add layer 2 encap support to bpf_skb_adjust_room(), from Alan Maguire. 16) Remove SKB list implementation assumptions in SCTP, your's truly. 17) Various cleanups, optimizations, and simplifications in r8169 driver. From Heiner Kallweit. 18) Add memory accounting on TX and RX path of SCTP, from Xin Long. 19) Switch PHY drivers over to use dynamic featue detection, from Heiner Kallweit. 20) Support flow steering without masking in dpaa2-eth, from Ioana Ciocoi. 21) Implement ndo_get_devlink_port in netdevsim driver, from Jiri Pirko. 22) Increase the strict parsing of current and future netlink attributes, also export such policies to userspace. From Johannes Berg. 23) Allow DSA tag drivers to be modular, from Andrew Lunn. 24) Remove legacy DSA probing support, also from Andrew Lunn. 25) Allow ll_temac driver to be used on non-x86 platforms, from Esben Haabendal. 26) Add a generic tracepoint for TX queue timeouts to ease debugging, from Cong Wang. 27) More indirect call optimizations, from Paolo Abeni" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1763 commits) cxgb4: Fix error path in cxgb4_init_module net: phy: improve pause mode reporting in phy_print_status dt-bindings: net: Fix a typo in the phy-mode list for ethernet bindings net: macb: Change interrupt and napi enable order in open net: ll_temac: Improve error message on error IRQ net/sched: remove block pointer from common offload structure net: ethernet: support of_get_mac_address new ERR_PTR error net: usb: smsc: fix warning reported by kbuild test robot staging: octeon-ethernet: Fix of_get_mac_address ERR_PTR check net: dsa: support of_get_mac_address new ERR_PTR error net: dsa: sja1105: Fix status initialization in sja1105_get_ethtool_stats vrf: sit mtu should not be updated when vrf netdev is the link net: dsa: Fix error cleanup path in dsa_init_module l2tp: Fix possible NULL pointer dereference taprio: add null check on sched_nest to avoid potential null pointer dereference net: mvpp2: cls: fix less than zero check on a u32 variable net_sched: sch_fq: handle non connected flows net_sched: sch_fq: do not assume EDT packets are ordered net: hns3: use devm_kcalloc when allocating desc_cb net: hns3: some cleanup for struct hns3_enet_ring ...
- Loading branch information
Showing
1,636 changed files
with
126,811 additions
and
26,978 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,9 @@ Alan Cox <[email protected]> | |
Alan Cox <[email protected]> | ||
Aleksey Gorelov <[email protected]> | ||
Aleksandar Markovic <[email protected]> <[email protected]> | ||
Alexei Starovoitov <[email protected]> <[email protected]> | ||
Alexei Starovoitov <[email protected]> <[email protected]> | ||
Alexei Starovoitov <[email protected]> <[email protected]> | ||
Al Viro <[email protected]> | ||
Al Viro <[email protected]> | ||
Andi Shyti <[email protected]> <[email protected]> | ||
|
@@ -46,6 +49,12 @@ Christoph Hellwig <[email protected]> | |
Christophe Ricard <[email protected]> | ||
Corey Minyard <[email protected]> | ||
Damian Hobson-Garcia <[email protected]> | ||
Daniel Borkmann <[email protected]> <[email protected]> | ||
Daniel Borkmann <[email protected]> <[email protected]> | ||
Daniel Borkmann <[email protected]> <[email protected]> | ||
Daniel Borkmann <[email protected]> <[email protected]> | ||
Daniel Borkmann <[email protected]> <[email protected]> | ||
Daniel Borkmann <[email protected]> <[email protected]> | ||
David Brownell <[email protected]> | ||
David Woodhouse <[email protected]> | ||
Dengcheng Zhu <[email protected]> <[email protected]> | ||
|
2 changes: 2 additions & 0 deletions
2
...on/ABI/testing/sysfs-class-net-batman-adv → ...n/ABI/obsolete/sysfs-class-net-batman-adv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...entation/ABI/testing/sysfs-class-net-mesh → ...ntation/ABI/obsolete/sysfs-class-net-mesh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
.. SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) | ||
=========================== | ||
BPF_PROG_TYPE_CGROUP_SYSCTL | ||
=========================== | ||
|
||
This document describes ``BPF_PROG_TYPE_CGROUP_SYSCTL`` program type that | ||
provides cgroup-bpf hook for sysctl. | ||
|
||
The hook has to be attached to a cgroup and will be called every time a | ||
process inside that cgroup tries to read from or write to sysctl knob in proc. | ||
|
||
1. Attach type | ||
************** | ||
|
||
``BPF_CGROUP_SYSCTL`` attach type has to be used to attach | ||
``BPF_PROG_TYPE_CGROUP_SYSCTL`` program to a cgroup. | ||
|
||
2. Context | ||
********** | ||
|
||
``BPF_PROG_TYPE_CGROUP_SYSCTL`` provides access to the following context from | ||
BPF program:: | ||
|
||
struct bpf_sysctl { | ||
__u32 write; | ||
__u32 file_pos; | ||
}; | ||
|
||
* ``write`` indicates whether sysctl value is being read (``0``) or written | ||
(``1``). This field is read-only. | ||
|
||
* ``file_pos`` indicates file position sysctl is being accessed at, read | ||
or written. This field is read-write. Writing to the field sets the starting | ||
position in sysctl proc file ``read(2)`` will be reading from or ``write(2)`` | ||
will be writing to. Writing zero to the field can be used e.g. to override | ||
whole sysctl value by ``bpf_sysctl_set_new_value()`` on ``write(2)`` even | ||
when it's called by user space on ``file_pos > 0``. Writing non-zero | ||
value to the field can be used to access part of sysctl value starting from | ||
specified ``file_pos``. Not all sysctl support access with ``file_pos != | ||
0``, e.g. writes to numeric sysctl entries must always be at file position | ||
``0``. See also ``kernel.sysctl_writes_strict`` sysctl. | ||
|
||
See `linux/bpf.h`_ for more details on how context field can be accessed. | ||
|
||
3. Return code | ||
************** | ||
|
||
``BPF_PROG_TYPE_CGROUP_SYSCTL`` program must return one of the following | ||
return codes: | ||
|
||
* ``0`` means "reject access to sysctl"; | ||
* ``1`` means "proceed with access". | ||
|
||
If program returns ``0`` user space will get ``-1`` from ``read(2)`` or | ||
``write(2)`` and ``errno`` will be set to ``EPERM``. | ||
|
||
4. Helpers | ||
********** | ||
|
||
Since sysctl knob is represented by a name and a value, sysctl specific BPF | ||
helpers focus on providing access to these properties: | ||
|
||
* ``bpf_sysctl_get_name()`` to get sysctl name as it is visible in | ||
``/proc/sys`` into provided by BPF program buffer; | ||
|
||
* ``bpf_sysctl_get_current_value()`` to get string value currently held by | ||
sysctl into provided by BPF program buffer. This helper is available on both | ||
``read(2)`` from and ``write(2)`` to sysctl; | ||
|
||
* ``bpf_sysctl_get_new_value()`` to get new string value currently being | ||
written to sysctl before actual write happens. This helper can be used only | ||
on ``ctx->write == 1``; | ||
|
||
* ``bpf_sysctl_set_new_value()`` to override new string value currently being | ||
written to sysctl before actual write happens. Sysctl value will be | ||
overridden starting from the current ``ctx->file_pos``. If the whole value | ||
has to be overridden BPF program can set ``file_pos`` to zero before calling | ||
to the helper. This helper can be used only on ``ctx->write == 1``. New | ||
string value set by the helper is treated and verified by kernel same way as | ||
an equivalent string passed by user space. | ||
|
||
BPF program sees sysctl value same way as user space does in proc filesystem, | ||
i.e. as a string. Since many sysctl values represent an integer or a vector | ||
of integers, the following helpers can be used to get numeric value from the | ||
string: | ||
|
||
* ``bpf_strtol()`` to convert initial part of the string to long integer | ||
similar to user space `strtol(3)`_; | ||
* ``bpf_strtoul()`` to convert initial part of the string to unsigned long | ||
integer similar to user space `strtoul(3)`_; | ||
|
||
See `linux/bpf.h`_ for more details on helpers described here. | ||
|
||
5. Examples | ||
*********** | ||
|
||
See `test_sysctl_prog.c`_ for an example of BPF program in C that access | ||
sysctl name and value, parses string value to get vector of integers and uses | ||
the result to make decision whether to allow or deny access to sysctl. | ||
|
||
6. Notes | ||
******** | ||
|
||
``BPF_PROG_TYPE_CGROUP_SYSCTL`` is intended to be used in **trusted** root | ||
environment, for example to monitor sysctl usage or catch unreasonable values | ||
an application, running as root in a separate cgroup, is trying to set. | ||
|
||
Since `task_dfl_cgroup(current)` is called at `sys_read` / `sys_write` time it | ||
may return results different from that at `sys_open` time, i.e. process that | ||
opened sysctl file in proc filesystem may differ from process that is trying | ||
to read from / write to it and two such processes may run in different | ||
cgroups, what means ``BPF_PROG_TYPE_CGROUP_SYSCTL`` should not be used as a | ||
security mechanism to limit sysctl usage. | ||
|
||
As with any cgroup-bpf program additional care should be taken if an | ||
application running as root in a cgroup should not be allowed to | ||
detach/replace BPF program attached by administrator. | ||
|
||
.. Links | ||
.. _linux/bpf.h: ../../include/uapi/linux/bpf.h | ||
.. _strtol(3): http://man7.org/linux/man-pages/man3/strtol.3p.html | ||
.. _strtoul(3): http://man7.org/linux/man-pages/man3/strtoul.3p.html | ||
.. _test_sysctl_prog.c: | ||
../../tools/testing/selftests/bpf/progs/test_sysctl_prog.c |
6 changes: 3 additions & 3 deletions
6
...ntation/networking/bpf_flow_dissector.rst → Documentation/bpf/prog_flow_dissector.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.