PERFORCE change 18506 for review
Robert Watson
rwatson at freebsd.org
Wed Oct 2 00:57:09 GMT 2002
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=18506
Change 18506 by rwatson at rwatson_paprika on 2002/10/01 17:57:04
Improve consistency of blocking-sensitive label allocation
routines: always accept (label, flag) rather than sometimes
(how, label). This should correct a page fault during
ifconfig.
Affected files ...
.. //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#288 edit
.. //depot/projects/trustedbsd/mac/sys/security/mac_biba/mac_biba.c#122 edit
.. //depot/projects/trustedbsd/mac/sys/security/mac_mls/mac_mls.c#102 edit
.. //depot/projects/trustedbsd/mac/sys/security/mac_none/mac_none.c#78 edit
.. //depot/projects/trustedbsd/mac/sys/security/mac_te/mac_te.c#82 edit
.. //depot/projects/trustedbsd/mac/sys/security/mac_test/mac_test.c#49 edit
.. //depot/projects/trustedbsd/mac/sys/sys/mac.h#168 edit
.. //depot/projects/trustedbsd/mac/sys/sys/mac_policy.h#129 edit
Differences ...
==== //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#288 (text+ko) ====
@@ -1149,7 +1149,7 @@
}
int
-mac_init_mbuf(struct mbuf *m, int how)
+mac_init_mbuf(struct mbuf *m, int flag)
{
int error;
@@ -1157,7 +1157,7 @@
mac_init_label(&m->m_pkthdr.label);
- MAC_CHECK(init_mbuf_label, how, &m->m_pkthdr.label);
+ MAC_CHECK(init_mbuf_label, &m->m_pkthdr.label, flag);
if (error) {
MAC_PERFORM(destroy_mbuf_label, &m->m_pkthdr.label);
mac_destroy_label(&m->m_pkthdr.label);
==== //depot/projects/trustedbsd/mac/sys/security/mac_biba/mac_biba.c#122 (text+ko) ====
@@ -123,11 +123,11 @@
struct label *vnodelabel, mode_t acc_mode);
static struct mac_biba *
-biba_alloc(int how)
+biba_alloc(int flag)
{
struct mac_biba *mac_biba;
- mac_biba = malloc(sizeof(struct mac_biba), M_MACBIBA, M_ZERO | how);
+ mac_biba = malloc(sizeof(struct mac_biba), M_MACBIBA, M_ZERO | flag);
return (mac_biba);
}
@@ -461,10 +461,10 @@
}
static int
-mac_biba_init_label_waitcheck(int how, struct label *label)
+mac_biba_init_label_waitcheck(struct label *label, int flag)
{
- SLOT(label) = biba_alloc(how);
+ SLOT(label) = biba_alloc(flag);
if (SLOT(label) == NULL)
return (ENOMEM);
==== //depot/projects/trustedbsd/mac/sys/security/mac_mls/mac_mls.c#102 (text+ko) ====
@@ -112,11 +112,11 @@
struct label *vnodelabel, mode_t acc_mode);
static struct mac_mls *
-mls_alloc(int how)
+mls_alloc(int flag)
{
struct mac_mls *mac_mls;
- mac_mls = malloc(sizeof(struct mac_mls), M_MACMLS, M_ZERO | how);
+ mac_mls = malloc(sizeof(struct mac_mls), M_MACMLS, M_ZERO | flag);
return (mac_mls);
}
@@ -450,10 +450,10 @@
}
static int
-mac_mls_init_label_waitcheck(int how, struct label *label)
+mac_mls_init_label_waitcheck(struct label *label, int flag)
{
- SLOT(label) = mls_alloc(how);
+ SLOT(label) = mls_alloc(flag);
if (SLOT(label) == NULL)
return (ENOMEM);
==== //depot/projects/trustedbsd/mac/sys/security/mac_none/mac_none.c#78 (text+ko) ====
@@ -115,7 +115,7 @@
}
static int
-mac_none_init_label_waitcheck(int how, struct label *label)
+mac_none_init_label_waitcheck(struct label *label, int flag)
{
return (0);
==== //depot/projects/trustedbsd/mac/sys/security/mac_te/mac_te.c#82 (text+ko) ====
@@ -187,10 +187,10 @@
sizeof(te_transition_policy[0]);
static struct mac_te *
-te_alloc(int how)
+te_alloc(int flag)
{
- return (malloc(sizeof(struct mac_te), M_MACTE, M_ZERO | how));
+ return (malloc(sizeof(struct mac_te), M_MACTE, M_ZERO | flag));
}
static void
@@ -214,10 +214,10 @@
}
static int
-mac_te_init_label_waitcheck(int how, struct label *label)
+mac_te_init_label_waitcheck(struct label *label, int flag)
{
- SLOT(label) = te_alloc(how);
+ SLOT(label) = te_alloc(flag);
if (SLOT(label) == NULL)
return (ENOMEM);
==== //depot/projects/trustedbsd/mac/sys/security/mac_test/mac_test.c#49 (text+ko) ====
@@ -250,7 +250,7 @@
}
static int
-mac_test_init_mbuf_label(int how, struct label *label)
+mac_test_init_mbuf_label(struct label *label, int flag)
{
SLOT(label) = MBUFMAGIC;
==== //depot/projects/trustedbsd/mac/sys/sys/mac.h#168 (text+ko) ====
@@ -235,7 +235,7 @@
void mac_init_ipq(struct ipq *);
int mac_init_socket(struct socket *, int flag);
void mac_init_pipe(struct pipe *);
-int mac_init_mbuf(struct mbuf *m, int how);
+int mac_init_mbuf(struct mbuf *m, int flag);
void mac_init_mount(struct mount *);
void mac_init_proc(struct proc *);
void mac_init_vnode(struct vnode *);
==== //depot/projects/trustedbsd/mac/sys/sys/mac_policy.h#129 (text+ko) ====
@@ -77,7 +77,7 @@
void (*mpo_init_devfsdirent_label)(struct label *label);
void (*mpo_init_ifnet_label)(struct label *label);
void (*mpo_init_ipq_label)(struct label *label);
- int (*mpo_init_mbuf_label)(int how, struct label *label);
+ int (*mpo_init_mbuf_label)(struct label *label, int flag);
void (*mpo_init_mount_label)(struct label *mntlabel);
void (*mpo_init_mount_fs_label)(struct label *fslabel);
int (*mpo_init_socket_label)(struct label *label, int flag);
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message
More information about the trustedbsd-cvs
mailing list