Gratuitous renaming of four System V Semaphore MAC Framework entry
points to convert _sema() to _sem() for consistency purposes with respect to the other semaphore-related entry points: mac_init_sysv_sema() -> mac_init_sysv_sem() mac_destroy_sysv_sem() -> mac_destroy_sysv_sem() mac_create_sysv_sema() -> mac_create_sysv_sem() mac_cleanup_sysv_sema() -> mac_cleanup_sysv_sem() Congruent changes are made to the policy interface to support this. Obtained from: TrustedBSD Project Sponsored by: SPAWAR, SPARTA
This commit is contained in:
parent
d420868948
commit
3831e7d7f5
@ -248,7 +248,7 @@ seminit(void)
|
||||
sema[i].u.sem_perm.mode = 0;
|
||||
sema[i].u.sem_perm.seq = 0;
|
||||
#ifdef MAC
|
||||
mac_init_sysv_sema(&sema[i]);
|
||||
mac_init_sysv_sem(&sema[i]);
|
||||
#endif
|
||||
}
|
||||
for (i = 0; i < seminfo.semmni; i++)
|
||||
@ -274,7 +274,7 @@ semunload(void)
|
||||
EVENTHANDLER_DEREGISTER(process_exit, semexit_tag);
|
||||
#ifdef MAC
|
||||
for (i = 0; i < seminfo.semmni; i++)
|
||||
mac_destroy_sysv_sema(&sema[i]);
|
||||
mac_destroy_sysv_sem(&sema[i]);
|
||||
#endif
|
||||
free(sem, M_SEM);
|
||||
free(sema, M_SEM);
|
||||
@ -646,7 +646,7 @@ __semctl(td, uap)
|
||||
}
|
||||
semakptr->u.sem_perm.mode = 0;
|
||||
#ifdef MAC
|
||||
mac_cleanup_sysv_sema(semakptr);
|
||||
mac_cleanup_sysv_sem(semakptr);
|
||||
#endif
|
||||
SEMUNDO_LOCK();
|
||||
semundo_clear(semid, -1);
|
||||
@ -932,7 +932,7 @@ semget(td, uap)
|
||||
bzero(sema[semid].u.sem_base,
|
||||
sizeof(sema[semid].u.sem_base[0])*nsems);
|
||||
#ifdef MAC
|
||||
mac_create_sysv_sema(cred, &sema[semid]);
|
||||
mac_create_sysv_sem(cred, &sema[semid]);
|
||||
#endif
|
||||
DPRINTF(("sembase = 0x%x, next = 0x%x\n",
|
||||
sema[semid].u.sem_base, &sem[semtot]));
|
||||
|
@ -151,7 +151,7 @@ void mac_init_ifnet(struct ifnet *);
|
||||
int mac_init_inpcb(struct inpcb *, int flag);
|
||||
void mac_init_sysv_msgmsg(struct msg *);
|
||||
void mac_init_sysv_msgqueue(struct msqid_kernel*);
|
||||
void mac_init_sysv_sema(struct semid_kernel*);
|
||||
void mac_init_sysv_sem(struct semid_kernel*);
|
||||
void mac_init_sysv_shm(struct shmid_kernel*);
|
||||
int mac_init_ipq(struct ipq *, int flag);
|
||||
int mac_init_socket(struct socket *, int flag);
|
||||
@ -171,7 +171,7 @@ void mac_destroy_ifnet(struct ifnet *);
|
||||
void mac_destroy_inpcb(struct inpcb *);
|
||||
void mac_destroy_sysv_msgmsg(struct msg *);
|
||||
void mac_destroy_sysv_msgqueue(struct msqid_kernel *);
|
||||
void mac_destroy_sysv_sema(struct semid_kernel *);
|
||||
void mac_destroy_sysv_sem(struct semid_kernel *);
|
||||
void mac_destroy_sysv_shm(struct shmid_kernel *);
|
||||
void mac_destroy_ipq(struct ipq *);
|
||||
void mac_destroy_socket(struct socket *);
|
||||
@ -230,7 +230,7 @@ void mac_create_sysv_msgmsg(struct ucred *cred,
|
||||
struct msqid_kernel *msqkptr, struct msg *msgptr);
|
||||
void mac_create_sysv_msgqueue(struct ucred *cred,
|
||||
struct msqid_kernel *msqkptr);
|
||||
void mac_create_sysv_sema(struct ucred *cred,
|
||||
void mac_create_sysv_sem(struct ucred *cred,
|
||||
struct semid_kernel *semakptr);
|
||||
void mac_create_sysv_shm(struct ucred *cred,
|
||||
struct shmid_kernel *shmsegptr);
|
||||
@ -290,7 +290,7 @@ void mac_thread_userret(struct thread *td);
|
||||
*/
|
||||
void mac_cleanup_sysv_msgmsg(struct msg *msgptr);
|
||||
void mac_cleanup_sysv_msgqueue(struct msqid_kernel *msqkptr);
|
||||
void mac_cleanup_sysv_sema(struct semid_kernel *semakptr);
|
||||
void mac_cleanup_sysv_sem(struct semid_kernel *semakptr);
|
||||
void mac_cleanup_sysv_shm(struct shmid_kernel *shmsegptr);
|
||||
|
||||
/* Access control checks. */
|
||||
|
@ -106,7 +106,7 @@ struct mac_policy_ops {
|
||||
int (*mpo_init_inpcb_label)(struct label *label, int flag);
|
||||
void (*mpo_init_sysv_msgmsg_label)(struct label *label);
|
||||
void (*mpo_init_sysv_msgqueue_label)(struct label *label);
|
||||
void (*mpo_init_sysv_sema_label)(struct label *label);
|
||||
void (*mpo_init_sysv_sem_label)(struct label *label);
|
||||
void (*mpo_init_sysv_shm_label)(struct label *label);
|
||||
int (*mpo_init_ipq_label)(struct label *label, int flag);
|
||||
int (*mpo_init_mbuf_label)(struct label *label, int flag);
|
||||
@ -125,7 +125,7 @@ struct mac_policy_ops {
|
||||
void (*mpo_destroy_inpcb_label)(struct label *label);
|
||||
void (*mpo_destroy_sysv_msgmsg_label)(struct label *label);
|
||||
void (*mpo_destroy_sysv_msgqueue_label)(struct label *label);
|
||||
void (*mpo_destroy_sysv_sema_label)(struct label *label);
|
||||
void (*mpo_destroy_sysv_sem_label)(struct label *label);
|
||||
void (*mpo_destroy_sysv_shm_label)(struct label *label);
|
||||
void (*mpo_destroy_ipq_label)(struct label *label);
|
||||
void (*mpo_destroy_mbuf_label)(struct label *label);
|
||||
@ -139,7 +139,7 @@ struct mac_policy_ops {
|
||||
void (*mpo_destroy_vnode_label)(struct label *label);
|
||||
void (*mpo_cleanup_sysv_msgmsg)(struct label *msglabel);
|
||||
void (*mpo_cleanup_sysv_msgqueue)(struct label *msqlabel);
|
||||
void (*mpo_cleanup_sysv_sema)(struct label *semalabel);
|
||||
void (*mpo_cleanup_sysv_sem)(struct label *semalabel);
|
||||
void (*mpo_cleanup_sysv_shm)(struct label *shmlabel);
|
||||
void (*mpo_copy_cred_label)(struct label *src,
|
||||
struct label *dest);
|
||||
@ -250,7 +250,7 @@ struct mac_policy_ops {
|
||||
struct msg *msgptr, struct label *msglabel);
|
||||
void (*mpo_create_sysv_msgqueue)(struct ucred *cred,
|
||||
struct msqid_kernel *msqkptr, struct label *msqlabel);
|
||||
void (*mpo_create_sysv_sema)(struct ucred *cred,
|
||||
void (*mpo_create_sysv_sem)(struct ucred *cred,
|
||||
struct semid_kernel *semakptr, struct label *semalabel);
|
||||
void (*mpo_create_sysv_shm)(struct ucred *cred,
|
||||
struct shmid_kernel *shmsegptr, struct label *shmlabel);
|
||||
|
@ -65,52 +65,52 @@ SYSCTL_UINT(_security_mac_debug_counters, OID_AUTO, ipc_semas, CTLFLAG_RD,
|
||||
#endif
|
||||
|
||||
static struct label *
|
||||
mac_sysv_sema_label_alloc(void)
|
||||
mac_sysv_sem_label_alloc(void)
|
||||
{
|
||||
struct label *label;
|
||||
|
||||
label = mac_labelzone_alloc(M_WAITOK);
|
||||
MAC_PERFORM(init_sysv_sema_label, label);
|
||||
MAC_PERFORM(init_sysv_sem_label, label);
|
||||
MAC_DEBUG_COUNTER_INC(&nmacipcsemas);
|
||||
return (label);
|
||||
}
|
||||
|
||||
void
|
||||
mac_init_sysv_sema(struct semid_kernel *semakptr)
|
||||
mac_init_sysv_sem(struct semid_kernel *semakptr)
|
||||
{
|
||||
|
||||
semakptr->label = mac_sysv_sema_label_alloc();
|
||||
semakptr->label = mac_sysv_sem_label_alloc();
|
||||
}
|
||||
|
||||
static void
|
||||
mac_sysv_sema_label_free(struct label *label)
|
||||
mac_sysv_sem_label_free(struct label *label)
|
||||
{
|
||||
|
||||
MAC_PERFORM(destroy_sysv_sema_label, label);
|
||||
MAC_PERFORM(destroy_sysv_sem_label, label);
|
||||
mac_labelzone_free(label);
|
||||
MAC_DEBUG_COUNTER_DEC(&nmacipcsemas);
|
||||
}
|
||||
|
||||
void
|
||||
mac_destroy_sysv_sema(struct semid_kernel *semakptr)
|
||||
mac_destroy_sysv_sem(struct semid_kernel *semakptr)
|
||||
{
|
||||
|
||||
mac_sysv_sema_label_free(semakptr->label);
|
||||
mac_sysv_sem_label_free(semakptr->label);
|
||||
semakptr->label = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
mac_create_sysv_sema(struct ucred *cred, struct semid_kernel *semakptr)
|
||||
mac_create_sysv_sem(struct ucred *cred, struct semid_kernel *semakptr)
|
||||
{
|
||||
|
||||
MAC_PERFORM(create_sysv_sema, cred, semakptr, semakptr->label);
|
||||
MAC_PERFORM(create_sysv_sem, cred, semakptr, semakptr->label);
|
||||
}
|
||||
|
||||
void
|
||||
mac_cleanup_sysv_sema(struct semid_kernel *semakptr)
|
||||
mac_cleanup_sysv_sem(struct semid_kernel *semakptr)
|
||||
{
|
||||
|
||||
MAC_PERFORM(cleanup_sysv_sema, semakptr->label);
|
||||
MAC_PERFORM(cleanup_sysv_sem, semakptr->label);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -1127,7 +1127,7 @@ mac_biba_create_sysv_msgqueue(struct ucred *cred,
|
||||
}
|
||||
|
||||
static void
|
||||
mac_biba_create_sysv_sema(struct ucred *cred, struct semid_kernel *semakptr,
|
||||
mac_biba_create_sysv_sem(struct ucred *cred, struct semid_kernel *semakptr,
|
||||
struct label *semalabel)
|
||||
{
|
||||
struct mac_biba *source, *dest;
|
||||
@ -1465,7 +1465,7 @@ mac_biba_cleanup_sysv_msgqueue(struct label *msqlabel)
|
||||
}
|
||||
|
||||
static void
|
||||
mac_biba_cleanup_sysv_sema(struct label *semalabel)
|
||||
mac_biba_cleanup_sysv_sem(struct label *semalabel)
|
||||
{
|
||||
|
||||
bzero(SLOT(semalabel), sizeof(struct mac_biba));
|
||||
@ -3057,7 +3057,7 @@ static struct mac_policy_ops mac_biba_ops =
|
||||
.mpo_init_inpcb_label = mac_biba_init_label_waitcheck,
|
||||
.mpo_init_sysv_msgmsg_label = mac_biba_init_label,
|
||||
.mpo_init_sysv_msgqueue_label = mac_biba_init_label,
|
||||
.mpo_init_sysv_sema_label = mac_biba_init_label,
|
||||
.mpo_init_sysv_sem_label = mac_biba_init_label,
|
||||
.mpo_init_sysv_shm_label = mac_biba_init_label,
|
||||
.mpo_init_ipq_label = mac_biba_init_label_waitcheck,
|
||||
.mpo_init_mbuf_label = mac_biba_init_label_waitcheck,
|
||||
@ -3075,7 +3075,7 @@ static struct mac_policy_ops mac_biba_ops =
|
||||
.mpo_destroy_inpcb_label = mac_biba_destroy_label,
|
||||
.mpo_destroy_sysv_msgmsg_label = mac_biba_destroy_label,
|
||||
.mpo_destroy_sysv_msgqueue_label = mac_biba_destroy_label,
|
||||
.mpo_destroy_sysv_sema_label = mac_biba_destroy_label,
|
||||
.mpo_destroy_sysv_sem_label = mac_biba_destroy_label,
|
||||
.mpo_destroy_sysv_shm_label = mac_biba_destroy_label,
|
||||
.mpo_destroy_ipq_label = mac_biba_destroy_label,
|
||||
.mpo_destroy_mbuf_label = mac_biba_destroy_label,
|
||||
@ -3131,7 +3131,7 @@ static struct mac_policy_ops mac_biba_ops =
|
||||
.mpo_create_inpcb_from_socket = mac_biba_create_inpcb_from_socket,
|
||||
.mpo_create_sysv_msgmsg = mac_biba_create_sysv_msgmsg,
|
||||
.mpo_create_sysv_msgqueue = mac_biba_create_sysv_msgqueue,
|
||||
.mpo_create_sysv_sema = mac_biba_create_sysv_sema,
|
||||
.mpo_create_sysv_sem = mac_biba_create_sysv_sem,
|
||||
.mpo_create_sysv_shm = mac_biba_create_sysv_shm,
|
||||
.mpo_create_ipq = mac_biba_create_ipq,
|
||||
.mpo_create_mbuf_from_inpcb = mac_biba_create_mbuf_from_inpcb,
|
||||
@ -3150,7 +3150,7 @@ static struct mac_policy_ops mac_biba_ops =
|
||||
.mpo_relabel_cred = mac_biba_relabel_cred,
|
||||
.mpo_cleanup_sysv_msgmsg = mac_biba_cleanup_sysv_msgmsg,
|
||||
.mpo_cleanup_sysv_msgqueue = mac_biba_cleanup_sysv_msgqueue,
|
||||
.mpo_cleanup_sysv_sema = mac_biba_cleanup_sysv_sema,
|
||||
.mpo_cleanup_sysv_sem = mac_biba_cleanup_sysv_sem,
|
||||
.mpo_cleanup_sysv_shm = mac_biba_cleanup_sysv_shm,
|
||||
.mpo_check_bpfdesc_receive = mac_biba_check_bpfdesc_receive,
|
||||
.mpo_check_cred_relabel = mac_biba_check_cred_relabel,
|
||||
|
@ -1096,7 +1096,7 @@ mac_mls_create_sysv_msgqueue(struct ucred *cred, struct msqid_kernel *msqkptr,
|
||||
}
|
||||
|
||||
static void
|
||||
mac_mls_create_sysv_sema(struct ucred *cred, struct semid_kernel *semakptr,
|
||||
mac_mls_create_sysv_sem(struct ucred *cred, struct semid_kernel *semakptr,
|
||||
struct label *semalabel)
|
||||
{
|
||||
struct mac_mls *source, *dest;
|
||||
@ -1394,7 +1394,7 @@ mac_mls_cleanup_sysv_msgqueue(struct label *msqlabel)
|
||||
}
|
||||
|
||||
static void
|
||||
mac_mls_cleanup_sysv_sema(struct label *semalabel)
|
||||
mac_mls_cleanup_sysv_sem(struct label *semalabel)
|
||||
{
|
||||
|
||||
bzero(SLOT(semalabel), sizeof(struct mac_mls));
|
||||
@ -2831,7 +2831,7 @@ static struct mac_policy_ops mac_mls_ops =
|
||||
.mpo_init_inpcb_label = mac_mls_init_label_waitcheck,
|
||||
.mpo_init_sysv_msgmsg_label = mac_mls_init_label,
|
||||
.mpo_init_sysv_msgqueue_label = mac_mls_init_label,
|
||||
.mpo_init_sysv_sema_label = mac_mls_init_label,
|
||||
.mpo_init_sysv_sem_label = mac_mls_init_label,
|
||||
.mpo_init_sysv_shm_label = mac_mls_init_label,
|
||||
.mpo_init_ipq_label = mac_mls_init_label_waitcheck,
|
||||
.mpo_init_mbuf_label = mac_mls_init_label_waitcheck,
|
||||
@ -2849,7 +2849,7 @@ static struct mac_policy_ops mac_mls_ops =
|
||||
.mpo_destroy_inpcb_label = mac_mls_destroy_label,
|
||||
.mpo_destroy_sysv_msgmsg_label = mac_mls_destroy_label,
|
||||
.mpo_destroy_sysv_msgqueue_label = mac_mls_destroy_label,
|
||||
.mpo_destroy_sysv_sema_label = mac_mls_destroy_label,
|
||||
.mpo_destroy_sysv_sem_label = mac_mls_destroy_label,
|
||||
.mpo_destroy_sysv_shm_label = mac_mls_destroy_label,
|
||||
.mpo_destroy_ipq_label = mac_mls_destroy_label,
|
||||
.mpo_destroy_mbuf_label = mac_mls_destroy_label,
|
||||
@ -2906,7 +2906,7 @@ static struct mac_policy_ops mac_mls_ops =
|
||||
.mpo_create_ipq = mac_mls_create_ipq,
|
||||
.mpo_create_sysv_msgmsg = mac_mls_create_sysv_msgmsg,
|
||||
.mpo_create_sysv_msgqueue = mac_mls_create_sysv_msgqueue,
|
||||
.mpo_create_sysv_sema = mac_mls_create_sysv_sema,
|
||||
.mpo_create_sysv_sem = mac_mls_create_sysv_sem,
|
||||
.mpo_create_sysv_shm = mac_mls_create_sysv_shm,
|
||||
.mpo_create_mbuf_from_inpcb = mac_mls_create_mbuf_from_inpcb,
|
||||
.mpo_create_mbuf_from_mbuf = mac_mls_create_mbuf_from_mbuf,
|
||||
@ -2924,7 +2924,7 @@ static struct mac_policy_ops mac_mls_ops =
|
||||
.mpo_relabel_cred = mac_mls_relabel_cred,
|
||||
.mpo_cleanup_sysv_msgmsg = mac_mls_cleanup_sysv_msgmsg,
|
||||
.mpo_cleanup_sysv_msgqueue = mac_mls_cleanup_sysv_msgqueue,
|
||||
.mpo_cleanup_sysv_sema = mac_mls_cleanup_sysv_sema,
|
||||
.mpo_cleanup_sysv_sem = mac_mls_cleanup_sysv_sem,
|
||||
.mpo_cleanup_sysv_shm = mac_mls_cleanup_sysv_shm,
|
||||
.mpo_check_bpfdesc_receive = mac_mls_check_bpfdesc_receive,
|
||||
.mpo_check_cred_relabel = mac_mls_check_cred_relabel,
|
||||
|
@ -370,7 +370,7 @@ stub_create_sysv_msgqueue(struct ucred *cred, struct msqid_kernel *msqkptr,
|
||||
}
|
||||
|
||||
static void
|
||||
stub_create_sysv_sema(struct ucred *cred, struct semid_kernel *semakptr,
|
||||
stub_create_sysv_sem(struct ucred *cred, struct semid_kernel *semakptr,
|
||||
struct label *semalabel)
|
||||
{
|
||||
|
||||
@ -543,7 +543,7 @@ stub_cleanup_sysv_msgqueue(struct label *msqlabel)
|
||||
}
|
||||
|
||||
static void
|
||||
stub_cleanup_sysv_sema(struct label *semalabel)
|
||||
stub_cleanup_sysv_sem(struct label *semalabel)
|
||||
{
|
||||
|
||||
}
|
||||
@ -1376,7 +1376,7 @@ static struct mac_policy_ops mac_stub_ops =
|
||||
.mpo_init_inpcb_label = stub_init_label_waitcheck,
|
||||
.mpo_init_sysv_msgmsg_label = stub_init_label,
|
||||
.mpo_init_sysv_msgqueue_label = stub_init_label,
|
||||
.mpo_init_sysv_sema_label = stub_init_label,
|
||||
.mpo_init_sysv_sem_label = stub_init_label,
|
||||
.mpo_init_sysv_shm_label = stub_init_label,
|
||||
.mpo_init_ipq_label = stub_init_label_waitcheck,
|
||||
.mpo_init_mbuf_label = stub_init_label_waitcheck,
|
||||
@ -1394,7 +1394,7 @@ static struct mac_policy_ops mac_stub_ops =
|
||||
.mpo_destroy_inpcb_label = stub_destroy_label,
|
||||
.mpo_destroy_sysv_msgmsg_label = stub_destroy_label,
|
||||
.mpo_destroy_sysv_msgqueue_label = stub_destroy_label,
|
||||
.mpo_destroy_sysv_sema_label = stub_destroy_label,
|
||||
.mpo_destroy_sysv_sem_label = stub_destroy_label,
|
||||
.mpo_destroy_sysv_shm_label = stub_destroy_label,
|
||||
.mpo_destroy_ipq_label = stub_destroy_label,
|
||||
.mpo_destroy_mbuf_label = stub_destroy_label,
|
||||
@ -1430,7 +1430,7 @@ static struct mac_policy_ops mac_stub_ops =
|
||||
.mpo_create_devfs_symlink = stub_create_devfs_symlink,
|
||||
.mpo_create_sysv_msgmsg = stub_create_sysv_msgmsg,
|
||||
.mpo_create_sysv_msgqueue = stub_create_sysv_msgqueue,
|
||||
.mpo_create_sysv_sema = stub_create_sysv_sema,
|
||||
.mpo_create_sysv_sem = stub_create_sysv_sem,
|
||||
.mpo_create_sysv_shm = stub_create_sysv_shm,
|
||||
.mpo_create_vnode_extattr = stub_create_vnode_extattr,
|
||||
.mpo_create_mount = stub_create_mount,
|
||||
@ -1475,7 +1475,7 @@ static struct mac_policy_ops mac_stub_ops =
|
||||
.mpo_thread_userret = stub_thread_userret,
|
||||
.mpo_cleanup_sysv_msgmsg = stub_cleanup_sysv_msgmsg,
|
||||
.mpo_cleanup_sysv_msgqueue = stub_cleanup_sysv_msgqueue,
|
||||
.mpo_cleanup_sysv_sema = stub_cleanup_sysv_sema,
|
||||
.mpo_cleanup_sysv_sem = stub_cleanup_sysv_sem,
|
||||
.mpo_cleanup_sysv_shm = stub_cleanup_sysv_shm,
|
||||
.mpo_check_bpfdesc_receive = stub_check_bpfdesc_receive,
|
||||
.mpo_check_cred_relabel = stub_check_cred_relabel,
|
||||
|
@ -166,9 +166,9 @@ SYSCTL_INT(_security_mac_test, OID_AUTO, init_count_sysv_msg, CTLFLAG_RD,
|
||||
static int init_count_sysv_msq;
|
||||
SYSCTL_INT(_security_mac_test, OID_AUTO, init_count_sysv_msq, CTLFLAG_RD,
|
||||
&init_count_sysv_msq, 0, "ipc_msq init calls");
|
||||
static int init_count_sysv_sema;
|
||||
SYSCTL_INT(_security_mac_test, OID_AUTO, init_count_sysv_sema, CTLFLAG_RD,
|
||||
&init_count_sysv_sema, 0, "ipc_sema init calls");
|
||||
static int init_count_sysv_sem;
|
||||
SYSCTL_INT(_security_mac_test, OID_AUTO, init_count_sysv_sem, CTLFLAG_RD,
|
||||
&init_count_sysv_sem, 0, "ipc_sema init calls");
|
||||
static int init_count_sysv_shm;
|
||||
SYSCTL_INT(_security_mac_test, OID_AUTO, init_count_sysv_shm, CTLFLAG_RD,
|
||||
&init_count_sysv_shm, 0, "ipc_shm init calls");
|
||||
@ -225,9 +225,9 @@ SYSCTL_INT(_security_mac_test, OID_AUTO, destroy_count_sysv_msg, CTLFLAG_RD,
|
||||
static int destroy_count_sysv_msq;
|
||||
SYSCTL_INT(_security_mac_test, OID_AUTO, destroy_count_sysv_msq, CTLFLAG_RD,
|
||||
&destroy_count_sysv_msq, 0, "ipc_msq destroy calls");
|
||||
static int destroy_count_sysv_sema;
|
||||
SYSCTL_INT(_security_mac_test, OID_AUTO, destroy_count_sysv_sema, CTLFLAG_RD,
|
||||
&destroy_count_sysv_sema, 0, "ipc_sema destroy calls");
|
||||
static int destroy_count_sysv_sem;
|
||||
SYSCTL_INT(_security_mac_test, OID_AUTO, destroy_count_sysv_sem, CTLFLAG_RD,
|
||||
&destroy_count_sysv_sem, 0, "ipc_sema destroy calls");
|
||||
static int destroy_count_sysv_shm;
|
||||
SYSCTL_INT(_security_mac_test, OID_AUTO, destroy_count_sysv_shm, CTLFLAG_RD,
|
||||
&destroy_count_sysv_shm, 0, "ipc_shm destroy calls");
|
||||
@ -363,10 +363,10 @@ mac_test_init_sysv_msgqueue_label(struct label *label)
|
||||
}
|
||||
|
||||
static void
|
||||
mac_test_init_sysv_sema_label(struct label *label)
|
||||
mac_test_init_sysv_sem_label(struct label *label)
|
||||
{
|
||||
SLOT(label) = SYSVIPCSEMMAGIC;
|
||||
atomic_add_int(&init_count_sysv_sema, 1);
|
||||
atomic_add_int(&init_count_sysv_sem, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -581,16 +581,16 @@ mac_test_destroy_sysv_msgqueue_label(struct label *label)
|
||||
}
|
||||
|
||||
static void
|
||||
mac_test_destroy_sysv_sema_label(struct label *label)
|
||||
mac_test_destroy_sysv_sem_label(struct label *label)
|
||||
{
|
||||
|
||||
if (SLOT(label) == SYSVIPCSEMMAGIC || SLOT(label) == 0) {
|
||||
atomic_add_int(&destroy_count_sysv_sema, 1);
|
||||
atomic_add_int(&destroy_count_sysv_sem, 1);
|
||||
SLOT(label) = EXMAGIC;
|
||||
} else if (SLOT(label) == EXMAGIC) {
|
||||
DEBUGGER("mac_test_destroy_sysv_sema_label: dup destroy");
|
||||
DEBUGGER("mac_test_destroy_sysv_sem_label: dup destroy");
|
||||
} else {
|
||||
DEBUGGER("mac_test_destroy_sysv_sema_label: corrupted label");
|
||||
DEBUGGER("mac_test_destroy_sysv_sem_label: corrupted label");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1106,7 +1106,7 @@ mac_test_create_sysv_msgqueue(struct ucred *cred,
|
||||
}
|
||||
|
||||
static void
|
||||
mac_test_create_sysv_sema(struct ucred *cred, struct semid_kernel *semakptr,
|
||||
mac_test_create_sysv_sem(struct ucred *cred, struct semid_kernel *semakptr,
|
||||
struct label *semalabel)
|
||||
{
|
||||
|
||||
@ -1337,7 +1337,7 @@ mac_test_cleanup_sysv_msgqueue(struct label *msqlabel)
|
||||
}
|
||||
|
||||
static void
|
||||
mac_test_cleanup_sysv_sema(struct label *semalabel)
|
||||
mac_test_cleanup_sysv_sem(struct label *semalabel)
|
||||
{
|
||||
|
||||
ASSERT_SYSVIPCSEM_LABEL(semalabel);
|
||||
@ -2421,7 +2421,7 @@ static struct mac_policy_ops mac_test_ops =
|
||||
.mpo_init_ifnet_label = mac_test_init_ifnet_label,
|
||||
.mpo_init_sysv_msgmsg_label = mac_test_init_sysv_msgmsg_label,
|
||||
.mpo_init_sysv_msgqueue_label = mac_test_init_sysv_msgqueue_label,
|
||||
.mpo_init_sysv_sema_label = mac_test_init_sysv_sema_label,
|
||||
.mpo_init_sysv_sem_label = mac_test_init_sysv_sem_label,
|
||||
.mpo_init_sysv_shm_label = mac_test_init_sysv_shm_label,
|
||||
.mpo_init_inpcb_label = mac_test_init_inpcb_label,
|
||||
.mpo_init_ipq_label = mac_test_init_ipq_label,
|
||||
@ -2441,7 +2441,7 @@ static struct mac_policy_ops mac_test_ops =
|
||||
.mpo_destroy_sysv_msgmsg_label = mac_test_destroy_sysv_msgmsg_label,
|
||||
.mpo_destroy_sysv_msgqueue_label =
|
||||
mac_test_destroy_sysv_msgqueue_label,
|
||||
.mpo_destroy_sysv_sema_label = mac_test_destroy_sysv_sema_label,
|
||||
.mpo_destroy_sysv_sem_label = mac_test_destroy_sysv_sem_label,
|
||||
.mpo_destroy_sysv_shm_label = mac_test_destroy_sysv_shm_label,
|
||||
.mpo_destroy_inpcb_label = mac_test_destroy_inpcb_label,
|
||||
.mpo_destroy_ipq_label = mac_test_destroy_ipq_label,
|
||||
@ -2497,7 +2497,7 @@ static struct mac_policy_ops mac_test_ops =
|
||||
.mpo_create_inpcb_from_socket = mac_test_create_inpcb_from_socket,
|
||||
.mpo_create_sysv_msgmsg = mac_test_create_sysv_msgmsg,
|
||||
.mpo_create_sysv_msgqueue = mac_test_create_sysv_msgqueue,
|
||||
.mpo_create_sysv_sema = mac_test_create_sysv_sema,
|
||||
.mpo_create_sysv_sem = mac_test_create_sysv_sem,
|
||||
.mpo_create_sysv_shm = mac_test_create_sysv_shm,
|
||||
.mpo_create_datagram_from_ipq = mac_test_create_datagram_from_ipq,
|
||||
.mpo_create_fragment = mac_test_create_fragment,
|
||||
@ -2523,7 +2523,7 @@ static struct mac_policy_ops mac_test_ops =
|
||||
.mpo_thread_userret = mac_test_thread_userret,
|
||||
.mpo_cleanup_sysv_msgmsg = mac_test_cleanup_sysv_msgmsg,
|
||||
.mpo_cleanup_sysv_msgqueue = mac_test_cleanup_sysv_msgqueue,
|
||||
.mpo_cleanup_sysv_sema = mac_test_cleanup_sysv_sema,
|
||||
.mpo_cleanup_sysv_sem = mac_test_cleanup_sysv_sem,
|
||||
.mpo_cleanup_sysv_shm = mac_test_cleanup_sysv_shm,
|
||||
.mpo_check_bpfdesc_receive = mac_test_check_bpfdesc_receive,
|
||||
.mpo_check_cred_relabel = mac_test_check_cred_relabel,
|
||||
|
@ -151,7 +151,7 @@ void mac_init_ifnet(struct ifnet *);
|
||||
int mac_init_inpcb(struct inpcb *, int flag);
|
||||
void mac_init_sysv_msgmsg(struct msg *);
|
||||
void mac_init_sysv_msgqueue(struct msqid_kernel*);
|
||||
void mac_init_sysv_sema(struct semid_kernel*);
|
||||
void mac_init_sysv_sem(struct semid_kernel*);
|
||||
void mac_init_sysv_shm(struct shmid_kernel*);
|
||||
int mac_init_ipq(struct ipq *, int flag);
|
||||
int mac_init_socket(struct socket *, int flag);
|
||||
@ -171,7 +171,7 @@ void mac_destroy_ifnet(struct ifnet *);
|
||||
void mac_destroy_inpcb(struct inpcb *);
|
||||
void mac_destroy_sysv_msgmsg(struct msg *);
|
||||
void mac_destroy_sysv_msgqueue(struct msqid_kernel *);
|
||||
void mac_destroy_sysv_sema(struct semid_kernel *);
|
||||
void mac_destroy_sysv_sem(struct semid_kernel *);
|
||||
void mac_destroy_sysv_shm(struct shmid_kernel *);
|
||||
void mac_destroy_ipq(struct ipq *);
|
||||
void mac_destroy_socket(struct socket *);
|
||||
@ -230,7 +230,7 @@ void mac_create_sysv_msgmsg(struct ucred *cred,
|
||||
struct msqid_kernel *msqkptr, struct msg *msgptr);
|
||||
void mac_create_sysv_msgqueue(struct ucred *cred,
|
||||
struct msqid_kernel *msqkptr);
|
||||
void mac_create_sysv_sema(struct ucred *cred,
|
||||
void mac_create_sysv_sem(struct ucred *cred,
|
||||
struct semid_kernel *semakptr);
|
||||
void mac_create_sysv_shm(struct ucred *cred,
|
||||
struct shmid_kernel *shmsegptr);
|
||||
@ -290,7 +290,7 @@ void mac_thread_userret(struct thread *td);
|
||||
*/
|
||||
void mac_cleanup_sysv_msgmsg(struct msg *msgptr);
|
||||
void mac_cleanup_sysv_msgqueue(struct msqid_kernel *msqkptr);
|
||||
void mac_cleanup_sysv_sema(struct semid_kernel *semakptr);
|
||||
void mac_cleanup_sysv_sem(struct semid_kernel *semakptr);
|
||||
void mac_cleanup_sysv_shm(struct shmid_kernel *shmsegptr);
|
||||
|
||||
/* Access control checks. */
|
||||
|
@ -106,7 +106,7 @@ struct mac_policy_ops {
|
||||
int (*mpo_init_inpcb_label)(struct label *label, int flag);
|
||||
void (*mpo_init_sysv_msgmsg_label)(struct label *label);
|
||||
void (*mpo_init_sysv_msgqueue_label)(struct label *label);
|
||||
void (*mpo_init_sysv_sema_label)(struct label *label);
|
||||
void (*mpo_init_sysv_sem_label)(struct label *label);
|
||||
void (*mpo_init_sysv_shm_label)(struct label *label);
|
||||
int (*mpo_init_ipq_label)(struct label *label, int flag);
|
||||
int (*mpo_init_mbuf_label)(struct label *label, int flag);
|
||||
@ -125,7 +125,7 @@ struct mac_policy_ops {
|
||||
void (*mpo_destroy_inpcb_label)(struct label *label);
|
||||
void (*mpo_destroy_sysv_msgmsg_label)(struct label *label);
|
||||
void (*mpo_destroy_sysv_msgqueue_label)(struct label *label);
|
||||
void (*mpo_destroy_sysv_sema_label)(struct label *label);
|
||||
void (*mpo_destroy_sysv_sem_label)(struct label *label);
|
||||
void (*mpo_destroy_sysv_shm_label)(struct label *label);
|
||||
void (*mpo_destroy_ipq_label)(struct label *label);
|
||||
void (*mpo_destroy_mbuf_label)(struct label *label);
|
||||
@ -139,7 +139,7 @@ struct mac_policy_ops {
|
||||
void (*mpo_destroy_vnode_label)(struct label *label);
|
||||
void (*mpo_cleanup_sysv_msgmsg)(struct label *msglabel);
|
||||
void (*mpo_cleanup_sysv_msgqueue)(struct label *msqlabel);
|
||||
void (*mpo_cleanup_sysv_sema)(struct label *semalabel);
|
||||
void (*mpo_cleanup_sysv_sem)(struct label *semalabel);
|
||||
void (*mpo_cleanup_sysv_shm)(struct label *shmlabel);
|
||||
void (*mpo_copy_cred_label)(struct label *src,
|
||||
struct label *dest);
|
||||
@ -250,7 +250,7 @@ struct mac_policy_ops {
|
||||
struct msg *msgptr, struct label *msglabel);
|
||||
void (*mpo_create_sysv_msgqueue)(struct ucred *cred,
|
||||
struct msqid_kernel *msqkptr, struct label *msqlabel);
|
||||
void (*mpo_create_sysv_sema)(struct ucred *cred,
|
||||
void (*mpo_create_sysv_sem)(struct ucred *cred,
|
||||
struct semid_kernel *semakptr, struct label *semalabel);
|
||||
void (*mpo_create_sysv_shm)(struct ucred *cred,
|
||||
struct shmid_kernel *shmsegptr, struct label *shmlabel);
|
||||
|
Loading…
x
Reference in New Issue
Block a user