summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MAINTAINERS8
-rw-r--r--include/linux/socket.h5
-rw-r--r--net/Kconfig1
-rw-r--r--net/core/sock.c12
-rw-r--r--net/xdp/Kconfig7
-rw-r--r--security/selinux/hooks.c4
-rw-r--r--security/selinux/include/classmap.h4
7 files changed, 34 insertions, 7 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 537fd17a211b..52d246fd29c9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -15424,6 +15424,14 @@ T: git git://linuxtv.org/media_tree.git
15424S: Maintained 15424S: Maintained
15425F: drivers/media/tuners/tuner-xc2028.* 15425F: drivers/media/tuners/tuner-xc2028.*
15426 15426
15427XDP SOCKETS (AF_XDP)
15428M: Björn Töpel <bjorn.topel@intel.com>
15429M: Magnus Karlsson <magnus.karlsson@intel.com>
15430L: netdev@vger.kernel.org
15431S: Maintained
15432F: kernel/bpf/xskmap.c
15433F: net/xdp/
15434
15427XEN BLOCK SUBSYSTEM 15435XEN BLOCK SUBSYSTEM
15428M: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> 15436M: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
15429M: Roger Pau Monné <roger.pau@citrix.com> 15437M: Roger Pau Monné <roger.pau@citrix.com>
diff --git a/include/linux/socket.h b/include/linux/socket.h
index ea50f4a65816..7ed4713d5337 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -207,8 +207,9 @@ struct ucred {
207 * PF_SMC protocol family that 207 * PF_SMC protocol family that
208 * reuses AF_INET address family 208 * reuses AF_INET address family
209 */ 209 */
210#define AF_XDP 44 /* XDP sockets */
210 211
211#define AF_MAX 44 /* For now.. */ 212#define AF_MAX 45 /* For now.. */
212 213
213/* Protocol families, same as address families. */ 214/* Protocol families, same as address families. */
214#define PF_UNSPEC AF_UNSPEC 215#define PF_UNSPEC AF_UNSPEC
@@ -257,6 +258,7 @@ struct ucred {
257#define PF_KCM AF_KCM 258#define PF_KCM AF_KCM
258#define PF_QIPCRTR AF_QIPCRTR 259#define PF_QIPCRTR AF_QIPCRTR
259#define PF_SMC AF_SMC 260#define PF_SMC AF_SMC
261#define PF_XDP AF_XDP
260#define PF_MAX AF_MAX 262#define PF_MAX AF_MAX
261 263
262/* Maximum queue length specifiable by listen. */ 264/* Maximum queue length specifiable by listen. */
@@ -338,6 +340,7 @@ struct ucred {
338#define SOL_NFC 280 340#define SOL_NFC 280
339#define SOL_KCM 281 341#define SOL_KCM 281
340#define SOL_TLS 282 342#define SOL_TLS 282
343#define SOL_XDP 283
341 344
342/* IPX options */ 345/* IPX options */
343#define IPX_TYPE 1 346#define IPX_TYPE 1
diff --git a/net/Kconfig b/net/Kconfig
index 6fa1a4493b8c..86471a1c1ed4 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -59,6 +59,7 @@ source "net/tls/Kconfig"
59source "net/xfrm/Kconfig" 59source "net/xfrm/Kconfig"
60source "net/iucv/Kconfig" 60source "net/iucv/Kconfig"
61source "net/smc/Kconfig" 61source "net/smc/Kconfig"
62source "net/xdp/Kconfig"
62 63
63config INET 64config INET
64 bool "TCP/IP networking" 65 bool "TCP/IP networking"
diff --git a/net/core/sock.c b/net/core/sock.c
index b2c3db169ca1..e7d8b6c955c6 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -226,7 +226,8 @@ static struct lock_class_key af_family_kern_slock_keys[AF_MAX];
226 x "AF_RXRPC" , x "AF_ISDN" , x "AF_PHONET" , \ 226 x "AF_RXRPC" , x "AF_ISDN" , x "AF_PHONET" , \
227 x "AF_IEEE802154", x "AF_CAIF" , x "AF_ALG" , \ 227 x "AF_IEEE802154", x "AF_CAIF" , x "AF_ALG" , \
228 x "AF_NFC" , x "AF_VSOCK" , x "AF_KCM" , \ 228 x "AF_NFC" , x "AF_VSOCK" , x "AF_KCM" , \
229 x "AF_QIPCRTR", x "AF_SMC" , x "AF_MAX" 229 x "AF_QIPCRTR", x "AF_SMC" , x "AF_XDP" , \
230 x "AF_MAX"
230 231
231static const char *const af_family_key_strings[AF_MAX+1] = { 232static const char *const af_family_key_strings[AF_MAX+1] = {
232 _sock_locks("sk_lock-") 233 _sock_locks("sk_lock-")
@@ -262,7 +263,8 @@ static const char *const af_family_rlock_key_strings[AF_MAX+1] = {
262 "rlock-AF_RXRPC" , "rlock-AF_ISDN" , "rlock-AF_PHONET" , 263 "rlock-AF_RXRPC" , "rlock-AF_ISDN" , "rlock-AF_PHONET" ,
263 "rlock-AF_IEEE802154", "rlock-AF_CAIF" , "rlock-AF_ALG" , 264 "rlock-AF_IEEE802154", "rlock-AF_CAIF" , "rlock-AF_ALG" ,
264 "rlock-AF_NFC" , "rlock-AF_VSOCK" , "rlock-AF_KCM" , 265 "rlock-AF_NFC" , "rlock-AF_VSOCK" , "rlock-AF_KCM" ,
265 "rlock-AF_QIPCRTR", "rlock-AF_SMC" , "rlock-AF_MAX" 266 "rlock-AF_QIPCRTR", "rlock-AF_SMC" , "rlock-AF_XDP" ,
267 "rlock-AF_MAX"
266}; 268};
267static const char *const af_family_wlock_key_strings[AF_MAX+1] = { 269static const char *const af_family_wlock_key_strings[AF_MAX+1] = {
268 "wlock-AF_UNSPEC", "wlock-AF_UNIX" , "wlock-AF_INET" , 270 "wlock-AF_UNSPEC", "wlock-AF_UNIX" , "wlock-AF_INET" ,
@@ -279,7 +281,8 @@ static const char *const af_family_wlock_key_strings[AF_MAX+1] = {
279 "wlock-AF_RXRPC" , "wlock-AF_ISDN" , "wlock-AF_PHONET" , 281 "wlock-AF_RXRPC" , "wlock-AF_ISDN" , "wlock-AF_PHONET" ,
280 "wlock-AF_IEEE802154", "wlock-AF_CAIF" , "wlock-AF_ALG" , 282 "wlock-AF_IEEE802154", "wlock-AF_CAIF" , "wlock-AF_ALG" ,
281 "wlock-AF_NFC" , "wlock-AF_VSOCK" , "wlock-AF_KCM" , 283 "wlock-AF_NFC" , "wlock-AF_VSOCK" , "wlock-AF_KCM" ,
282 "wlock-AF_QIPCRTR", "wlock-AF_SMC" , "wlock-AF_MAX" 284 "wlock-AF_QIPCRTR", "wlock-AF_SMC" , "wlock-AF_XDP" ,
285 "wlock-AF_MAX"
283}; 286};
284static const char *const af_family_elock_key_strings[AF_MAX+1] = { 287static const char *const af_family_elock_key_strings[AF_MAX+1] = {
285 "elock-AF_UNSPEC", "elock-AF_UNIX" , "elock-AF_INET" , 288 "elock-AF_UNSPEC", "elock-AF_UNIX" , "elock-AF_INET" ,
@@ -296,7 +299,8 @@ static const char *const af_family_elock_key_strings[AF_MAX+1] = {
296 "elock-AF_RXRPC" , "elock-AF_ISDN" , "elock-AF_PHONET" , 299 "elock-AF_RXRPC" , "elock-AF_ISDN" , "elock-AF_PHONET" ,
297 "elock-AF_IEEE802154", "elock-AF_CAIF" , "elock-AF_ALG" , 300 "elock-AF_IEEE802154", "elock-AF_CAIF" , "elock-AF_ALG" ,
298 "elock-AF_NFC" , "elock-AF_VSOCK" , "elock-AF_KCM" , 301 "elock-AF_NFC" , "elock-AF_VSOCK" , "elock-AF_KCM" ,
299 "elock-AF_QIPCRTR", "elock-AF_SMC" , "elock-AF_MAX" 302 "elock-AF_QIPCRTR", "elock-AF_SMC" , "elock-AF_XDP" ,
303 "elock-AF_MAX"
300}; 304};
301 305
302/* 306/*
diff --git a/net/xdp/Kconfig b/net/xdp/Kconfig
new file mode 100644
index 000000000000..90e4a7152854
--- /dev/null
+++ b/net/xdp/Kconfig
@@ -0,0 +1,7 @@
1config XDP_SOCKETS
2 bool "XDP sockets"
3 depends on BPF_SYSCALL
4 default n
5 help
6 XDP sockets allows a channel between XDP programs and
7 userspace applications.
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 4cafe6a19167..5c508d26b367 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1471,7 +1471,9 @@ static inline u16 socket_type_to_security_class(int family, int type, int protoc
1471 return SECCLASS_QIPCRTR_SOCKET; 1471 return SECCLASS_QIPCRTR_SOCKET;
1472 case PF_SMC: 1472 case PF_SMC:
1473 return SECCLASS_SMC_SOCKET; 1473 return SECCLASS_SMC_SOCKET;
1474#if PF_MAX > 44 1474 case PF_XDP:
1475 return SECCLASS_XDP_SOCKET;
1476#if PF_MAX > 45
1475#error New address family defined, please update this function. 1477#error New address family defined, please update this function.
1476#endif 1478#endif
1477 } 1479 }
diff --git a/security/selinux/include/classmap.h b/security/selinux/include/classmap.h
index 7f0372426494..bd5fe0d3204a 100644
--- a/security/selinux/include/classmap.h
+++ b/security/selinux/include/classmap.h
@@ -240,9 +240,11 @@ struct security_class_mapping secclass_map[] = {
240 { "manage_subnet", NULL } }, 240 { "manage_subnet", NULL } },
241 { "bpf", 241 { "bpf",
242 {"map_create", "map_read", "map_write", "prog_load", "prog_run"} }, 242 {"map_create", "map_read", "map_write", "prog_load", "prog_run"} },
243 { "xdp_socket",
244 { COMMON_SOCK_PERMS, NULL } },
243 { NULL } 245 { NULL }
244 }; 246 };
245 247
246#if PF_MAX > 44 248#if PF_MAX > 45
247#error New address family defined, please update secclass_map. 249#error New address family defined, please update secclass_map.
248#endif 250#endif