Lines Matching refs:ad
229 static void __ad_net_init(struct common_audit_data *ad, in __ad_net_init() argument
233 ad->type = LSM_AUDIT_DATA_NET; in __ad_net_init()
234 ad->u.net = net; in __ad_net_init()
240 static void ad_net_init_from_sk(struct common_audit_data *ad, in ad_net_init_from_sk() argument
244 __ad_net_init(ad, net, 0, sk, 0); in ad_net_init_from_sk()
247 static void ad_net_init_from_iif(struct common_audit_data *ad, in ad_net_init_from_iif() argument
251 __ad_net_init(ad, net, ifindex, NULL, family); in ad_net_init_from_iif()
1620 struct common_audit_data ad; in cred_has_capability() local
1627 ad.type = LSM_AUDIT_DATA_CAP; in cred_has_capability()
1628 ad.u.cap = cap; in cred_has_capability()
1645 int rc2 = avc_audit(sid, sid, sclass, av, &avd, rc, &ad); in cred_has_capability()
1680 struct common_audit_data ad; in dentry_has_perm() local
1682 ad.type = LSM_AUDIT_DATA_DENTRY; in dentry_has_perm()
1683 ad.u.dentry = dentry; in dentry_has_perm()
1685 return inode_has_perm(cred, inode, av, &ad); in dentry_has_perm()
1696 struct common_audit_data ad; in path_has_perm() local
1698 ad.type = LSM_AUDIT_DATA_PATH; in path_has_perm()
1699 ad.u.path = *path; in path_has_perm()
1701 return inode_has_perm(cred, inode, av, &ad); in path_has_perm()
1709 struct common_audit_data ad; in file_path_has_perm() local
1711 ad.type = LSM_AUDIT_DATA_FILE; in file_path_has_perm()
1712 ad.u.file = file; in file_path_has_perm()
1713 return inode_has_perm(cred, file_inode(file), av, &ad); in file_path_has_perm()
1734 struct common_audit_data ad; in file_has_perm() local
1738 ad.type = LSM_AUDIT_DATA_FILE; in file_has_perm()
1739 ad.u.file = file; in file_has_perm()
1745 &ad); in file_has_perm()
1759 rc = inode_has_perm(cred, inode, av, &ad); in file_has_perm()
1802 struct common_audit_data ad; in may_create() local
1810 ad.type = LSM_AUDIT_DATA_DENTRY; in may_create()
1811 ad.u.dentry = dentry; in may_create()
1815 &ad); in may_create()
1824 rc = avc_has_perm(sid, newsid, tclass, FILE__CREATE, &ad); in may_create()
1830 FILESYSTEM__ASSOCIATE, &ad); in may_create()
1844 struct common_audit_data ad; in may_link() local
1852 ad.type = LSM_AUDIT_DATA_DENTRY; in may_link()
1853 ad.u.dentry = dentry; in may_link()
1857 rc = avc_has_perm(sid, dsec->sid, SECCLASS_DIR, av, &ad); in may_link()
1877 rc = avc_has_perm(sid, isec->sid, isec->sclass, av, &ad); in may_link()
1887 struct common_audit_data ad; in may_rename() local
1898 ad.type = LSM_AUDIT_DATA_DENTRY; in may_rename()
1900 ad.u.dentry = old_dentry; in may_rename()
1902 DIR__REMOVE_NAME | DIR__SEARCH, &ad); in may_rename()
1906 old_isec->sclass, FILE__RENAME, &ad); in may_rename()
1911 old_isec->sclass, DIR__REPARENT, &ad); in may_rename()
1916 ad.u.dentry = new_dentry; in may_rename()
1920 rc = avc_has_perm(sid, new_dsec->sid, SECCLASS_DIR, av, &ad); in may_rename()
1928 (new_is_dir ? DIR__RMDIR : FILE__UNLINK), &ad); in may_rename()
1940 struct common_audit_data *ad) in superblock_has_perm() argument
1946 return avc_has_perm(sid, sbsec->sid, SECCLASS_FILESYSTEM, perms, ad); in superblock_has_perm()
2059 struct common_audit_data ad; in selinux_binder_transfer_file() local
2062 ad.type = LSM_AUDIT_DATA_PATH; in selinux_binder_transfer_file()
2063 ad.u.path = file->f_path; in selinux_binder_transfer_file()
2069 &ad); in selinux_binder_transfer_file()
2085 &ad); in selinux_binder_transfer_file()
2296 struct common_audit_data ad; in selinux_bprm_creds_for_exec() local
2342 ad.type = LSM_AUDIT_DATA_FILE; in selinux_bprm_creds_for_exec()
2343 ad.u.file = bprm->file; in selinux_bprm_creds_for_exec()
2347 SECCLASS_FILE, FILE__EXECUTE_NO_TRANS, &ad); in selinux_bprm_creds_for_exec()
2353 SECCLASS_PROCESS, PROCESS__TRANSITION, &ad); in selinux_bprm_creds_for_exec()
2358 SECCLASS_FILE, FILE__ENTRYPOINT, &ad); in selinux_bprm_creds_for_exec()
2725 struct common_audit_data ad; in selinux_sb_kern_mount() local
2727 ad.type = LSM_AUDIT_DATA_DENTRY; in selinux_sb_kern_mount()
2728 ad.u.dentry = sb->s_root; in selinux_sb_kern_mount()
2729 return superblock_has_perm(cred, sb, FILESYSTEM__MOUNT, &ad); in selinux_sb_kern_mount()
2735 struct common_audit_data ad; in selinux_sb_statfs() local
2737 ad.type = LSM_AUDIT_DATA_DENTRY; in selinux_sb_statfs()
2738 ad.u.dentry = dentry->d_sb->s_root; in selinux_sb_statfs()
2739 return superblock_has_perm(cred, dentry->d_sb, FILESYSTEM__GETATTR, &ad); in selinux_sb_statfs()
2951 struct common_audit_data ad; in selinux_inode_init_security_anon() local
2991 ad.type = LSM_AUDIT_DATA_ANONINODE; in selinux_inode_init_security_anon()
2992 ad.u.anonclass = name ? (const char *)name->name : "?"; in selinux_inode_init_security_anon()
2998 &ad); in selinux_inode_init_security_anon()
3053 struct common_audit_data ad; in selinux_inode_follow_link() local
3057 ad.type = LSM_AUDIT_DATA_DENTRY; in selinux_inode_follow_link()
3058 ad.u.dentry = dentry; in selinux_inode_follow_link()
3064 return avc_has_perm(sid, isec->sid, isec->sclass, FILE__READ, &ad); in selinux_inode_follow_link()
3071 struct common_audit_data ad; in audit_inode_permission() local
3074 ad.type = LSM_AUDIT_DATA_INODE; in audit_inode_permission()
3075 ad.u.inode = inode; in audit_inode_permission()
3078 audited, denied, result, &ad); in audit_inode_permission()
3176 struct common_audit_data ad; in selinux_inode_setxattr() local
3200 ad.type = LSM_AUDIT_DATA_DENTRY; in selinux_inode_setxattr()
3201 ad.u.dentry = dentry; in selinux_inode_setxattr()
3205 FILE__RELABELFROM, &ad); in selinux_inode_setxattr()
3245 FILE__RELABELTO, &ad); in selinux_inode_setxattr()
3258 &ad); in selinux_inode_setxattr()
3361 struct common_audit_data ad; in selinux_path_notify() local
3363 ad.type = LSM_AUDIT_DATA_PATH; in selinux_path_notify()
3364 ad.u.path = *path; in selinux_path_notify()
3377 FILESYSTEM__WATCH, &ad); in selinux_path_notify()
3647 struct common_audit_data ad; in ioctl_has_perm() local
3657 ad.type = LSM_AUDIT_DATA_IOCTL_OP; in ioctl_has_perm()
3658 ad.u.op = &ioctl; in ioctl_has_perm()
3659 ad.u.op->cmd = cmd; in ioctl_has_perm()
3660 ad.u.op->path = file->f_path; in ioctl_has_perm()
3666 &ad); in ioctl_has_perm()
3676 requested, driver, xperm, &ad); in ioctl_has_perm()
3812 struct common_audit_data ad; in selinux_mmap_file() local
3816 ad.type = LSM_AUDIT_DATA_FILE; in selinux_mmap_file()
3817 ad.u.file = file; in selinux_mmap_file()
3819 FILE__MAP, &ad); in selinux_mmap_file()
4058 struct common_audit_data ad; in selinux_kernel_module_request() local
4060 ad.type = LSM_AUDIT_DATA_KMOD; in selinux_kernel_module_request()
4061 ad.u.kmod_name = kmod_name; in selinux_kernel_module_request()
4064 SYSTEM__MODULE_REQUEST, &ad); in selinux_kernel_module_request()
4069 struct common_audit_data ad; in selinux_kernel_module_from_file() local
4082 ad.type = LSM_AUDIT_DATA_FILE; in selinux_kernel_module_from_file()
4083 ad.u.file = file; in selinux_kernel_module_from_file()
4087 rc = avc_has_perm(sid, fsec->sid, SECCLASS_FD, FD__USE, &ad); in selinux_kernel_module_from_file()
4094 SYSTEM__MODULE_LOAD, &ad); in selinux_kernel_module_from_file()
4264 struct common_audit_data *ad, u8 *proto) in selinux_parse_skb_ipv4() argument
4278 ad->u.net->v4info.saddr = ih->saddr; in selinux_parse_skb_ipv4()
4279 ad->u.net->v4info.daddr = ih->daddr; in selinux_parse_skb_ipv4()
4297 ad->u.net->sport = th->source; in selinux_parse_skb_ipv4()
4298 ad->u.net->dport = th->dest; in selinux_parse_skb_ipv4()
4313 ad->u.net->sport = uh->source; in selinux_parse_skb_ipv4()
4314 ad->u.net->dport = uh->dest; in selinux_parse_skb_ipv4()
4329 ad->u.net->sport = dh->dccph_sport; in selinux_parse_skb_ipv4()
4330 ad->u.net->dport = dh->dccph_dport; in selinux_parse_skb_ipv4()
4346 ad->u.net->sport = sh->source; in selinux_parse_skb_ipv4()
4347 ad->u.net->dport = sh->dest; in selinux_parse_skb_ipv4()
4362 struct common_audit_data *ad, u8 *proto) in selinux_parse_skb_ipv6() argument
4374 ad->u.net->v6info.saddr = ip6->saddr; in selinux_parse_skb_ipv6()
4375 ad->u.net->v6info.daddr = ip6->daddr; in selinux_parse_skb_ipv6()
4395 ad->u.net->sport = th->source; in selinux_parse_skb_ipv6()
4396 ad->u.net->dport = th->dest; in selinux_parse_skb_ipv6()
4407 ad->u.net->sport = uh->source; in selinux_parse_skb_ipv6()
4408 ad->u.net->dport = uh->dest; in selinux_parse_skb_ipv6()
4419 ad->u.net->sport = dh->dccph_sport; in selinux_parse_skb_ipv6()
4420 ad->u.net->dport = dh->dccph_dport; in selinux_parse_skb_ipv6()
4432 ad->u.net->sport = sh->source; in selinux_parse_skb_ipv6()
4433 ad->u.net->dport = sh->dest; in selinux_parse_skb_ipv6()
4447 static int selinux_parse_skb(struct sk_buff *skb, struct common_audit_data *ad, in selinux_parse_skb() argument
4453 switch (ad->u.net->family) { in selinux_parse_skb()
4455 ret = selinux_parse_skb_ipv4(skb, ad, proto); in selinux_parse_skb()
4458 addrp = (char *)(src ? &ad->u.net->v4info.saddr : in selinux_parse_skb()
4459 &ad->u.net->v4info.daddr); in selinux_parse_skb()
4464 ret = selinux_parse_skb_ipv6(skb, ad, proto); in selinux_parse_skb()
4467 addrp = (char *)(src ? &ad->u.net->v6info.saddr : in selinux_parse_skb()
4468 &ad->u.net->v6info.daddr); in selinux_parse_skb()
4571 struct common_audit_data ad; in sock_has_perm() local
4577 ad_net_init_from_sk(&ad, &net, sk); in sock_has_perm()
4580 &ad); in sock_has_perm()
4667 struct common_audit_data ad; in selinux_socket_bind() local
4719 ad.type = LSM_AUDIT_DATA_NET; in selinux_socket_bind()
4720 ad.u.net = &net; in selinux_socket_bind()
4721 ad.u.net->sport = htons(snum); in selinux_socket_bind()
4722 ad.u.net->family = family_sa; in selinux_socket_bind()
4737 SOCKET__NAME_BIND, &ad); in selinux_socket_bind()
4770 ad.u.net->v4info.saddr = addr4->sin_addr.s_addr; in selinux_socket_bind()
4772 ad.u.net->v6info.saddr = addr6->sin6_addr; in selinux_socket_bind()
4775 sksec->sclass, node_perm, &ad); in selinux_socket_bind()
4817 struct common_audit_data ad; in selinux_socket_connect_helper() local
4868 ad.type = LSM_AUDIT_DATA_NET; in selinux_socket_connect_helper()
4869 ad.u.net = &net; in selinux_socket_connect_helper()
4870 ad.u.net->dport = htons(snum); in selinux_socket_connect_helper()
4871 ad.u.net->family = address->sa_family; in selinux_socket_connect_helper()
4872 err = avc_has_perm(sksec->sid, sid, sksec->sclass, perm, &ad); in selinux_socket_connect_helper()
4976 struct common_audit_data ad; in selinux_socket_unix_stream_connect() local
4980 ad_net_init_from_sk(&ad, &net, other); in selinux_socket_unix_stream_connect()
4984 UNIX_STREAM_SOCKET__CONNECTTO, &ad); in selinux_socket_unix_stream_connect()
5006 struct common_audit_data ad; in selinux_socket_unix_may_send() local
5009 ad_net_init_from_sk(&ad, &net, other->sk); in selinux_socket_unix_may_send()
5012 &ad); in selinux_socket_unix_may_send()
5017 struct common_audit_data *ad) in selinux_inet_sys_rcv_skb() argument
5027 SECCLASS_NETIF, NETIF__INGRESS, ad); in selinux_inet_sys_rcv_skb()
5035 SECCLASS_NODE, NODE__RECVFROM, ad); in selinux_inet_sys_rcv_skb()
5044 struct common_audit_data ad; in selinux_sock_rcv_skb_compat() local
5048 ad_net_init_from_iif(&ad, &net, skb->skb_iif, family); in selinux_sock_rcv_skb_compat()
5049 err = selinux_parse_skb(skb, &ad, &addrp, 1, NULL); in selinux_sock_rcv_skb_compat()
5055 PACKET__RECV, &ad); in selinux_sock_rcv_skb_compat()
5060 err = selinux_netlbl_sock_rcv_skb(sksec, skb, family, &ad); in selinux_sock_rcv_skb_compat()
5063 err = selinux_xfrm_sock_rcv_skb(sksec->sid, skb, &ad); in selinux_sock_rcv_skb_compat()
5074 struct common_audit_data ad; in selinux_socket_sock_rcv_skb() local
5097 ad_net_init_from_iif(&ad, &net, skb->skb_iif, family); in selinux_socket_sock_rcv_skb()
5098 err = selinux_parse_skb(skb, &ad, &addrp, 1, NULL); in selinux_socket_sock_rcv_skb()
5109 addrp, family, peer_sid, &ad); in selinux_socket_sock_rcv_skb()
5115 PEER__RECV, &ad); in selinux_socket_sock_rcv_skb()
5124 PACKET__RECV, &ad); in selinux_socket_sock_rcv_skb()
5266 struct common_audit_data ad; in selinux_sctp_process_new_assoc() local
5303 ad_net_init_from_sk(&ad, &net, asoc->base.sk); in selinux_sctp_process_new_assoc()
5306 &ad); in selinux_sctp_process_new_assoc()
5647 struct common_audit_data ad; in selinux_ip_forward() local
5664 ad_net_init_from_iif(&ad, &net, ifindex, family); in selinux_ip_forward()
5665 if (selinux_parse_skb(skb, &ad, &addrp, 1, NULL) != 0) in selinux_ip_forward()
5672 addrp, family, peer_sid, &ad); in selinux_ip_forward()
5681 SECCLASS_PACKET, PACKET__FORWARD_IN, &ad)) in selinux_ip_forward()
5743 struct common_audit_data ad; in selinux_ip_postroute_compat() local
5752 ad_net_init_from_iif(&ad, &net, state->out->ifindex, state->pf); in selinux_ip_postroute_compat()
5753 if (selinux_parse_skb(skb, &ad, NULL, 0, &proto)) in selinux_ip_postroute_compat()
5758 SECCLASS_PACKET, PACKET__SEND, &ad)) in selinux_ip_postroute_compat()
5761 if (selinux_xfrm_postroute_last(sksec->sid, skb, &ad, proto)) in selinux_ip_postroute_compat()
5776 struct common_audit_data ad; in selinux_ip_postroute() local
5874 ad_net_init_from_iif(&ad, &net, ifindex, family); in selinux_ip_postroute()
5875 if (selinux_parse_skb(skb, &ad, &addrp, 0, NULL)) in selinux_ip_postroute()
5880 SECCLASS_PACKET, secmark_perm, &ad)) in selinux_ip_postroute()
5890 SECCLASS_NETIF, NETIF__EGRESS, &ad)) in selinux_ip_postroute()
5896 SECCLASS_NODE, NODE__SENDTO, &ad)) in selinux_ip_postroute()
5972 struct common_audit_data ad; in ipc_has_perm() local
5977 ad.type = LSM_AUDIT_DATA_IPC; in ipc_has_perm()
5978 ad.u.ipc_id = ipc_perms->key; in ipc_has_perm()
5980 return avc_has_perm(sid, isec->sid, isec->sclass, perms, &ad); in ipc_has_perm()
5997 struct common_audit_data ad; in selinux_msg_queue_alloc_security() local
6003 ad.type = LSM_AUDIT_DATA_IPC; in selinux_msg_queue_alloc_security()
6004 ad.u.ipc_id = msq->key; in selinux_msg_queue_alloc_security()
6007 MSGQ__CREATE, &ad); in selinux_msg_queue_alloc_security()
6013 struct common_audit_data ad; in selinux_msg_queue_associate() local
6018 ad.type = LSM_AUDIT_DATA_IPC; in selinux_msg_queue_associate()
6019 ad.u.ipc_id = msq->key; in selinux_msg_queue_associate()
6022 MSGQ__ASSOCIATE, &ad); in selinux_msg_queue_associate()
6057 struct common_audit_data ad; in selinux_msg_queue_msgsnd() local
6078 ad.type = LSM_AUDIT_DATA_IPC; in selinux_msg_queue_msgsnd()
6079 ad.u.ipc_id = msq->key; in selinux_msg_queue_msgsnd()
6083 MSGQ__WRITE, &ad); in selinux_msg_queue_msgsnd()
6087 MSG__SEND, &ad); in selinux_msg_queue_msgsnd()
6091 MSGQ__ENQUEUE, &ad); in selinux_msg_queue_msgsnd()
6102 struct common_audit_data ad; in selinux_msg_queue_msgrcv() local
6109 ad.type = LSM_AUDIT_DATA_IPC; in selinux_msg_queue_msgrcv()
6110 ad.u.ipc_id = msq->key; in selinux_msg_queue_msgrcv()
6113 SECCLASS_MSGQ, MSGQ__READ, &ad); in selinux_msg_queue_msgrcv()
6116 SECCLASS_MSG, MSG__RECEIVE, &ad); in selinux_msg_queue_msgrcv()
6124 struct common_audit_data ad; in selinux_shm_alloc_security() local
6130 ad.type = LSM_AUDIT_DATA_IPC; in selinux_shm_alloc_security()
6131 ad.u.ipc_id = shp->key; in selinux_shm_alloc_security()
6134 SHM__CREATE, &ad); in selinux_shm_alloc_security()
6140 struct common_audit_data ad; in selinux_shm_associate() local
6145 ad.type = LSM_AUDIT_DATA_IPC; in selinux_shm_associate()
6146 ad.u.ipc_id = shp->key; in selinux_shm_associate()
6149 SHM__ASSOCIATE, &ad); in selinux_shm_associate()
6202 struct common_audit_data ad; in selinux_sem_alloc_security() local
6208 ad.type = LSM_AUDIT_DATA_IPC; in selinux_sem_alloc_security()
6209 ad.u.ipc_id = sma->key; in selinux_sem_alloc_security()
6212 SEM__CREATE, &ad); in selinux_sem_alloc_security()
6218 struct common_audit_data ad; in selinux_sem_associate() local
6223 ad.type = LSM_AUDIT_DATA_IPC; in selinux_sem_associate()
6224 ad.u.ipc_id = sma->key; in selinux_sem_associate()
6227 SEM__ASSOCIATE, &ad); in selinux_sem_associate()
6664 struct common_audit_data ad; in selinux_ib_pkey_access() local
6674 ad.type = LSM_AUDIT_DATA_IBPKEY; in selinux_ib_pkey_access()
6677 ad.u.ibpkey = &ibpkey; in selinux_ib_pkey_access()
6680 INFINIBAND_PKEY__ACCESS, &ad); in selinux_ib_pkey_access()
6686 struct common_audit_data ad; in selinux_ib_endport_manage_subnet() local
6698 ad.type = LSM_AUDIT_DATA_IBENDPORT; in selinux_ib_endport_manage_subnet()
6701 ad.u.ibendport = &ibendport; in selinux_ib_endport_manage_subnet()
6704 INFINIBAND_ENDPORT__MANAGE_SUBNET, &ad); in selinux_ib_endport_manage_subnet()
6971 struct common_audit_data ad; in selinux_uring_cmd() local
6973 ad.type = LSM_AUDIT_DATA_FILE; in selinux_uring_cmd()
6974 ad.u.file = file; in selinux_uring_cmd()
6977 SECCLASS_IO_URING, IO_URING__CMD, &ad); in selinux_uring_cmd()