Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf

Daniel Borkmann says:

====================
pull-request: bpf 2024-07-25

We've added 14 non-merge commits during the last 8 day(s) which contain
a total of 19 files changed, 177 insertions(+), 70 deletions(-).

The main changes are:

1) Fix af_unix to disable MSG_OOB handling for sockets in BPF sockmap and
BPF sockhash. Also add test coverage for this case, from Michal Luczaj.

2) Fix a segmentation issue when downgrading gso_size in the BPF helper
bpf_skb_adjust_room(), from Fred Li.

3) Fix a compiler warning in resolve_btfids due to a missing type cast,
from Liwei Song.

4) Fix stack allocation for arm64 to align the stack pointer at a 16 byte
boundary in the fexit_sleep BPF selftest, from Puranjay Mohan.

5) Fix a xsk regression to require a flag when actuating tx_metadata_len,
from Stanislav Fomichev.

6) Fix function prototype BTF dumping in libbpf for prototypes that have
no input arguments, from Andrii Nakryiko.

7) Fix stacktrace symbol resolution in perf script for BPF programs
containing subprograms, from Hou Tao.

* tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf:
selftests/bpf: Add XDP_UMEM_TX_METADATA_LEN to XSK TX metadata test
xsk: Require XDP_UMEM_TX_METADATA_LEN to actuate tx_metadata_len
bpf: Fix a segment issue when downgrading gso_size
tools/resolve_btfids: Fix comparison of distinct pointer types warning in resolve_btfids
bpf, events: Use prog to emit ksymbol event for main program
selftests/bpf: Test sockmap redirect for AF_UNIX MSG_OOB
selftests/bpf: Parametrize AF_UNIX redir functions to accept send() flags
selftests/bpf: Support SOCK_STREAM in unix_inet_redir_to_connected()
af_unix: Disable MSG_OOB handling for sockets in sockmap/sockhash
bpftool: Fix typo in usage help
libbpf: Fix no-args func prototype BTF dumping syntax
MAINTAINERS: Update powerpc BPF JIT maintainers
MAINTAINERS: Update email address of Naveen
selftests/bpf: fexit_sleep: Fix stack allocation for arm64
====================

