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

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'bpf-misc-changes-around-af_unix'

Kuniyuki Iwashima says:

====================
bpf: Misc changes around AF_UNIX.

Patch 1 adapts sk_is_XXX() helpers in __cgroup_bpf_run_filter_sock_addr().
Patch 2 removes an unnecessary sk_fullsock() in bpf_skc_to_unix_sock().
====================

Link: https://patch.msgid.link/20260203213442.682838-1-kuniyu@google.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>

+2 -6
+1 -5
kernel/bpf/cgroup.c
··· 1680 1680 struct cgroup *cgrp; 1681 1681 int ret; 1682 1682 1683 - /* Check socket family since not all sockets represent network 1684 - * endpoint (e.g. AF_UNIX). 1685 - */ 1686 - if (sk->sk_family != AF_INET && sk->sk_family != AF_INET6 && 1687 - sk->sk_family != AF_UNIX) 1683 + if (!sk_is_inet(sk) && !sk_is_unix(sk)) 1688 1684 return 0; 1689 1685 1690 1686 if (!ctx.uaddr) {
+1 -1
net/core/filter.c
··· 12021 12021 * trigger an explicit type generation here. 12022 12022 */ 12023 12023 BTF_TYPE_EMIT(struct unix_sock); 12024 - if (sk && sk_fullsock(sk) && sk->sk_family == AF_UNIX) 12024 + if (sk && sk_is_unix(sk)) 12025 12025 return (unsigned long)sk; 12026 12026 12027 12027 return (unsigned long)NULL;