From nobody Mon Jan 26 00:20:21 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C28D639E6D5; Tue, 20 Jan 2026 14:10:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768918244; cv=none; b=bmiKENZ+csedBIR54RWw5frnTqJ9zSifYSbcwYnMkrFyVXxJy6avqf7zurp2Y8YSBIshrLvXbOQiK8IVR/RRA9ZZOV8gENq6hVoS/Qzt0gWWJ5I9HJ4tG3bCIxhUDXP0wprNwojtc6c3HpWyrinrjEHI+ZC7JpKUjKZmo+Okv4o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768918244; c=relaxed/simple; bh=ZqrmLjkMijbcJc3IQS7wKin/D1t2uoZP1sLY/xgFZdI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eZxjNdWciwL0ICfC+c9uVm9YtOliNhr6j/KywUV2g8pQM+FOqdKmSyZdHDNJSoqR3mOFV3XnMNdZz32/TD3uw11kUv0pSCrSSCEQXU+cPqxop5msJfcCda2hJFuMS73rEcsAfjj+3zVAG915RH2vNMcvGzOYKIFeT7/WjHa9460= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=rtlQ7SdG; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=QDVif8ks; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="rtlQ7SdG"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="QDVif8ks" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1768918239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qWWbJ6p/llOOq5uee8jczRuLvKm3RcJ6H6cwpERIvT8=; b=rtlQ7SdGTkp2BTbujdjmEMG4e8L4Y54KOJneDOwznalZgT0PCYNs3Y7xdC4GP1s42jFqvs OYVawGSSlmqmXaIvnte9k+7J1aO6Qc47KMMsNqYUKbHgxQy4q1vr/1B+opOMeHb13i+/Cf 57oGOwhSZP2sR5+qi6Hgy2dsGiAEvuERgBSDCO7W+Ar0fGc6BNFyE+ouDiRNAx5LGInA8U jBl9fC39QCqOOM2R8VcWrmIjz0j+XlXhpttFqtZXNU47Dvj7WLfTsYSpjvZpCml4rWwxE7 CTwlIaeVPVDGIfl05o6I1wzXGuzcXRh19tkbc4sQ4pL5yeFeZXsY8dbo0dJTAA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1768918239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qWWbJ6p/llOOq5uee8jczRuLvKm3RcJ6H6cwpERIvT8=; b=QDVif8kseiztc2+rY9NVDDg7G+ZgDVwdgyTTLRKXpOMyi8AOJaTvACt3+qnfEDXcNeaEU6 k8z+R2493jKfd/CQ== Date: Tue, 20 Jan 2026 15:10:31 +0100 Subject: [PATCH net-next v2 1/4] selftests: net: Move some UAPI header inclusions after libc ones Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260120-uapi-sockaddr-v2-1-63c319111cf6@linutronix.de> References: <20260120-uapi-sockaddr-v2-0-63c319111cf6@linutronix.de> In-Reply-To: <20260120-uapi-sockaddr-v2-0-63c319111cf6@linutronix.de> To: Eric Dumazet , Kuniyuki Iwashima , Paolo Abeni , Willem de Bruijn , "David S. Miller" , Jakub Kicinski , Simon Horman , Shuah Khan , Matthieu Baerts , Mat Martineau , Geliang Tang , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnther_Noack?= , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Stanislav Fomichev , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Hao Luo , Jiri Olsa Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , linux-kselftest@vger.kernel.org, mptcp@lists.linux.dev, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, libc-alpha@sourceware.org, Carlos O'Donell , Adhemerval Zanella , Rich Felker , klibc@zytor.com, Florian Weimer , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1768918237; l=6177; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=ZqrmLjkMijbcJc3IQS7wKin/D1t2uoZP1sLY/xgFZdI=; b=ckR5DvB2GszhHGd1qq5KB7GFMoHcqBtMFjspRoVG+3U1BvA4ONTzZ+DkdODqiPl1YQjsYLnrJ xEOvtkyVbdVB683EKZ0pv2XTMRcvDWNfqC1o0UKdWbg5B2QzJsgEYxc X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Interleaving inclusions of UAPI headers and libc headers is problematic. Both sets of headers define conflicting symbols. To enable their coexistence a compatibility-mechanism is in place. An upcoming change will define 'struct sockaddr' from linux/socket.h. However sys/socket.h from libc does not yet handle this case and a symbol conflict will arise. Furthermore libc-compat.h evaluates the state of the libc inclusions only once, at the point it is included first. If another problematic header from libc is included later, symbol conflicts arise. This will trigger other duplicate definitions when linux/libc-compat.h is added to linux/socket.h Move the inclusion of UAPI headers after the inclusion of the glibc ones, so the libc-compat.h continues to work correctly. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/testing/selftests/net/af_unix/diag_uid.c | 9 +++++---- tools/testing/selftests/net/busy_poller.c | 3 ++- tools/testing/selftests/net/mptcp/mptcp_diag.c | 11 ++++++----- tools/testing/selftests/net/nettest.c | 4 ++-- tools/testing/selftests/net/tcp_ao/icmps-discard.c | 6 +++--- tools/testing/selftests/net/tcp_ao/lib/netlink.c | 9 +++++---- tools/testing/selftests/net/tun.c | 5 +++-- 7 files changed, 26 insertions(+), 21 deletions(-) diff --git a/tools/testing/selftests/net/af_unix/diag_uid.c b/tools/testing= /selftests/net/af_unix/diag_uid.c index da7d50cedee6..05456a205325 100644 --- a/tools/testing/selftests/net/af_unix/diag_uid.c +++ b/tools/testing/selftests/net/af_unix/diag_uid.c @@ -5,15 +5,16 @@ #include =20 #include -#include -#include -#include -#include #include #include #include #include =20 +#include +#include +#include +#include + #include "kselftest_harness.h" =20 FIXTURE(diag_uid) diff --git a/tools/testing/selftests/net/busy_poller.c b/tools/testing/self= tests/net/busy_poller.c index 3a81f9c94795..34bd8d28808a 100644 --- a/tools/testing/selftests/net/busy_poller.c +++ b/tools/testing/selftests/net/busy_poller.c @@ -9,7 +9,6 @@ #include #include #include -#include =20 #include #include @@ -19,6 +18,8 @@ #include #include =20 +#include + #include #include =20 diff --git a/tools/testing/selftests/net/mptcp/mptcp_diag.c b/tools/testing= /selftests/net/mptcp/mptcp_diag.c index 8e0b1b8d84b6..af25ebfd2915 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_diag.c +++ b/tools/testing/selftests/net/mptcp/mptcp_diag.c @@ -1,11 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2025, Kylin Software */ =20 -#include -#include -#include -#include -#include #include #include #include @@ -17,6 +12,12 @@ #include #include =20 +#include +#include +#include +#include +#include + #ifndef IPPROTO_MPTCP #define IPPROTO_MPTCP 262 #endif diff --git a/tools/testing/selftests/net/nettest.c b/tools/testing/selftest= s/net/nettest.c index 1f5227f3d64d..71430403b50b 100644 --- a/tools/testing/selftests/net/nettest.c +++ b/tools/testing/selftests/net/nettest.c @@ -10,8 +10,6 @@ #include #include #include -#include -#include #include #include #include @@ -30,6 +28,8 @@ #include #include =20 +#include +#include #include #include #include diff --git a/tools/testing/selftests/net/tcp_ao/icmps-discard.c b/tools/tes= ting/selftests/net/tcp_ao/icmps-discard.c index 85c1a1e958c6..451ba89914c9 100644 --- a/tools/testing/selftests/net/tcp_ao/icmps-discard.c +++ b/tools/testing/selftests/net/tcp_ao/icmps-discard.c @@ -16,12 +16,12 @@ * Author: Dmitry Safonov */ #include -#include -#include -#include #include #include #include +#include +#include +#include #include "aolib.h" #include "../../../../include/linux/compiler.h" =20 diff --git a/tools/testing/selftests/net/tcp_ao/lib/netlink.c b/tools/testi= ng/selftests/net/tcp_ao/lib/netlink.c index 7f108493a29a..69a05820782a 100644 --- a/tools/testing/selftests/net/tcp_ao/lib/netlink.c +++ b/tools/testing/selftests/net/tcp_ao/lib/netlink.c @@ -1,14 +1,15 @@ // SPDX-License-Identifier: GPL-2.0 /* Original from tools/testing/selftests/net/ipsec.c */ -#include -#include -#include -#include #include #include #include #include =20 +#include +#include +#include +#include + #include "aolib.h" =20 #define MAX_PAYLOAD 2048 diff --git a/tools/testing/selftests/net/tun.c b/tools/testing/selftests/ne= t/tun.c index 0efc67b0357a..e6e4c52d538e 100644 --- a/tools/testing/selftests/net/tun.c +++ b/tools/testing/selftests/net/tun.c @@ -8,12 +8,13 @@ #include #include #include +#include +#include + #include #include #include #include -#include -#include =20 #include "kselftest_harness.h" =20 --=20 2.52.0 From nobody Mon Jan 26 00:20:21 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB61A43CEF2; Tue, 20 Jan 2026 14:10:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768918243; cv=none; b=TwZdg5gcWZ7dmZvb9PQNzX2vcouiifr4vCavuky4rhG/E4tk7KcZWvV4LFnKYt1Vxfanw2D0zzg4p2SgXdAhELI3PpK1r3PVpXXII1edgG+SlXPFe0CcA7PmW0gkTmvC8A1z/c8jzrrTBFqKjzvx3GIA4dxV26T4EwPi+W3XO7k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768918243; c=relaxed/simple; bh=gEyQT5Kcy9TJYGJ474UFnWhLZFO3ndb9iMUj0fZR+P0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Xlt2yczCWbi91g8iT29njGEPyo2FNqNPFSFKNrhC/pKOkfiruxxw7/llfwrznt7K8MFrBOv39vvjE1QOoCKOs5RkU8QuTtZrhXa8LaB98uBrYTwtk4B1XpbBWpySERhV/ic5WZpr6Ua3R9pfaZ3i30pJYs2Of6HrYuD1UIF6PFY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=o65XwdB9; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=DQr8iziB; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="o65XwdB9"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="DQr8iziB" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1768918240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aaabGWtTucbZ8WjnJZ8jyHDns+gX0JvT/KU/uRiSp04=; b=o65XwdB9ZsuKO6X8SlMdGBWHV1er2KvM1zGyZ933WAAci29EnYDG1WDWVuH2jNRH32Re9T KU74HSp6R5wpyg1u4QNPRA360B9F54yXRotiEf1W3r4yzwU3CwNbKeqmMXMp7K1f4cA9nJ ov4BZJnvK7MDcS3MHbeXfOrxU4eCVtcbEl0Olz2lb18frkcnpYrMO2SJBSIRJYy0Y6YWAM b0obIzZN7nNA5d/rZU51OlzogHwEBhLFTujSrJtpPjxDsoG2W+mfwNd/hAnJYot6m+LHZP q43a/2ZcMgfVIvWeqP5T1YzGh4MvoTDOWOUwL4FsrOSgv/10CAOUAE6Rd1E2Mw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1768918240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aaabGWtTucbZ8WjnJZ8jyHDns+gX0JvT/KU/uRiSp04=; b=DQr8iziBzPVx6w6Qd1ifMB+zNRKVJIcikpI/fhVtclnM2b47YnrFGAlzPBgRY/hbavkmlV 94DIdcN9Fc7i0vAg== Date: Tue, 20 Jan 2026 15:10:32 +0100 Subject: [PATCH net-next v2 2/4] selftests/landlock: Move some UAPI header inclusions after libc ones Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260120-uapi-sockaddr-v2-2-63c319111cf6@linutronix.de> References: <20260120-uapi-sockaddr-v2-0-63c319111cf6@linutronix.de> In-Reply-To: <20260120-uapi-sockaddr-v2-0-63c319111cf6@linutronix.de> To: Eric Dumazet , Kuniyuki Iwashima , Paolo Abeni , Willem de Bruijn , "David S. Miller" , Jakub Kicinski , Simon Horman , Shuah Khan , Matthieu Baerts , Mat Martineau , Geliang Tang , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnther_Noack?= , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Stanislav Fomichev , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Hao Luo , Jiri Olsa Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , linux-kselftest@vger.kernel.org, mptcp@lists.linux.dev, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, libc-alpha@sourceware.org, Carlos O'Donell , Adhemerval Zanella , Rich Felker , klibc@zytor.com, Florian Weimer , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1768918237; l=1356; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=gEyQT5Kcy9TJYGJ474UFnWhLZFO3ndb9iMUj0fZR+P0=; b=vsXslEDMsuoiJY6VjPUQt3pMJ6PFOs4k30AXxu/bclwWz3MLbiSvMXmg37uv3pUcdncGpAGpm KLXGLl8k+XFDkstK9st5ouee/sbd/CM4+SAhGjnjJrFeZfhsM418+zy X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Interleaving inclusions of UAPI headers and libc headers is problematic. Both sets of headers define conflicting symbols. To enable their coexistence a compatibility-mechanism is in place. An upcoming change will define 'struct sockaddr' from linux/socket.h. However sys/socket.h from libc does not yet handle this case and a symbol conflict will arise. Move the inclusion of all UAPI headers after the inclusion of the glibc ones, so the compatibility mechanism from the UAPI headers is used. Signed-off-by: Thomas Wei=C3=9Fschuh Reviewed-by: Micka=C3=ABl Sala=C3=BCn --- tools/testing/selftests/landlock/audit.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/landlock/audit.h b/tools/testing/selft= ests/landlock/audit.h index 44eb433e9666..c12b16c690dc 100644 --- a/tools/testing/selftests/landlock/audit.h +++ b/tools/testing/selftests/landlock/audit.h @@ -7,9 +7,6 @@ =20 #define _GNU_SOURCE #include -#include -#include -#include #include #include #include @@ -20,6 +17,10 @@ #include #include =20 +#include +#include +#include + #include "kselftest.h" =20 #ifndef ARRAY_SIZE --=20 2.52.0 From nobody Mon Jan 26 00:20:21 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7AA82500940; Tue, 20 Jan 2026 14:10:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768918244; cv=none; b=FdvIoOgpHbdp57WsOJXCO//4rFWALMecvrYmpUj/GyVr3HBqMfwVSgpQ8wMcsBncuWqn490LLXIxa4t2kFvrQwY+VRMNg6YjprL+HF4ZDooG14hAD9x/Jgg7D+uQR8Gjw8APQE1tqUlxtQpNpBEU6IQV9qeJzDv8aD3edjSJQ8s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768918244; c=relaxed/simple; bh=NL2NiPJiVOXGlDSPX/IXGVFv3gZqRodtnl63WyHlrT8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Xrm++7RxC0Em3RiWpH6rlu+9a9eX8ihfykwiaKmuG77ONR1fI4CZoZyVJYKqKlH7gtI5TWw6pNUQBOks4I+JgKkCWeuDKJykLXHp8KH7VAWvCi+zXDY0MQcAC8gYEnWR0+qD1d1K8VLzaRxkM4c/cVeAryGrsrgZQ1CJVz9SCYk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=QVf5JIqw; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=RJuRitW1; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="QVf5JIqw"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="RJuRitW1" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1768918240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Nu42fbo/KTwWbTEJNSfohypBk88voIUWzFlL0jg8Asc=; b=QVf5JIqwol6mD0wSHtGINS/EN7+SG1TaEysglbq9pi9jkITL/Re6B8r9X9x+lyNMsRqpr+ 8XrMkTgdTEMUkLM7sG25qiqfsjXPXILaLxUPkLqs52GkMbuftElrt8h5Drpp8hcFEbZXPG /l0Ip8WnVMNiGYJW7keA34hVfcfLNEU/+kvuEEhZY8PIGxociJ7gyB7cQDJUbrn9MoK+LX uLuDbu849BBC73+/qR2YZyQtxWhx1C1CbOcSbukm0RFVtcDlZ2SDYlZ0kbhUQhjE+B1rEJ +8UInYr5n8/ESscYa9Cd16etJGdVkxKTNhXenTkKtKmmdrQWx9ps+uluO9a0gw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1768918240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Nu42fbo/KTwWbTEJNSfohypBk88voIUWzFlL0jg8Asc=; b=RJuRitW17NsGCwZrxdyALTxa2Sop4NEm7M4/2D1lY0J5eoYWa1sEGUUHeaCOAJEb0w0nD3 s37/9rX4lucFajCQ== Date: Tue, 20 Jan 2026 15:10:33 +0100 Subject: [PATCH net-next v2 3/4] samples/bpf: Move some UAPI header inclusions after libc ones Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260120-uapi-sockaddr-v2-3-63c319111cf6@linutronix.de> References: <20260120-uapi-sockaddr-v2-0-63c319111cf6@linutronix.de> In-Reply-To: <20260120-uapi-sockaddr-v2-0-63c319111cf6@linutronix.de> To: Eric Dumazet , Kuniyuki Iwashima , Paolo Abeni , Willem de Bruijn , "David S. Miller" , Jakub Kicinski , Simon Horman , Shuah Khan , Matthieu Baerts , Mat Martineau , Geliang Tang , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnther_Noack?= , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Stanislav Fomichev , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Hao Luo , Jiri Olsa Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , linux-kselftest@vger.kernel.org, mptcp@lists.linux.dev, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, libc-alpha@sourceware.org, Carlos O'Donell , Adhemerval Zanella , Rich Felker , klibc@zytor.com, Florian Weimer , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1768918237; l=4542; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=NL2NiPJiVOXGlDSPX/IXGVFv3gZqRodtnl63WyHlrT8=; b=eZBfbm8KV848zvW+Ku4Kfcq+zHdcVueYyOFWcMEHikDcFpOV2a627C4aKg6x8k5ZhHbg+N5yr +2ISIHCy3/1CwGRF/P2J+p4PIl3ac4MZGzF0g/1GdroJVysJyzTzpnF X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Interleaving inclusions of UAPI headers and libc headers is problematic. Both sets of headers define conflicting symbols. To enable their coexistence a compatibility-mechanism is in place. An upcoming change will define 'struct sockaddr' from linux/socket.h. However sys/socket.h from libc does not yet handle this case and a symbol conflict will arise. Move the inclusion of all UAPI headers after the inclusion of the glibc ones, so the compatibility mechanism from the UAPI headers is used. Signed-off-by: Thomas Wei=C3=9Fschuh --- samples/bpf/xdp_adjust_tail_user.c | 6 ++++-- samples/bpf/xdp_fwd_user.c | 7 ++++--- samples/bpf/xdp_router_ipv4_user.c | 6 +++--- samples/bpf/xdp_sample_user.c | 15 ++++++++------- samples/bpf/xdp_tx_iptunnel_user.c | 4 ++-- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/samples/bpf/xdp_adjust_tail_user.c b/samples/bpf/xdp_adjust_ta= il_user.c index e9426bd65420..32d00405debc 100644 --- a/samples/bpf/xdp_adjust_tail_user.c +++ b/samples/bpf/xdp_adjust_tail_user.c @@ -5,8 +5,6 @@ * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. */ -#include -#include #include #include #include @@ -18,9 +16,13 @@ #include #include #include + #include #include =20 +#include +#include + #define STATS_INTERVAL_S 2U #define MAX_PCKT_SIZE 600 =20 diff --git a/samples/bpf/xdp_fwd_user.c b/samples/bpf/xdp_fwd_user.c index 193b3b79b31f..ca55f3eac12a 100644 --- a/samples/bpf/xdp_fwd_user.c +++ b/samples/bpf/xdp_fwd_user.c @@ -11,9 +11,6 @@ * General Public License for more details. */ =20 -#include -#include -#include #include #include #include @@ -27,6 +24,10 @@ #include #include =20 +#include +#include +#include + static __u32 xdp_flags =3D XDP_FLAGS_UPDATE_IF_NOEXIST; =20 static int do_attach(int idx, int prog_fd, int map_fd, const char *name) diff --git a/samples/bpf/xdp_router_ipv4_user.c b/samples/bpf/xdp_router_ip= v4_user.c index 266fdd0b025d..2abc7d294251 100644 --- a/samples/bpf/xdp_router_ipv4_user.c +++ b/samples/bpf/xdp_router_ipv4_user.c @@ -1,9 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* Copyright (C) 2017 Cavium, Inc. */ -#include -#include -#include #include #include #include @@ -25,6 +22,9 @@ #include #include #include +#include +#include +#include #include "xdp_sample_user.h" #include "xdp_router_ipv4.skel.h" =20 diff --git a/samples/bpf/xdp_sample_user.c b/samples/bpf/xdp_sample_user.c index 158682852162..d9aec2bd372c 100644 --- a/samples/bpf/xdp_sample_user.c +++ b/samples/bpf/xdp_sample_user.c @@ -7,13 +7,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include #include #include #include @@ -32,6 +25,14 @@ #include #include =20 +#include +#include +#include +#include +#include +#include +#include + #include "bpf_util.h" #include "xdp_sample_user.h" =20 diff --git a/samples/bpf/xdp_tx_iptunnel_user.c b/samples/bpf/xdp_tx_iptunn= el_user.c index 7e4b2f7108a6..e9503036d0a0 100644 --- a/samples/bpf/xdp_tx_iptunnel_user.c +++ b/samples/bpf/xdp_tx_iptunnel_user.c @@ -1,8 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* Copyright (c) 2016 Facebook */ -#include -#include #include #include #include @@ -16,6 +14,8 @@ #include #include #include +#include +#include #include "bpf_util.h" #include "xdp_tx_iptunnel_common.h" =20 --=20 2.52.0 From nobody Mon Jan 26 00:20:21 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 171D8429819; Tue, 20 Jan 2026 14:10:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768918245; cv=none; b=VgzZbo8ARduLlw5NZ5ICCSvVg97RGr/F4Sr62xejXwkDjNJSR7wd90HeliI01ciTv+G1e3IoEyf2+c4p3LuZPOyIyN62xYt21QsJbi3DvBIF9df9kmGqaSvU9ubB1LWJpQ4dtTEsk/BQ2KUadRCdHQvEi/wgsRpUpMhZLIDNwAs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768918245; c=relaxed/simple; bh=0gJHssghFK1RP90RiI7zuAI2Lb2IlxOeNNJyTLHYHUk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WGBiEV3OXarkvN6MidWjt3Vgs7Qn6PInulQ5i5Uk6cyUwpZ2y6smBBPcwjRk23kY9i1590+AcrRMOHpq+t4ZShDqQMZhnICfdVP0wz87+aHyCzhnZqlVexAexP5zBherAEFiz9DJc75k9HDinxSwYX/oWt9qeNVqZgCbf5sstys= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=u9VUZEQv; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=bCMEs+2v; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="u9VUZEQv"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="bCMEs+2v" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1768918241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eOQ8GS3W1MRmodMZgFABkywgFvGKyZPfH1LFL9LoMGY=; b=u9VUZEQvWoxHjLBauY8z7HF1TLbuASKHVU93cqLptNcuHLrklRwLfzT96BGKyCwEhnqwLD 1ZMX/t8cShhT5EtRl90vpDEW3zSszuDu9SS+IGQxTaid54xyPdRLXjLhXKXnfoVy7zNps4 UutIKbGn7oBe7iBRWgJhbxyp2+kRRhx8c+GmV9BPNsWYOdONd1/fDg0usC1OKEejawa+7u 7nMQlCflqh1qJaAs144JmX61u23sFBcl+f2xF9ad3PRtsyLVtvzi7T+vZuWC1qPxluQ8+8 RHEFgpi41jpUbU1BL8pr8O80cRkvtBeolCykT/0mn99+fRhinykiD9iPgPeN/g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1768918241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eOQ8GS3W1MRmodMZgFABkywgFvGKyZPfH1LFL9LoMGY=; b=bCMEs+2vw0GkQWixlwb7IbDDFfOdljaTfGnEqezEY+kbXmb6O17EBN8n+ne5vDNAvKdX3e ug6xk5IBRC7RNMAA== Date: Tue, 20 Jan 2026 15:10:34 +0100 Subject: [PATCH net-next v2 4/4] net: uapi: Provide an UAPI definition of 'struct sockaddr' Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260120-uapi-sockaddr-v2-4-63c319111cf6@linutronix.de> References: <20260120-uapi-sockaddr-v2-0-63c319111cf6@linutronix.de> In-Reply-To: <20260120-uapi-sockaddr-v2-0-63c319111cf6@linutronix.de> To: Eric Dumazet , Kuniyuki Iwashima , Paolo Abeni , Willem de Bruijn , "David S. Miller" , Jakub Kicinski , Simon Horman , Shuah Khan , Matthieu Baerts , Mat Martineau , Geliang Tang , =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G=C3=BCnther_Noack?= , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Stanislav Fomichev , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Hao Luo , Jiri Olsa Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , linux-kselftest@vger.kernel.org, mptcp@lists.linux.dev, linux-security-module@vger.kernel.org, bpf@vger.kernel.org, libc-alpha@sourceware.org, Carlos O'Donell , Adhemerval Zanella , Rich Felker , klibc@zytor.com, Florian Weimer , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1768918237; l=3848; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=0gJHssghFK1RP90RiI7zuAI2Lb2IlxOeNNJyTLHYHUk=; b=Y77GKxsdWINbT9W4Kz+9AEDonn7gqGaLn3W9iGuqEOx5FCQ40NeQXBIqjtdlLcussEkSDha7x jGi3PaNWeKJBIq6QM1Pw24wmuBRULo1gD0tfU5AR7dmZpMH2ugb7SDS X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Various UAPI headers reference 'struct sockaddr'. Currently the definition of this struct is pulled in from the libc header sys/socket.h. This is problematic as it introduces a dependency on a full userspace toolchain. Instead expose a custom but compatible definition of 'struct sockaddr' in the UAPI headers. It is guarded by the libc compatibility infrastructure to avoid potential conflicts. The compatibility symbol won't be supported by glibc right away, but right now __UAPI_DEF_IF_IFNAMSIZ is not supported either, so including the libc headers before the UAPI headers is broken anyways. Signed-off-by: Thomas Wei=C3=9Fschuh --- include/linux/socket.h | 10 ---------- include/uapi/linux/if.h | 4 ---- include/uapi/linux/libc-compat.h | 12 ++++++++++++ include/uapi/linux/socket.h | 14 ++++++++++++++ 4 files changed, 26 insertions(+), 14 deletions(-) diff --git a/include/linux/socket.h b/include/linux/socket.h index ec715ad4bf25..8363d4e0a044 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h @@ -28,16 +28,6 @@ extern void socket_seq_show(struct seq_file *seq); =20 typedef __kernel_sa_family_t sa_family_t; =20 -/* - * 1003.1g requires sa_family_t and that sa_data is char. - */ - -/* Deprecated for in-kernel use. Use struct sockaddr_unsized instead. */ -struct sockaddr { - sa_family_t sa_family; /* address family, AF_xxx */ - char sa_data[14]; /* 14 bytes of protocol address */ -}; - /** * struct sockaddr_unsized - Unspecified size sockaddr for callbacks * @sa_family: Address family (AF_UNIX, AF_INET, AF_INET6, etc.) diff --git a/include/uapi/linux/if.h b/include/uapi/linux/if.h index 797ba2c1562a..a4bc54196a07 100644 --- a/include/uapi/linux/if.h +++ b/include/uapi/linux/if.h @@ -25,10 +25,6 @@ #include /* for "struct sockaddr" et al */ #include /* for "__user" et al */ =20 -#ifndef __KERNEL__ -#include /* for struct sockaddr. */ -#endif - #if __UAPI_DEF_IF_IFNAMSIZ #define IFNAMSIZ 16 #endif /* __UAPI_DEF_IF_IFNAMSIZ */ diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-com= pat.h index 0eca95ccb41e..13a06ce4e825 100644 --- a/include/uapi/linux/libc-compat.h +++ b/include/uapi/linux/libc-compat.h @@ -140,6 +140,13 @@ =20 #endif /* _NETINET_IN_H */ =20 +/* Definitions for socket.h */ +#if defined(_SYS_SOCKET_H) +#define __UAPI_DEF_SOCKADDR 0 +#else +#define __UAPI_DEF_SOCKADDR 1 +#endif + /* Definitions for xattr.h */ #if defined(_SYS_XATTR_H) #define __UAPI_DEF_XATTR 0 @@ -221,6 +228,11 @@ #define __UAPI_DEF_IP6_MTUINFO 1 #endif =20 +/* Definitions for socket.h */ +#ifndef __UAPI_DEF_SOCKADDR +#define __UAPI_DEF_SOCKADDR 1 +#endif + /* Definitions for xattr.h */ #ifndef __UAPI_DEF_XATTR #define __UAPI_DEF_XATTR 1 diff --git a/include/uapi/linux/socket.h b/include/uapi/linux/socket.h index d3fcd3b5ec53..35d7d5f4b1a8 100644 --- a/include/uapi/linux/socket.h +++ b/include/uapi/linux/socket.h @@ -2,6 +2,8 @@ #ifndef _UAPI_LINUX_SOCKET_H #define _UAPI_LINUX_SOCKET_H =20 +#include /* for compatibility with glibc */ + /* * Desired design of maximum size and alignment (see RFC2553) */ @@ -26,6 +28,18 @@ struct __kernel_sockaddr_storage { }; }; =20 +/* + * 1003.1g requires sa_family_t and that sa_data is char. + */ + +/* Deprecated for in-kernel use. Use struct sockaddr_unsized instead. */ +#if __UAPI_DEF_SOCKADDR +struct sockaddr { + __kernel_sa_family_t sa_family; /* address family, AF_xxx */ + char sa_data[14]; /* 14 bytes of protocol address */ +}; +#endif /* __UAPI_DEF_SOCKADDR */ + #define SOCK_SNDBUF_LOCK 1 #define SOCK_RCVBUF_LOCK 2 =20 --=20 2.52.0