Link: https://patch.msgid.link/20240725114312.32197-1-daniel@iogearbox.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+176 -69
+2
.mailmap
··· 474 474 Naoya Horiguchi <nao.horiguchi@gmail.com> <n-horiguchi@ah.jp.nec.com> 475 475 Naoya Horiguchi <nao.horiguchi@gmail.com> <naoya.horiguchi@nec.com> 476 476 Nathan Chancellor <nathan@kernel.org> <natechancellor@gmail.com> 477 + Naveen N Rao <naveen@kernel.org> <naveen.n.rao@linux.ibm.com> 478 + Naveen N Rao <naveen@kernel.org> <naveen.n.rao@linux.vnet.ibm.com> 477 479 Neeraj Upadhyay <neeraj.upadhyay@kernel.org> <quic_neeraju@quicinc.com> 478 480 Neeraj Upadhyay <neeraj.upadhyay@kernel.org> <neeraju@codeaurora.org> 479 481 Neil Armstrong <neil.armstrong@linaro.org> <narmstrong@baylibre.com>
+10 -6
Documentation/networking/xsk-tx-metadata.rst
··· 11 11 General Design 12 12 ============== 13 13 14 - The headroom for the metadata is reserved via ``tx_metadata_len`` in 15 - ``struct xdp_umem_reg``. The metadata length is therefore the same for 16 - every socket that shares the same umem. The metadata layout is a fixed UAPI, 17 - refer to ``union xsk_tx_metadata`` in ``include/uapi/linux/if_xdp.h``. 18 - Thus, generally, the ``tx_metadata_len`` field above should contain 19 - ``sizeof(union xsk_tx_metadata)``. 14 + The headroom for the metadata is reserved via ``tx_metadata_len`` and 15 + ``XDP_UMEM_TX_METADATA_LEN`` flag in ``struct xdp_umem_reg``. The metadata 16 + length is therefore the same for every socket that shares the same umem. 17 + The metadata layout is a fixed UAPI, refer to ``union xsk_tx_metadata`` in 18 + ``include/uapi/linux/if_xdp.h``. Thus, generally, the ``tx_metadata_len`` 19 + field above should contain ``sizeof(union xsk_tx_metadata)``. 20 + 21 + Note that in the original implementation the ``XDP_UMEM_TX_METADATA_LEN`` 22 + flag was not required. Applications might attempt to create a umem 23 + with a flag first and if it fails, do another attempt without a flag. 20 24 21 25 The headroom and the metadata itself should be located right before 22 26 ``xdp_desc->addr`` in the umem frame. Within a frame, the metadata
+5 -3
MAINTAINERS
··· 3946 3946 F: drivers/net/ethernet/netronome/nfp/bpf/ 3947 3947 3948 3948 BPF JIT for POWERPC (32-BIT AND 64-BIT) 3949 - M: Naveen N. Rao <naveen.n.rao@linux.ibm.com> 3950 3949 M: Michael Ellerman <mpe@ellerman.id.au> 3950 + M: Hari Bathini <hbathini@linux.ibm.com> 3951 + M: Christophe Leroy <christophe.leroy@csgroup.eu> 3952 + R: Naveen N Rao <naveen@kernel.org> 3951 3953 L: bpf@vger.kernel.org 3952 3954 S: Supported 3953 3955 F: arch/powerpc/net/ ··· 12486 12484 F: scripts/Makefile.kmsan 12487 12485 12488 12486 KPROBES 12489 - M: Naveen N. Rao <naveen.n.rao@linux.ibm.com> 12487 + M: Naveen N Rao <naveen@kernel.org> 12490 12488 M: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com> 12491 12489 M: "David S. Miller" <davem@davemloft.net> 12492 12490 M: Masami Hiramatsu <mhiramat@kernel.org> ··· 12863 12861 M: Michael Ellerman <mpe@ellerman.id.au> 12864 12862 R: Nicholas Piggin <npiggin@gmail.com> 12865 12863 R: Christophe Leroy <christophe.leroy@csgroup.eu> 12866 - R: Naveen N. Rao <naveen.n.rao@linux.ibm.com> 12864 + R: Naveen N Rao <naveen@kernel.org> 12867 12865 L: linuxppc-dev@lists.ozlabs.org 12868 12866 S: Supported 12869 12867 W: https://github.com/linuxppc/wiki/wiki
+4
include/uapi/linux/if_xdp.h
··· 41 41 */ 42 42 #define XDP_UMEM_TX_SW_CSUM (1 << 1) 43 43 44 + /* Request to reserve tx_metadata_len bytes of per-chunk metadata. 45 + */ 46 + #define XDP_UMEM_TX_METADATA_LEN (1 << 2) 47 + 44 48 struct sockaddr_xdp { 45 49 __u16 sxdp_family; 46 50 __u16 sxdp_flags;
+12 -14
kernel/events/core.c
··· 9327 9327 bool unregister = type == PERF_BPF_EVENT_PROG_UNLOAD; 9328 9328 int i; 9329 9329 9330 - if (prog->aux->func_cnt == 0) { 9331 - perf_event_ksymbol(PERF_RECORD_KSYMBOL_TYPE_BPF, 9332 - (u64)(unsigned long)prog->bpf_func, 9333 - prog->jited_len, unregister, 9334 - prog->aux->ksym.name); 9335 - } else { 9336 - for (i = 0; i < prog->aux->func_cnt; i++) { 9337 - struct bpf_prog *subprog = prog->aux->func[i]; 9330 + perf_event_ksymbol(PERF_RECORD_KSYMBOL_TYPE_BPF, 9331 + (u64)(unsigned long)prog->bpf_func, 9332 + prog->jited_len, unregister, 9333 + prog->aux->ksym.name); 9338 9334 9339 - perf_event_ksymbol( 9340 - PERF_RECORD_KSYMBOL_TYPE_BPF, 9341 - (u64)(unsigned long)subprog->bpf_func, 9342 - subprog->jited_len, unregister, 9343 - subprog->aux->ksym.name); 9344 - } 9335 + for (i = 1; i < prog->aux->func_cnt; i++) { 9336 + struct bpf_prog *subprog = prog->aux->func[i]; 9337 + 9338 + perf_event_ksymbol( 9339 + PERF_RECORD_KSYMBOL_TYPE_BPF, 9340 + (u64)(unsigned long)subprog->bpf_func, 9341 + subprog->jited_len, unregister, 9342 + subprog->aux->ksym.name); 9345 9343 } 9346 9344 } 9347 9345
+11 -4
net/core/filter.c
··· 3548 3548 if (skb_is_gso(skb)) { 3549 3549 struct skb_shared_info *shinfo = skb_shinfo(skb); 3550 3550 3551 - /* Due to header grow, MSS needs to be downgraded. */ 3552 - if (!(flags & BPF_F_ADJ_ROOM_FIXED_GSO)) 3553 - skb_decrease_gso_size(shinfo, len_diff); 3554 - 3555 3551 /* Header must be checked, and gso_segs recomputed. */ 3556 3552 shinfo->gso_type |= gso_type; 3557 3553 shinfo->gso_segs = 0; 3554 + 3555 + /* Due to header growth, MSS needs to be downgraded. 3556 + * There is a BUG_ON() when segmenting the frag_list with 3557 + * head_frag true, so linearize the skb after downgrading 3558 + * the MSS. 3559 + */ 3560 + if (!(flags & BPF_F_ADJ_ROOM_FIXED_GSO)) { 3561 + skb_decrease_gso_size(shinfo, len_diff); 3562 + if (shinfo->frag_list) 3563 + return skb_linearize(skb); 3564 + } 3558 3565 } 3559 3566 3560 3567 return 0;
+40 -1
net/unix/af_unix.c
··· 2721 2721 2722 2722 static int unix_stream_read_skb(struct sock *sk, skb_read_actor_t recv_actor) 2723 2723 { 2724 + struct unix_sock *u = unix_sk(sk); 2725 + struct sk_buff *skb; 2726 + int err; 2727 + 2724 2728 if (unlikely(READ_ONCE(sk->sk_state) != TCP_ESTABLISHED)) 2725 2729 return -ENOTCONN; 2726 2730 2727 - return unix_read_skb(sk, recv_actor); 2731 + mutex_lock(&u->iolock); 2732 + skb = skb_recv_datagram(sk, MSG_DONTWAIT, &err); 2733 + mutex_unlock(&u->iolock); 2734 + if (!skb) 2735 + return err; 2736 + 2737 + #if IS_ENABLED(CONFIG_AF_UNIX_OOB) 2738 + if (unlikely(skb == READ_ONCE(u->oob_skb))) { 2739 + bool drop = false; 2740 + 2741 + unix_state_lock(sk); 2742 + 2743 + if (sock_flag(sk, SOCK_DEAD)) { 2744 + unix_state_unlock(sk); 2745 + kfree_skb(skb); 2746 + return -ECONNRESET; 2747 + } 2748 + 2749 + spin_lock(&sk->sk_receive_queue.lock); 2750 + if (likely(skb == u->oob_skb)) { 2751 + WRITE_ONCE(u->oob_skb, NULL); 2752 + drop = true; 2753 + } 2754 + spin_unlock(&sk->sk_receive_queue.lock); 2755 + 2756 + unix_state_unlock(sk); 2757 + 2758 + if (drop) { 2759 + WARN_ON_ONCE(skb_unref(skb)); 2760 + kfree_skb(skb); 2761 + return -EAGAIN; 2762 + } 2763 + } 2764 + #endif 2765 + 2766 + return recv_actor(sk, skb); 2728 2767 } 2729 2768 2730 2769 static int unix_stream_read_generic(struct unix_stream_read_state *state,
+3
net/unix/unix_bpf.c
··· 54 54 struct sk_psock *psock; 55 55 int copied; 56 56 57 + if (flags & MSG_OOB) 58 + return -EOPNOTSUPP; 59 + 57 60 if (!len) 58 61 return 0; 59 62
+6 -3
net/xdp/xdp_umem.c
··· 151 151 #define XDP_UMEM_FLAGS_VALID ( \ 152 152 XDP_UMEM_UNALIGNED_CHUNK_FLAG | \ 153 153 XDP_UMEM_TX_SW_CSUM | \ 154 + XDP_UMEM_TX_METADATA_LEN | \ 154 155 0) 155 156 156 157 static int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr) ··· 205 204 if (headroom >= chunk_size - XDP_PACKET_HEADROOM) 206 205 return -EINVAL; 207 206 208 - if (mr->tx_metadata_len >= 256 || mr->tx_metadata_len % 8) 209 - return -EINVAL; 207 + if (mr->flags & XDP_UMEM_TX_METADATA_LEN) { 208 + if (mr->tx_metadata_len >= 256 || mr->tx_metadata_len % 8) 209 + return -EINVAL; 210 + umem->tx_metadata_len = mr->tx_metadata_len; 211 + } 210 212 211 213 umem->size = size; 212 214 umem->headroom = headroom; ··· 219 215 umem->pgs = NULL; 220 216 umem->user = NULL; 221 217 umem->flags = mr->flags; 222 - umem->tx_metadata_len = mr->tx_metadata_len; 223 218 224 219 INIT_LIST_HEAD(&umem->xsk_dma_list); 225 220 refcount_set(&umem->users, 1);
+1 -1
tools/bpf/bpftool/prog.c
··· 2489 2489 " cgroup/connect_unix | cgroup/getpeername4 | cgroup/getpeername6 |\n" 2490 2490 " cgroup/getpeername_unix | cgroup/getsockname4 | cgroup/getsockname6 |\n" 2491 2491 " cgroup/getsockname_unix | cgroup/sendmsg4 | cgroup/sendmsg6 |\n" 2492 - " cgroup/sendmsg°unix | cgroup/recvmsg4 | cgroup/recvmsg6 | cgroup/recvmsg_unix |\n" 2492 + " cgroup/sendmsg_unix | cgroup/recvmsg4 | cgroup/recvmsg6 | cgroup/recvmsg_unix |\n" 2493 2493 " cgroup/getsockopt | cgroup/setsockopt | cgroup/sock_release |\n" 2494 2494 " struct_ops | fentry | fexit | freplace | sk_lookup }\n" 2495 2495 " ATTACH_TYPE := { sk_msg_verdict | sk_skb_verdict | sk_skb_stream_verdict |\n"
+1 -1
tools/bpf/resolve_btfids/main.c
··· 704 704 * Make sure id is at the beginning of the pairs 705 705 * struct, otherwise the below qsort would not work. 706 706 */ 707 - BUILD_BUG_ON(set8->pairs != &set8->pairs[0].id); 707 + BUILD_BUG_ON((u32 *)set8->pairs != &set8->pairs[0].id); 708 708 qsort(set8->pairs, set8->cnt, sizeof(set8->pairs[0]), cmp_id); 709 709 710 710 /*
+4
tools/include/uapi/linux/if_xdp.h
··· 41 41 */ 42 42 #define XDP_UMEM_TX_SW_CSUM (1 << 1) 43 43 44 + /* Request to reserve tx_metadata_len bytes of per-chunk metadata. 45 + */ 46 + #define XDP_UMEM_TX_METADATA_LEN (1 << 2) 47 + 44 48 struct sockaddr_xdp { 45 49 __u16 sxdp_family; 46 50 __u16 sxdp_flags;
+5 -3
tools/lib/bpf/btf_dump.c
··· 1559 1559 * Clang for BPF target generates func_proto with no 1560 1560 * args as a func_proto with a single void arg (e.g., 1561 1561 * `int (*f)(void)` vs just `int (*f)()`). We are 1562 - * going to pretend there are no args for such case. 1562 + * going to emit valid empty args (void) syntax for 1563 + * such case. Similarly and conveniently, valid 1564 + * no args case can be special-cased here as well. 1563 1565 */ 1564 - if (vlen == 1 && p->type == 0) { 1565 - btf_dump_printf(d, ")"); 1566 + if (vlen == 0 || (vlen == 1 && p->type == 0)) { 1567 + btf_dump_printf(d, "void)"); 1566 1568 return; 1567 1569 } 1568 1570
-1
tools/testing/selftests/bpf/DENYLIST.aarch64
··· 1 1 bpf_cookie/multi_kprobe_attach_api # kprobe_multi_link_api_subtest:FAIL:fentry_raw_skel_load unexpected error: -3 2 2 bpf_cookie/multi_kprobe_link_api # kprobe_multi_link_api_subtest:FAIL:fentry_raw_skel_load unexpected error: -3 3 - fexit_sleep # The test never returns. The remaining tests cannot start. 4 3 kprobe_multi_bench_attach # needs CONFIG_FPROBE 5 4 kprobe_multi_test # needs CONFIG_FPROBE 6 5 module_attach # prog 'kprobe_multi': failed to auto-attach: -95
+7 -1
tools/testing/selftests/bpf/prog_tests/fexit_sleep.c
··· 21 21 } 22 22 23 23 #define STACK_SIZE (1024 * 1024) 24 - static char child_stack[STACK_SIZE]; 25 24 26 25 void test_fexit_sleep(void) 27 26 { 28 27 struct fexit_sleep_lskel *fexit_skel = NULL; 29 28 int wstatus, duration = 0; 30 29 pid_t cpid; 30 + char *child_stack = NULL; 31 31 int err, fexit_cnt; 32 32 33 33 fexit_skel = fexit_sleep_lskel__open_and_load(); ··· 36 36 37 37 err = fexit_sleep_lskel__attach(fexit_skel); 38 38 if (CHECK(err, "fexit_attach", "fexit attach failed: %d\n", err)) 39 + goto cleanup; 40 + 41 + child_stack = mmap(NULL, STACK_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | 42 + MAP_ANONYMOUS | MAP_STACK, -1, 0); 43 + if (!ASSERT_NEQ(child_stack, MAP_FAILED, "mmap")) 39 44 goto cleanup; 40 45 41 46 cpid = clone(do_sleep, child_stack + STACK_SIZE, CLONE_FILES | SIGCHLD, fexit_skel); ··· 83 78 goto cleanup; 84 79 85 80 cleanup: 81 + munmap(child_stack, STACK_SIZE); 86 82 fexit_sleep_lskel__destroy(fexit_skel); 87 83 }
+59 -26
tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
··· 29 29 30 30 #include "sockmap_helpers.h" 31 31 32 + #define NO_FLAGS 0 33 + 32 34 static void test_insert_invalid(struct test_sockmap_listen *skel __always_unused, 33 35 int family, int sotype, int mapfd) 34 36 { ··· 1378 1376 1379 1377 static void pairs_redir_to_connected(int cli0, int peer0, int cli1, int peer1, 1380 1378 int sock_mapfd, int nop_mapfd, 1381 - int verd_mapfd, enum redir_mode mode) 1379 + int verd_mapfd, enum redir_mode mode, 1380 + int send_flags) 1382 1381 { 1383 1382 const char *log_prefix = redir_mode_str(mode); 1384 1383 unsigned int pass; ··· 1399 1396 return; 1400 1397 } 1401 1398 1402 - n = write(cli1, "a", 1); 1403 - if (n < 0) 1404 - FAIL_ERRNO("%s: write", log_prefix); 1405 - if (n == 0) 1406 - FAIL("%s: incomplete write", log_prefix); 1407 - if (n < 1) 1399 + /* Last byte is OOB data when send_flags has MSG_OOB bit set */ 1400 + n = xsend(cli1, "ab", 2, send_flags); 1401 + if (n >= 0 && n < 2) 1402 + FAIL("%s: incomplete send", log_prefix); 1403 + if (n < 2) 1408 1404 return; 1409 1405 1410 1406 key = SK_PASS; ··· 1418 1416 FAIL_ERRNO("%s: recv_timeout", log_prefix); 1419 1417 if (n == 0) 1420 1418 FAIL("%s: incomplete recv", log_prefix); 1419 + 1420 + if (send_flags & MSG_OOB) { 1421 + /* Check that we can't read OOB while in sockmap */ 1422 + errno = 0; 1423 + n = recv(peer1, &b, 1, MSG_OOB | MSG_DONTWAIT); 1424 + if (n != -1 || errno != EOPNOTSUPP) 1425 + FAIL("%s: recv(MSG_OOB): expected EOPNOTSUPP: retval=%d errno=%d", 1426 + log_prefix, n, errno); 1427 + 1428 + /* Remove peer1 from sockmap */ 1429 + xbpf_map_delete_elem(sock_mapfd, &(int){ 1 }); 1430 + 1431 + /* Check that OOB was dropped on redirect */ 1432 + errno = 0; 1433 + n = recv(peer1, &b, 1, MSG_OOB | MSG_DONTWAIT); 1434 + if (n != -1 || errno != EINVAL) 1435 + FAIL("%s: recv(MSG_OOB): expected EINVAL: retval=%d errno=%d", 1436 + log_prefix, n, errno); 1437 + } 1421 1438 } 1422 1439 1423 1440 static void unix_redir_to_connected(int sotype, int sock_mapfd, ··· 1453 1432 goto close0; 1454 1433 c1 = sfd[0], p1 = sfd[1]; 1455 1434 1456 - pairs_redir_to_connected(c0, p0, c1, p1, sock_mapfd, -1, verd_mapfd, mode); 1435 + pairs_redir_to_connected(c0, p0, c1, p1, sock_mapfd, -1, verd_mapfd, 1436 + mode, NO_FLAGS); 1457 1437 1458 1438 xclose(c1); 1459 1439 xclose(p1); ··· 1744 1722 if (err) 1745 1723 goto close_cli0; 1746 1724 1747 - pairs_redir_to_connected(c0, p0, c1, p1, sock_mapfd, -1, verd_mapfd, mode); 1725 + pairs_redir_to_connected(c0, p0, c1, p1, sock_mapfd, -1, verd_mapfd, 1726 + mode, NO_FLAGS); 1748 1727 1749 1728 xclose(c1); 1750 1729 xclose(p1); ··· 1803 1780 if (err) 1804 1781 goto close; 1805 1782 1806 - pairs_redir_to_connected(c0, p0, c1, p1, sock_mapfd, -1, verd_mapfd, mode); 1783 + pairs_redir_to_connected(c0, p0, c1, p1, sock_mapfd, -1, verd_mapfd, 1784 + mode, NO_FLAGS); 1807 1785 1808 1786 xclose(c1); 1809 1787 xclose(p1); ··· 1839 1815 xbpf_prog_detach2(verdict, sock_map, BPF_SK_SKB_VERDICT); 1840 1816 } 1841 1817 1842 - static void unix_inet_redir_to_connected(int family, int type, 1843 - int sock_mapfd, int nop_mapfd, 1844 - int verd_mapfd, 1845 - enum redir_mode mode) 1818 + static void unix_inet_redir_to_connected(int family, int type, int sock_mapfd, 1819 + int nop_mapfd, int verd_mapfd, 1820 + enum redir_mode mode, int send_flags) 1846 1821 { 1847 1822 int c0, c1, p0, p1; 1848 1823 int sfd[2]; ··· 1851 1828 if (err) 1852 1829 return; 1853 1830 1854 - if (socketpair(AF_UNIX, SOCK_DGRAM | SOCK_NONBLOCK, 0, sfd)) 1831 + if (socketpair(AF_UNIX, type | SOCK_NONBLOCK, 0, sfd)) 1855 1832 goto close_cli0; 1856 1833 c1 = sfd[0], p1 = sfd[1]; 1857 1834 1858 - pairs_redir_to_connected(c0, p0, c1, p1, 1859 - sock_mapfd, nop_mapfd, verd_mapfd, mode); 1835 + pairs_redir_to_connected(c0, p0, c1, p1, sock_mapfd, nop_mapfd, 1836 + verd_mapfd, mode, send_flags); 1860 1837 1861 1838 xclose(c1); 1862 1839 xclose(p1); 1863 1840 close_cli0: 1864 1841 xclose(c0); 1865 1842 xclose(p0); 1866 - 1867 1843 } 1868 1844 1869 1845 static void unix_inet_skb_redir_to_connected(struct test_sockmap_listen *skel, ··· 1881 1859 skel->bss->test_ingress = false; 1882 1860 unix_inet_redir_to_connected(family, SOCK_DGRAM, 1883 1861 sock_map, -1, verdict_map, 1884 - REDIR_EGRESS); 1862 + REDIR_EGRESS, NO_FLAGS); 1885 1863 unix_inet_redir_to_connected(family, SOCK_DGRAM, 1886 1864 sock_map, -1, verdict_map, 1887 - REDIR_EGRESS); 1865 + REDIR_EGRESS, NO_FLAGS); 1888 1866 1889 1867 unix_inet_redir_to_connected(family, SOCK_DGRAM, 1890 1868 sock_map, nop_map, verdict_map, 1891 - REDIR_EGRESS); 1869 + REDIR_EGRESS, NO_FLAGS); 1892 1870 unix_inet_redir_to_connected(family, SOCK_STREAM, 1893 1871 sock_map, nop_map, verdict_map, 1894 - REDIR_EGRESS); 1872 + REDIR_EGRESS, NO_FLAGS); 1873 + 1874 + /* MSG_OOB not supported by AF_UNIX SOCK_DGRAM */ 1875 + unix_inet_redir_to_connected(family, SOCK_STREAM, 1876 + sock_map, nop_map, verdict_map, 1877 + REDIR_EGRESS, MSG_OOB); 1878 + 1895 1879 skel->bss->test_ingress = true; 1896 1880 unix_inet_redir_to_connected(family, SOCK_DGRAM, 1897 1881 sock_map, -1, verdict_map, 1898 - REDIR_INGRESS); 1882 + REDIR_INGRESS, NO_FLAGS); 1899 1883 unix_inet_redir_to_connected(family, SOCK_STREAM, 1900 1884 sock_map, -1, verdict_map, 1901 - REDIR_INGRESS); 1885 + REDIR_INGRESS, NO_FLAGS); 1902 1886 1903 1887 unix_inet_redir_to_connected(family, SOCK_DGRAM, 1904 1888 sock_map, nop_map, verdict_map, 1905 - REDIR_INGRESS); 1889 + REDIR_INGRESS, NO_FLAGS); 1906 1890 unix_inet_redir_to_connected(family, SOCK_STREAM, 1907 1891 sock_map, nop_map, verdict_map, 1908 - REDIR_INGRESS); 1892 + REDIR_INGRESS, NO_FLAGS); 1893 + 1894 + /* MSG_OOB not supported by AF_UNIX SOCK_DGRAM */ 1895 + unix_inet_redir_to_connected(family, SOCK_STREAM, 1896 + sock_map, nop_map, verdict_map, 1897 + REDIR_INGRESS, MSG_OOB); 1909 1898 1910 1899 xbpf_prog_detach2(verdict, sock_map, BPF_SK_SKB_VERDICT); 1911 1900 }
+2 -1
tools/testing/selftests/bpf/prog_tests/xdp_metadata.c
··· 68 68 .fill_size = XSK_RING_PROD__DEFAULT_NUM_DESCS, 69 69 .comp_size = XSK_RING_CONS__DEFAULT_NUM_DESCS, 70 70 .frame_size = XSK_UMEM__DEFAULT_FRAME_SIZE, 71 - .flags = XDP_UMEM_UNALIGNED_CHUNK_FLAG | XDP_UMEM_TX_SW_CSUM, 71 + .flags = XDP_UMEM_UNALIGNED_CHUNK_FLAG | XDP_UMEM_TX_SW_CSUM | 72 + XDP_UMEM_TX_METADATA_LEN, 72 73 .tx_metadata_len = sizeof(struct xsk_tx_metadata), 73 74 }; 74 75 __u32 idx;
+2 -2
tools/testing/selftests/bpf/progs/btf_dump_test_case_multidim.c
··· 14 14 15 15 typedef int *ptr_multiarr_t[7][8][9][10]; 16 16 17 - typedef int * (*fn_ptr_arr_t[11])(); 17 + typedef int * (*fn_ptr_arr_t[11])(void); 18 18 19 - typedef int * (*fn_ptr_multiarr_t[12][13])(); 19 + typedef int * (*fn_ptr_multiarr_t[12][13])(void); 20 20 21 21 struct root_struct { 22 22 arr_t _1;
+2 -2
tools/testing/selftests/bpf/progs/btf_dump_test_case_syntax.c
··· 100 100 * `int -> char *` function and returns pointer to a char. Equivalent: 101 101 * typedef char * (*fn_input_t)(int); 102 102 * typedef char * (*fn_output_outer_t)(fn_input_t); 103 - * typedef const fn_output_outer_t (* fn_output_inner_t)(); 103 + * typedef const fn_output_outer_t (* fn_output_inner_t)(void); 104 104 * typedef const fn_output_inner_t fn_ptr_arr2_t[5]; 105 105 */ 106 106 /* ----- START-EXPECTED-OUTPUT ----- */ ··· 127 127 128 128 typedef char * (*fn_ptr_arr1_t[10])(int **); 129 129 130 - typedef char * (* (* const fn_ptr_arr2_t[5])())(char * (*)(int)); 130 + typedef char * (* (* const fn_ptr_arr2_t[5])(void))(char * (*)(int)); 131 131 132 132 struct struct_w_typedefs { 133 133 int_t a;