Function report |
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 activity | Download SCCT | Chinese |
Name:socket_type_to_security_class
Proto:static inline u16 socket_type_to_security_class(int family, int type, int protocol)
Type:u16
Parameter:
Type | Parameter | Name |
---|---|---|
int | family | |
int | type | |
int | protocol |
1186 | Case type == SOCK_STREAM |
1187 | Case type == SOCK_SEQPACKET |
1188 | Return SECCLASS_UNIX_STREAM_SOCKET |
1189 | Case type == SOCK_DGRAM |
1191 | Return SECCLASS_UNIX_DGRAM_SOCKET |
1193 | Break |
1197 | Case type == SOCK_STREAM |
1198 | Case type == SOCK_SEQPACKET |
1199 | If default_protocol_stream(protocol) Then Return SECCLASS_TCP_SOCKET |
1201 | Else if extsockclass && protocol == IPPROTO_SCTP Then Return SECCLASS_SCTP_SOCKET |
1203 | Else Return SECCLASS_RAWIP_SOCKET |
1205 | Case type == SOCK_DGRAM |
1206 | If default_protocol_dgram(protocol) Then Return SECCLASS_UDP_SOCKET |
1208 | Else if extsockclass && ( protocol == IPPROTO_ICMP || protocol == ICMPv6 ) Then Return SECCLASS_ICMP_SOCKET |
1211 | Else Return SECCLASS_RAWIP_SOCKET |
1214 | Return SECCLASS_DCCP_SOCKET |
1215 | Default |
1216 | Return SECCLASS_RAWIP_SOCKET |
1218 | Break |
1219 | Case family == PF_NETLINK |
1221 | Case protocol == Routing/device hook |
1222 | Return SECCLASS_NETLINK_ROUTE_SOCKET |
1223 | Case protocol == socket monitoring |
1224 | Return SECCLASS_NETLINK_TCPDIAG_SOCKET |
1225 | Case protocol == filter/iptables ULOG |
1226 | Return SECCLASS_NETLINK_NFLOG_SOCKET |
1228 | Return SECCLASS_NETLINK_XFRM_SOCKET |
1229 | Case protocol == SELinux event notifications |
1230 | Return SECCLASS_NETLINK_SELINUX_SOCKET |
1231 | Case protocol == Open-iSCSI |
1232 | Return SECCLASS_NETLINK_ISCSI_SOCKET |
1234 | Return SECCLASS_NETLINK_AUDIT_SOCKET |
1235 | Case protocol == NETLINK_FIB_LOOKUP |
1236 | Return SECCLASS_NETLINK_FIB_LOOKUP_SOCKET |
1237 | Case protocol == NETLINK_CONNECTOR |
1238 | Return SECCLASS_NETLINK_CONNECTOR_SOCKET |
1239 | Case protocol == filter subsystem |
1240 | Return SECCLASS_NETLINK_NETFILTER_SOCKET |
1241 | Case protocol == DECnet routing messages |
1242 | Return SECCLASS_NETLINK_DNRT_SOCKET |
1243 | Case protocol == Kernel messages to userspace |
1244 | Return SECCLASS_NETLINK_KOBJECT_UEVENT_SOCKET |
1245 | Case protocol == NETLINK_GENERIC |
1246 | Return SECCLASS_NETLINK_GENERIC_SOCKET |
1247 | Case protocol == SCSI Transports |
1248 | Return SECCLASS_NETLINK_SCSITRANSPORT_SOCKET |
1249 | Case protocol == NETLINK_RDMA |
1250 | Return SECCLASS_NETLINK_RDMA_SOCKET |
1251 | Case protocol == Crypto layer |
1252 | Return SECCLASS_NETLINK_CRYPTO_SOCKET |
1253 | Default |
1254 | Return SECCLASS_NETLINK_SOCKET |
1257 | Return SECCLASS_PACKET_SOCKET |
1259 | Return SECCLASS_KEY_SOCKET |
1260 | Case family == PF_APPLETALK |
1261 | Return SECCLASS_APPLETALK_SOCKET |
1264 | If extsockclass Then |
1267 | Return SECCLASS_AX25_SOCKET |
1269 | Return SECCLASS_IPX_SOCKET |
1271 | Return SECCLASS_NETROM_SOCKET |
1273 | Return SECCLASS_ATMPVC_SOCKET |
1275 | Return SECCLASS_X25_SOCKET |
1277 | Return SECCLASS_ROSE_SOCKET |
1279 | Return SECCLASS_DECNET_SOCKET |
1281 | Return SECCLASS_ATMSVC_SOCKET |
1283 | Return SECCLASS_RDS_SOCKET |
1285 | Return SECCLASS_IRDA_SOCKET |
1287 | Return SECCLASS_PPPOX_SOCKET |
1289 | Return SECCLASS_LLC_SOCKET |
1291 | Return SECCLASS_CAN_SOCKET |
1293 | Return SECCLASS_TIPC_SOCKET |
1294 | Case family == PF_BLUETOOTH |
1295 | Return SECCLASS_BLUETOOTH_SOCKET |
1297 | Return SECCLASS_IUCV_SOCKET |
1299 | Return SECCLASS_RXRPC_SOCKET |
1301 | Return SECCLASS_ISDN_SOCKET |
1303 | Return SECCLASS_PHONET_SOCKET |
1304 | Case family == PF_IEEE802154 |
1305 | Return SECCLASS_IEEE802154_SOCKET |
1307 | Return SECCLASS_CAIF_SOCKET |
1309 | Return SECCLASS_ALG_SOCKET |
1311 | Return SECCLASS_NFC_SOCKET |
1313 | Return SECCLASS_VSOCK_SOCKET |
1315 | Return SECCLASS_KCM_SOCKET |
1316 | Case family == PF_QIPCRTR |
1317 | Return SECCLASS_QIPCRTR_SOCKET |
1319 | Return SECCLASS_SMC_SOCKET |
1321 | Return SECCLASS_XDP_SOCKET |
1328 | Return SECCLASS_SOCKET |
Name | Describe |
---|---|
selinux_socket_create | |
selinux_socket_post_create |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |