@@ -208,8 +208,9 @@ struct ucred {
* reuses AF_INET address family
*/
#define AF_XDP 44 /* XDP sockets */
+#define AF_LORA 45 /* LoRa sockets */
-#define AF_MAX 45 /* For now.. */
+#define AF_MAX 46 /* For now.. */
/* Protocol families, same as address families. */
#define PF_UNSPEC AF_UNSPEC
@@ -259,6 +260,7 @@ struct ucred {
#define PF_QIPCRTR AF_QIPCRTR
#define PF_SMC AF_SMC
#define PF_XDP AF_XDP
+#define PF_LORA AF_LORA
#define PF_MAX AF_MAX
/* Maximum queue length specifiable by listen. */
@@ -98,6 +98,7 @@
#define ARPHRD_NETLINK 824 /* Netlink header */
#define ARPHRD_6LOWPAN 825 /* IPv6 over LoWPAN */
#define ARPHRD_VSOCKMON 826 /* Vsock monitor header */
+#define ARPHRD_LORA 827 /* LoRa */
#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */
#define ARPHRD_NONE 0xFFFE /* zero header length */
@@ -147,6 +147,7 @@
#define ETH_P_MAP 0x00F9 /* Qualcomm multiplexing and
* aggregation protocol
*/
+#define ETH_P_LORA 0x00FA /* LoRa */
/*
* This is an Ethernet frame header.
@@ -1473,7 +1473,9 @@ static inline u16 socket_type_to_security_class(int family, int type, int protoc
return SECCLASS_SMC_SOCKET;
case PF_XDP:
return SECCLASS_XDP_SOCKET;
-#if PF_MAX > 45
+ case PF_LORA:
+ return SECCLASS_LORA_SOCKET;
+#if PF_MAX > 46
#error New address family defined, please update this function.
#endif
}
@@ -242,9 +242,11 @@ struct security_class_mapping secclass_map[] = {
{"map_create", "map_read", "map_write", "prog_load", "prog_run"} },
{ "xdp_socket",
{ COMMON_SOCK_PERMS, NULL } },
+ { "lora_socket",
+ { COMMON_SOCK_PERMS, NULL } },
{ NULL }
};
-#if PF_MAX > 45
+#if PF_MAX > 46
#error New address family defined, please update secclass_map.
#endif
LoRa is a long-range, low-power wireless network technology by Semtech. It serves as base for LoRaWAN as well as multiple proprietary protocols. AF_LORA PF_LORA ARPHRD_LORA ETH_P_LORA Signed-off-by: Andreas Färber <afaerber@suse.de> --- include/linux/socket.h | 4 +++- include/uapi/linux/if_arp.h | 1 + include/uapi/linux/if_ether.h | 1 + security/selinux/hooks.c | 4 +++- security/selinux/include/classmap.h | 4 +++- 5 files changed, 11 insertions(+), 3 deletions(-) -- 2.16.4