1. 18 Oct, 2022 2 commits
  2. 13 Oct, 2022 13 commits
  3. 12 Oct, 2022 1 commit
  4. 10 Oct, 2022 7 commits
  5. 07 Oct, 2022 1 commit
  6. 06 Oct, 2022 4 commits
    • Jiri Olsa's avatar
      selftests/bpf: Add missing bpf_iter_vma_offset__destroy call · 1d2d941b
      Jiri Olsa authored
      Adding missing bpf_iter_vma_offset__destroy call and using in-skeletin
      link pointer so we don't need extra bpf_link__destroy call.
      
      Fixes: b3e1331e ("selftests/bpf: Test parameterized task BPF iterators.")
      Cc: Kui-Feng Lee <kuifeng@fb.com>
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Link: https://lore.kernel.org/r/20221006083106.117987-1-jolsa@kernel.orgSigned-off-by: default avatarMartin KaFai Lau <martin.lau@kernel.org>
      1d2d941b
    • Yonghong Song's avatar
      selftests/bpf: Add selftest deny_namespace to s390x deny list · 8206e4e9
      Yonghong Song authored
      BPF CI reported that selftest deny_namespace failed with s390x.
      
        test_unpriv_userns_create_no_bpf:PASS:no-bpf unpriv new user ns 0 nsec
        test_deny_namespace:PASS:skel load 0 nsec
        libbpf: prog 'test_userns_create': failed to attach: ERROR: strerror_r(-524)=22
        libbpf: prog 'test_userns_create': failed to auto-attach: -524
        test_deny_namespace:FAIL:attach unexpected error: -524 (errno 524)
        #57/1    deny_namespace/unpriv_userns_create_no_bpf:FAIL
        #57      deny_namespace:FAIL
      
      BPF program test_userns_create is a BPF LSM type program which is
      based on trampoline and s390x does not support s390x. Let add the
      test to x390x deny list to avoid this failure in BPF CI.
      Signed-off-by: default avatarYonghong Song <yhs@fb.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Link: https://lore.kernel.org/r/20221006053429.3549165-1-yhs@fb.comSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      8206e4e9
    • Andrii Nakryiko's avatar
      scripts/bpf_doc.py: update logic to not assume sequential enum values · ce3e44a0
      Andrii Nakryiko authored
      Relax bpf_doc.py's expectation of all BPF_FUNC_xxx enumerators having
      sequential values increasing by one. Instead, only make sure that
      relative order of BPF helper descriptions in comments matches
      enumerators definitions order.
      
      Also additionally make sure that helper IDs are not duplicated.
      
      And also make sure that for cases when we have multiple descriptions for
      the same BPF helper (e.g., for bpf_get_socket_cookie()), all such
      descriptions are grouped together.
      
      Such checks should capture all the same (and more) issues in upstream
      UAPI headers, but also handle backported kernels correctly.
      Reported-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Reviewed-by: default avatarQuentin Monnet <quentin@isovalent.com>
      Link: https://lore.kernel.org/r/20221006042452.2089843-2-andrii@kernel.orgSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      ce3e44a0
    • Andrii Nakryiko's avatar
      bpf: explicitly define BPF_FUNC_xxx integer values · 8a76145a
      Andrii Nakryiko authored
      Historically enum bpf_func_id's BPF_FUNC_xxx enumerators relied on
      implicit sequential values being assigned by compiler. This is
      convenient, as new BPF helpers are always added at the very end, but it
      also has its downsides, some of them being:
      
        - with over 200 helpers now it's very hard to know what's each helper's ID,
          which is often important to know when working with BPF assembly (e.g.,
          by dumping raw bpf assembly instructions with llvm-objdump -d
          command). it's possible to work around this by looking into vmlinux.h,
          dumping /sys/btf/kernel/vmlinux, looking at libbpf-provided
          bpf_helper_defs.h, etc. But it always feels like an unnecessary step
          and one should be able to quickly figure this out from UAPI header.
      
        - when backporting and cherry-picking only some BPF helpers onto older
          kernels it's important to be able to skip some enum values for helpers
          that weren't backported, but preserve absolute integer IDs to keep BPF
          helper IDs stable so that BPF programs stay portable across upstream
          and backported kernels.
      
      While neither problem is insurmountable, they come up frequently enough
      and are annoying enough to warrant improving the situation. And for the
      backporting the problem can easily go unnoticed for a while, especially
      if backport is done with people not very familiar with BPF subsystem overall.
      
      Anyways, it's easy to fix this by making sure that __BPF_FUNC_MAPPER
      macro provides explicit helper IDs. Unfortunately that would potentially
      break existing users that use UAPI-exposed __BPF_FUNC_MAPPER and are
      expected to pass macro that accepts only symbolic helper identifier
      (e.g., map_lookup_elem for bpf_map_lookup_elem() helper).
      
      As such, we need to introduce a new macro (___BPF_FUNC_MAPPER) which
      would specify both identifier and integer ID, but in such a way as to
      allow existing __BPF_FUNC_MAPPER be expressed in terms of new
      ___BPF_FUNC_MAPPER macro. And that's what this patch is doing. To avoid
      duplication and allow __BPF_FUNC_MAPPER stay *exactly* the same,
      ___BPF_FUNC_MAPPER accepts arbitrary "context" arguments, which can be
      used to pass any extra macros, arguments, and whatnot. In our case we
      use this to pass original user-provided macro that expects single
      argument and __BPF_FUNC_MAPPER is using it's own three-argument
      __BPF_FUNC_MAPPER_APPLY intermediate macro to impedance-match new and
      old "callback" macros.
      
      Once we resolve this, we use new ___BPF_FUNC_MAPPER to define enum
      bpf_func_id with explicit values. The other users of __BPF_FUNC_MAPPER
      in kernel (namely in kernel/bpf/disasm.c) are kept exactly the same both
      as demonstration that backwards compat works, but also to avoid
      unnecessary code churn.
      
      Note that new ___BPF_FUNC_MAPPER() doesn't forcefully insert comma
      between values, as that might not be appropriate in all possible cases
      where ___BPF_FUNC_MAPPER might be used by users. This doesn't reduce
      usability, as it's trivial to insert that comma inside "callback" macro.
      
      To validate all the manually specified IDs are exactly right, we used
      BTF to compare before and after values:
      
        $ bpftool btf dump file ~/linux-build/default/vmlinux | rg bpf_func_id -A 211 > after.txt
        $ git stash # stach UAPI changes
        $ make -j90
        ... re-building kernel without UAPI changes ...
        $ bpftool btf dump file ~/linux-build/default/vmlinux | rg bpf_func_id -A 211 > before.txt
        $ diff -u before.txt after.txt
        --- before.txt  2022-10-05 10:48:18.119195916 -0700
        +++ after.txt   2022-10-05 10:46:49.446615025 -0700
        @@ -1,4 +1,4 @@
        -[14576] ENUM 'bpf_func_id' encoding=UNSIGNED size=4 vlen=211
        +[9560] ENUM 'bpf_func_id' encoding=UNSIGNED size=4 vlen=211
                'BPF_FUNC_unspec' val=0
                'BPF_FUNC_map_lookup_elem' val=1
                'BPF_FUNC_map_update_elem' val=2
      
      As can be seen from diff above, the only thing that changed was resulting BTF
      type ID of ENUM bpf_func_id, not any of the enumerators, their names or integer
      values.
      
      The only other place that needed fixing was scripts/bpf_doc.py used to generate
      man pages and bpf_helper_defs.h header for libbpf and selftests. That script is
      tightly-coupled to exact shape of ___BPF_FUNC_MAPPER macro definition, so had
      to be trivially adapted.
      
      Cc: Quentin Monnet <quentin@isovalent.com>
      Reported-by: default avatarAndrea Terzolo <andrea.terzolo@polito.it>
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Reviewed-by: default avatarQuentin Monnet <quentin@isovalent.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarToke Høiland-Jørgensen <toke@redhat.com>
      Link: https://lore.kernel.org/r/20221006042452.2089843-1-andrii@kernel.orgSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      8a76145a
  7. 05 Oct, 2022 5 commits
  8. 04 Oct, 2022 7 commits
    • Linus Torvalds's avatar
      Merge tag 'net-next-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next · 0326074f
      Linus Torvalds authored
      Pull networking updates from Jakub Kicinski:
       "Core:
      
         - Introduce and use a single page frag cache for allocating small skb
           heads, clawing back the 10-20% performance regression in UDP flood
           test from previous fixes.
      
         - Run packets which already went thru HW coalescing thru SW GRO. This
           significantly improves TCP segment coalescing and simplifies
           deployments as different workloads benefit from HW or SW GRO.
      
         - Shrink the size of the base zero-copy send structure.
      
         - Move TCP init under a new slow / sleepable version of DO_ONCE().
      
        BPF:
      
         - Add BPF-specific, any-context-safe memory allocator.
      
         - Add helpers/kfuncs for PKCS#7 signature verification from BPF
           programs.
      
         - Define a new map type and related helpers for user space -> kernel
           communication over a ring buffer (BPF_MAP_TYPE_USER_RINGBUF).
      
         - Allow targeting BPF iterators to loop through resources of one
           task/thread.
      
         - Add ability to call selected destructive functions. Expose
           crash_kexec() to allow BPF to trigger a kernel dump. Use
           CAP_SYS_BOOT check on the loading process to judge permissions.
      
         - Enable BPF to collect custom hierarchical cgroup stats efficiently
           by integrating with the rstat framework.
      
         - Support struct arguments for trampoline based programs. Only
           structs with size <= 16B and x86 are supported.
      
         - Invoke cgroup/connect{4,6} programs for unprivileged ICMP ping
           sockets (instead of just TCP and UDP sockets).
      
         - Add a helper for accessing CLOCK_TAI for time sensitive network
           related programs.
      
         - Support accessing network tunnel metadata's flags.
      
         - Make TCP SYN ACK RTO tunable by BPF programs with TCP Fast Open.
      
         - Add support for writing to Netfilter's nf_conn:mark.
      
        Protocols:
      
         - WiFi: more Extremely High Throughput (EHT) and Multi-Link Operation
           (MLO) work (802.11be, WiFi 7).
      
         - vsock: improve support for SO_RCVLOWAT.
      
         - SMC: support SO_REUSEPORT.
      
         - Netlink: define and document how to use netlink in a "modern" way.
           Support reporting missing attributes via extended ACK.
      
         - IPSec: support collect metadata mode for xfrm interfaces.
      
         - TCPv6: send consistent autoflowlabel in SYN_RECV state and RST
           packets.
      
         - TCP: introduce optional per-netns connection hash table to allow
           better isolation between namespaces (opt-in, at the cost of memory
           and cache pressure).
      
         - MPTCP: support TCP_FASTOPEN_CONNECT.
      
         - Add NEXT-C-SID support in Segment Routing (SRv6) End behavior.
      
         - Adjust IP_UNICAST_IF sockopt behavior for connected UDP sockets.
      
         - Open vSwitch:
            - Allow specifying ifindex of new interfaces.
            - Allow conntrack and metering in non-initial user namespace.
      
         - TLS: support the Korean ARIA-GCM crypto algorithm.
      
         - Remove DECnet support.
      
        Driver API:
      
         - Allow selecting the conduit interface used by each port in DSA
           switches, at runtime.
      
         - Ethernet Power Sourcing Equipment and Power Device support.
      
         - Add tc-taprio support for queueMaxSDU parameter, i.e. setting per
           traffic class max frame size for time-based packet schedules.
      
         - Support PHY rate matching - adapting between differing host-side
           and link-side speeds.
      
         - Introduce QUSGMII PHY mode and 1000BASE-KX interface mode.
      
         - Validate OF (device tree) nodes for DSA shared ports; make
           phylink-related properties mandatory on DSA and CPU ports.
           Enforcing more uniformity should allow transitioning to phylink.
      
         - Require that flash component name used during update matches one of
           the components for which version is reported by info_get().
      
         - Remove "weight" argument from driver-facing NAPI API as much as
           possible. It's one of those magic knobs which seemed like a good
           idea at the time but is too indirect to use in practice.
      
         - Support offload of TLS connections with 256 bit keys.
      
        New hardware / drivers:
      
         - Ethernet:
            - Microchip KSZ9896 6-port Gigabit Ethernet Switch
            - Renesas Ethernet AVB (EtherAVB-IF) Gen4 SoCs
            - Analog Devices ADIN1110 and ADIN2111 industrial single pair
              Ethernet (10BASE-T1L) MAC+PHY.
            - Rockchip RV1126 Gigabit Ethernet (a version of stmmac IP).
      
         - Ethernet SFPs / modules:
            - RollBall / Hilink / Turris 10G copper SFPs
            - HALNy GPON module
      
         - WiFi:
            - CYW43439 SDIO chipset (brcmfmac)
            - CYW89459 PCIe chipset (brcmfmac)
            - BCM4378 on Apple platforms (brcmfmac)
      
        Drivers:
      
         - CAN:
            - gs_usb: HW timestamp support
      
         - Ethernet PHYs:
            - lan8814: cable diagnostics
      
         - Ethernet NICs:
            - Intel (100G):
               - implement control of FCS/CRC stripping
               - port splitting via devlink
               - L2TPv3 filtering offload
            - nVidia/Mellanox:
               - tunnel offload for sub-functions
               - MACSec offload, w/ Extended packet number and replay window
                 offload
               - significantly restructure, and optimize the AF_XDP support,
                 align the behavior with other vendors
            - Huawei:
               - configuring DSCP map for traffic class selection
               - querying standard FEC statistics
               - querying SerDes lane number via ethtool
            - Marvell/Cavium:
               - egress priority flow control
               - MACSec offload
            - AMD/SolarFlare:
               - PTP over IPv6 and raw Ethernet
            - small / embedded:
               - ax88772: convert to phylink (to support SFP cages)
               - altera: tse: convert to phylink
               - ftgmac100: support fixed link
               - enetc: standard Ethtool counters
               - macb: ZynqMP SGMII dynamic configuration support
               - tsnep: support multi-queue and use page pool
               - lan743x: Rx IP & TCP checksum offload
               - igc: add xdp frags support to ndo_xdp_xmit
      
         - Ethernet high-speed switches:
            - Marvell (prestera):
               - support SPAN port features (traffic mirroring)
               - nexthop object offloading
            - Microchip (sparx5):
               - multicast forwarding offload
               - QoS queuing offload (tc-mqprio, tc-tbf, tc-ets)
      
         - Ethernet embedded switches:
            - Marvell (mv88e6xxx):
               - support RGMII cmode
            - NXP (felix):
               - standardized ethtool counters
            - Microchip (lan966x):
               - QoS queuing offload (tc-mqprio, tc-tbf, tc-cbs, tc-ets)
               - traffic policing and mirroring
               - link aggregation / bonding offload
               - QUSGMII PHY mode support
      
         - Qualcomm 802.11ax WiFi (ath11k):
            - cold boot calibration support on WCN6750
            - support to connect to a non-transmit MBSSID AP profile
            - enable remain-on-channel support on WCN6750
            - Wake-on-WLAN support for WCN6750
            - support to provide transmit power from firmware via nl80211
            - support to get power save duration for each client
            - spectral scan support for 160 MHz
      
         - MediaTek WiFi (mt76):
            - WiFi-to-Ethernet bridging offload for MT7986 chips
      
         - RealTek WiFi (rtw89):
            - P2P support"
      
      * tag 'net-next-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (1864 commits)
        eth: pse: add missing static inlines
        once: rename _SLOW to _SLEEPABLE
        net: pse-pd: add regulator based PSE driver
        dt-bindings: net: pse-dt: add bindings for regulator based PoDL PSE controller
        ethtool: add interface to interact with Ethernet Power Equipment
        net: mdiobus: search for PSE nodes by parsing PHY nodes.
        net: mdiobus: fwnode_mdiobus_register_phy() rework error handling
        net: add framework to support Ethernet PSE and PDs devices
        dt-bindings: net: phy: add PoDL PSE property
        net: marvell: prestera: Propagate nh state from hw to kernel
        net: marvell: prestera: Add neighbour cache accounting
        net: marvell: prestera: add stub handler neighbour events
        net: marvell: prestera: Add heplers to interact with fib_notifier_info
        net: marvell: prestera: Add length macros for prestera_ip_addr
        net: marvell: prestera: add delayed wq and flush wq on deinit
        net: marvell: prestera: Add strict cleanup of fib arbiter
        net: marvell: prestera: Add cleanup of allocated fib_nodes
        net: marvell: prestera: Add router nexthops ABI
        eth: octeon: fix build after netif_napi_add() changes
        net/mlx5: E-Switch, Return EBUSY if can't get mode lock
        ...
      0326074f
    • Linus Torvalds's avatar
      Merge tag 'landlock-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux · 522667b2
      Linus Torvalds authored
      Pull landlock updates from Mickaël Salaün:
       "Improve user help for Landlock (documentation and sample)"
      
      * tag 'landlock-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux:
        landlock: Fix documentation style
        landlock: Slightly improve documentation and fix spelling
        samples/landlock: Print hints about ABI versions
      522667b2
    • Linus Torvalds's avatar
      Merge tag 'audit-pr-20221003' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit · c645c11a
      Linus Torvalds authored
      Pull audit updates from Paul Moore:
       "Six audit patches for v6.1, most are pretty trivial, but a quick list
        of the highlights are below:
      
         - Only free the audit proctitle information on task exit. This allows
           us to cache the information and improve performance slightly.
      
         - Use the time_after() macro to do time comparisons instead of doing
           it directly and potentially causing ourselves problems when the
           timer wraps.
      
         - Convert an audit_context state comparison from a relative enum
           comparison, e.g. (x < y), to a not-equal comparison to ensure that
           we are not caught out at some unknown point in the future by an
           enum shuffle.
      
         - A handful of small cleanups such as tidying up comments and
           removing unused declarations"
      
      * tag 'audit-pr-20221003' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit:
        audit: remove selinux_audit_rule_update() declaration
        audit: use time_after to compare time
        audit: free audit_proctitle only on task exit
        audit: explicitly check audit_context->context enum value
        audit: audit_context pid unused, context enum comment fix
        audit: fix repeated words in comments
      c645c11a
    • Linus Torvalds's avatar
      Merge tag 'x86_cleanups_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 3eba620e
      Linus Torvalds authored
      Pull x86 cleanups from Borislav Petkov:
      
       - The usual round of smaller fixes and cleanups all over the tree
      
      * tag 'x86_cleanups_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/cpu: Include the header of init_ia32_feat_ctl()'s prototype
        x86/uaccess: Improve __try_cmpxchg64_user_asm() for x86_32
        x86: Fix various duplicate-word comment typos
        x86/boot: Remove superfluous type casting from arch/x86/boot/bitops.h
      3eba620e
    • Linus Torvalds's avatar
      Merge tag 'x86_cache_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 193e2268
      Linus Torvalds authored
      Pull x86 cache resource control updates from Borislav Petkov:
      
       - More work by James Morse to disentangle the resctrl filesystem
         generic code from the architectural one with the endgoal of plugging
         ARM's MPAM implementation into it too so that the user interface
         remains the same
      
       - Properly restore the MSR_MISC_FEATURE_CONTROL value instead of
         blindly overwriting it to 0
      
      * tag 'x86_cache_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (22 commits)
        x86/resctrl: Make resctrl_arch_rmid_read() return values in bytes
        x86/resctrl: Add resctrl_rmid_realloc_limit to abstract x86's boot_cpu_data
        x86/resctrl: Rename and change the units of resctrl_cqm_threshold
        x86/resctrl: Move get_corrected_mbm_count() into resctrl_arch_rmid_read()
        x86/resctrl: Move mbm_overflow_count() into resctrl_arch_rmid_read()
        x86/resctrl: Pass the required parameters into resctrl_arch_rmid_read()
        x86/resctrl: Abstract __rmid_read()
        x86/resctrl: Allow per-rmid arch private storage to be reset
        x86/resctrl: Add per-rmid arch private storage for overflow and chunks
        x86/resctrl: Calculate bandwidth from the previous __mon_event_count() chunks
        x86/resctrl: Allow update_mba_bw() to update controls directly
        x86/resctrl: Remove architecture copy of mbps_val
        x86/resctrl: Switch over to the resctrl mbps_val list
        x86/resctrl: Create mba_sc configuration in the rdt_domain
        x86/resctrl: Abstract and use supports_mba_mbps()
        x86/resctrl: Remove set_mba_sc()s control array re-initialisation
        x86/resctrl: Add domain offline callback for resctrl work
        x86/resctrl: Group struct rdt_hw_domain cleanup
        x86/resctrl: Add domain online callback for resctrl work
        x86/resctrl: Merge mon_capable and mon_enabled
        ...
      193e2268
    • Linus Torvalds's avatar
      Merge tag 'x86_microcode_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · b5f0b113
      Linus Torvalds authored
      Pull x75 microcode loader updates from Borislav Petkov:
      
       - Get rid of a single ksize() usage
      
       - By popular demand, print the previous microcode revision an update
         was done over
      
       - Remove more code related to the now gone MICROCODE_OLD_INTERFACE
      
       - Document the problems stemming from microcode late loading
      
      * tag 'x86_microcode_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/microcode/AMD: Track patch allocation size explicitly
        x86/microcode: Print previous version of microcode after reload
        x86/microcode: Remove ->request_microcode_user()
        x86/microcode: Document the whole late loading problem
      b5f0b113
    • Linus Torvalds's avatar
      Merge tag 'x86_paravirt_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 9bf445b6
      Linus Torvalds authored
      Pull x86 paravirt fix from Borislav Petkov:
      
       - Ensure paravirt patching site descriptors are aligned properly so
         that code can do proper arithmetic with their addresses
      
      * tag 'x86_paravirt_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/paravirt: Ensure proper alignment
      9bf445b6