Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\selinux\hooks.c Create Date:2022-07-28 18:54:31
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:socket_type_to_security_class

Proto:static inline u16 socket_type_to_security_class(int family, int type, int protocol)

Type:u16

Parameter:

TypeParameterName
intfamily
inttype
intprotocol
1181  extsockclass = selinux_policycap_extsockclass()
1184  Case family == PF_UNIX
1186  Case type == SOCK_STREAM
1187  Case type == SOCK_SEQPACKET
1189  Case type == SOCK_DGRAM
1190  Case type == SOCK_RAW
1193  Break
1194  Case family == PF_INET
1195  Case family == PF_INET6
1197  Case type == SOCK_STREAM
1198  Case type == SOCK_SEQPACKET
1201  Else if extsockclass && protocol == IPPROTO_SCTP Then Return SECCLASS_SCTP_SOCKET
1203  Else Return SECCLASS_RAWIP_SOCKET
1205  Case type == SOCK_DGRAM
1208  Else if extsockclass && ( protocol == IPPROTO_ICMP || protocol == ICMPv6 ) Then Return SECCLASS_ICMP_SOCKET
1211  Else Return SECCLASS_RAWIP_SOCKET
1213  Case type == SOCK_DCCP
1214  Return SECCLASS_DCCP_SOCKET
1215  Default
1216  Return SECCLASS_RAWIP_SOCKET
1218  Break
1219  Case family == PF_NETLINK
1227  Case protocol == psec
1231  Case protocol == Open-iSCSI
1233  Case protocol == auditing
1235  Case protocol == NETLINK_FIB_LOOKUP
1237  Case protocol == NETLINK_CONNECTOR
1239  Case protocol == filter subsystem
1245  Case protocol == NETLINK_GENERIC
1247  Case protocol == SCSI Transports
1249  Case protocol == NETLINK_RDMA
1251  Case protocol == Crypto layer
1253  Default
1254  Return SECCLASS_NETLINK_SOCKET
1256  Case family == PF_PACKET
1257  Return SECCLASS_PACKET_SOCKET
1258  Case family == PF_KEY
1259  Return SECCLASS_KEY_SOCKET
1260  Case family == PF_APPLETALK
1261  Return SECCLASS_APPLETALK_SOCKET
1264  If extsockclass Then
1266  Case family == PF_AX25
1267  Return SECCLASS_AX25_SOCKET
1268  Case family == PF_IPX
1269  Return SECCLASS_IPX_SOCKET
1270  Case family == PF_NETROM
1271  Return SECCLASS_NETROM_SOCKET
1272  Case family == PF_ATMPVC
1273  Return SECCLASS_ATMPVC_SOCKET
1274  Case family == PF_X25
1275  Return SECCLASS_X25_SOCKET
1276  Case family == PF_ROSE
1277  Return SECCLASS_ROSE_SOCKET
1278  Case family == PF_DECnet
1279  Return SECCLASS_DECNET_SOCKET
1280  Case family == PF_ATMSVC
1281  Return SECCLASS_ATMSVC_SOCKET
1282  Case family == PF_RDS
1283  Return SECCLASS_RDS_SOCKET
1284  Case family == PF_IRDA
1285  Return SECCLASS_IRDA_SOCKET
1286  Case family == PF_PPPOX
1287  Return SECCLASS_PPPOX_SOCKET
1288  Case family == PF_LLC
1289  Return SECCLASS_LLC_SOCKET
1290  Case family == PF_CAN
1291  Return SECCLASS_CAN_SOCKET
1292  Case family == PF_TIPC
1293  Return SECCLASS_TIPC_SOCKET
1294  Case family == PF_BLUETOOTH
1296  Case family == PF_IUCV
1297  Return SECCLASS_IUCV_SOCKET
1298  Case family == PF_RXRPC
1299  Return SECCLASS_RXRPC_SOCKET
1300  Case family == PF_ISDN
1301  Return SECCLASS_ISDN_SOCKET
1302  Case family == PF_PHONET
1303  Return SECCLASS_PHONET_SOCKET
1304  Case family == PF_IEEE802154
1306  Case family == PF_CAIF
1307  Return SECCLASS_CAIF_SOCKET
1308  Case family == PF_ALG
1309  Return SECCLASS_ALG_SOCKET
1310  Case family == PF_NFC
1311  Return SECCLASS_NFC_SOCKET
1312  Case family == PF_VSOCK
1313  Return SECCLASS_VSOCK_SOCKET
1314  Case family == PF_KCM
1315  Return SECCLASS_KCM_SOCKET
1316  Case family == PF_QIPCRTR
1317  Return SECCLASS_QIPCRTR_SOCKET
1318  Case family == PF_SMC
1319  Return SECCLASS_SMC_SOCKET
1320  Case family == PF_XDP
1321  Return SECCLASS_XDP_SOCKET
1328  Return SECCLASS_SOCKET
Caller
NameDescribe
selinux_socket_create
selinux_socket_post_create