aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2009-03-08 12:32:06 +0000
committerRobert Watson <rwatson@FreeBSD.org>2009-03-08 12:32:06 +0000
commitfefd0ac8a911c1b3b63da1602bb13cee5ffe4311 (patch)
tree5ad716ce37201626c4c55f560a037b7d2379e625
parentc14172e3aeb860d8e071f75ac5698a6954fb69a8 (diff)
downloadsrc-fefd0ac8a911c1b3b63da1602bb13cee5ffe4311.tar.gz
src-fefd0ac8a911c1b3b63da1602bb13cee5ffe4311.zip
Remove 'uio' argument from MAC Framework and MAC policy entry points for
extended attribute get/set; in the case of get an uninitialized user buffer was passed before the EA was retrieved, making it of relatively little use; the latter was simply unused by any policies. Obtained from: TrustedBSD Project Sponsored by: Google, Inc.
Notes
Notes: svn path=/head/; revision=189533
-rw-r--r--sys/kern/vfs_extattr.c4
-rw-r--r--sys/security/mac/mac_framework.h5
-rw-r--r--sys/security/mac/mac_policy.h5
-rw-r--r--sys/security/mac/mac_vfs.c8
-rw-r--r--sys/security/mac_biba/mac_biba.c6
-rw-r--r--sys/security/mac_bsdextended/ugidfw_internal.h6
-rw-r--r--sys/security/mac_bsdextended/ugidfw_vnode.c6
-rw-r--r--sys/security/mac_lomac/mac_lomac.c3
-rw-r--r--sys/security/mac_mls/mac_mls.c6
-rw-r--r--sys/security/mac_stub/mac_stub.c6
-rw-r--r--sys/security/mac_test/mac_test.c6
11 files changed, 23 insertions, 38 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index e19a386cd8e0..c8b59d9d531f 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -195,7 +195,7 @@ extattr_set_vp(struct vnode *vp, int attrnamespace, const char *attrname,
#ifdef MAC
error = mac_vnode_check_setextattr(td->td_ucred, vp, attrnamespace,
- attrname, &auio);
+ attrname);
if (error)
goto done;
#endif
@@ -373,7 +373,7 @@ extattr_get_vp(struct vnode *vp, int attrnamespace, const char *attrname,
#ifdef MAC
error = mac_vnode_check_getextattr(td->td_ucred, vp, attrnamespace,
- attrname, &auio);
+ attrname);
if (error)
goto done;
#endif
diff --git a/sys/security/mac/mac_framework.h b/sys/security/mac/mac_framework.h
index dfc48f85b58b..f515e98e6a6e 100644
--- a/sys/security/mac/mac_framework.h
+++ b/sys/security/mac/mac_framework.h
@@ -85,7 +85,6 @@ struct pipepair;
struct thread;
struct timespec;
struct ucred;
-struct uio;
struct vattr;
struct vnode;
struct vop_setlabel_args;
@@ -377,7 +376,7 @@ int mac_vnode_check_exec(struct ucred *cred, struct vnode *vp,
int mac_vnode_check_getacl(struct ucred *cred, struct vnode *vp,
acl_type_t type);
int mac_vnode_check_getextattr(struct ucred *cred, struct vnode *vp,
- int attrnamespace, const char *name, struct uio *uio);
+ int attrnamespace, const char *name);
int mac_vnode_check_link(struct ucred *cred, struct vnode *dvp,
struct vnode *vp, struct componentname *cnp);
int mac_vnode_check_listextattr(struct ucred *cred, struct vnode *vp,
@@ -404,7 +403,7 @@ int mac_vnode_check_revoke(struct ucred *cred, struct vnode *vp);
int mac_vnode_check_setacl(struct ucred *cred, struct vnode *vp,
acl_type_t type, struct acl *acl);
int mac_vnode_check_setextattr(struct ucred *cred, struct vnode *vp,
- int attrnamespace, const char *name, struct uio *uio);
+ int attrnamespace, const char *name);
int mac_vnode_check_setflags(struct ucred *cred, struct vnode *vp,
u_long flags);
int mac_vnode_check_setmode(struct ucred *cred, struct vnode *vp,
diff --git a/sys/security/mac/mac_policy.h b/sys/security/mac/mac_policy.h
index 410906b65488..b874c41e74b1 100644
--- a/sys/security/mac/mac_policy.h
+++ b/sys/security/mac/mac_policy.h
@@ -97,7 +97,6 @@ struct sysctl_oid;
struct sysctl_req;
struct thread;
struct ucred;
-struct uio;
struct vattr;
struct vnode;
@@ -557,7 +556,7 @@ typedef int (*mpo_vnode_check_getacl_t)(struct ucred *cred,
acl_type_t type);
typedef int (*mpo_vnode_check_getextattr_t)(struct ucred *cred,
struct vnode *vp, struct label *vplabel,
- int attrnamespace, const char *name, struct uio *uio);
+ int attrnamespace, const char *name);
typedef int (*mpo_vnode_check_link_t)(struct ucred *cred,
struct vnode *dvp, struct label *dvplabel,
struct vnode *vp, struct label *vplabel,
@@ -606,7 +605,7 @@ typedef int (*mpo_vnode_check_setacl_t)(struct ucred *cred,
struct acl *acl);
typedef int (*mpo_vnode_check_setextattr_t)(struct ucred *cred,
struct vnode *vp, struct label *vplabel,
- int attrnamespace, const char *name, struct uio *uio);
+ int attrnamespace, const char *name);
typedef int (*mpo_vnode_check_setflags_t)(struct ucred *cred,
struct vnode *vp, struct label *vplabel, u_long flags);
typedef int (*mpo_vnode_check_setmode_t)(struct ucred *cred,
diff --git a/sys/security/mac/mac_vfs.c b/sys/security/mac/mac_vfs.c
index 1ebf520708c7..01afb81a5b38 100644
--- a/sys/security/mac/mac_vfs.c
+++ b/sys/security/mac/mac_vfs.c
@@ -506,14 +506,14 @@ MAC_CHECK_PROBE_DEFINE4(vnode_check_getextattr, "struct ucred *",
int
mac_vnode_check_getextattr(struct ucred *cred, struct vnode *vp,
- int attrnamespace, const char *name, struct uio *uio)
+ int attrnamespace, const char *name)
{
int error;
ASSERT_VOP_LOCKED(vp, "mac_vnode_check_getextattr");
MAC_CHECK(vnode_check_getextattr, cred, vp, vp->v_label,
- attrnamespace, name, uio);
+ attrnamespace, name);
MAC_CHECK_PROBE4(vnode_check_getextattr, error, cred, vp,
attrnamespace, name);
@@ -798,14 +798,14 @@ MAC_CHECK_PROBE_DEFINE4(vnode_check_setextattr, "struct ucred *",
int
mac_vnode_check_setextattr(struct ucred *cred, struct vnode *vp,
- int attrnamespace, const char *name, struct uio *uio)
+ int attrnamespace, const char *name)
{
int error;
ASSERT_VOP_LOCKED(vp, "mac_vnode_check_setextattr");
MAC_CHECK(vnode_check_setextattr, cred, vp, vp->v_label,
- attrnamespace, name, uio);
+ attrnamespace, name);
MAC_CHECK_PROBE4(vnode_check_setextattr, error, cred, vp,
attrnamespace, name);
diff --git a/sys/security/mac_biba/mac_biba.c b/sys/security/mac_biba/mac_biba.c
index 26366e33e006..41c1eea3ef46 100644
--- a/sys/security/mac_biba/mac_biba.c
+++ b/sys/security/mac_biba/mac_biba.c
@@ -2775,8 +2775,7 @@ biba_vnode_check_getacl(struct ucred *cred, struct vnode *vp,
static int
biba_vnode_check_getextattr(struct ucred *cred, struct vnode *vp,
- struct label *vplabel, int attrnamespace, const char *name,
- struct uio *uio)
+ struct label *vplabel, int attrnamespace, const char *name)
{
struct mac_biba *subj, *obj;
@@ -3116,8 +3115,7 @@ biba_vnode_check_setacl(struct ucred *cred, struct vnode *vp,
static int
biba_vnode_check_setextattr(struct ucred *cred, struct vnode *vp,
- struct label *vplabel, int attrnamespace, const char *name,
- struct uio *uio)
+ struct label *vplabel, int attrnamespace, const char *name)
{
struct mac_biba *subj, *obj;
diff --git a/sys/security/mac_bsdextended/ugidfw_internal.h b/sys/security/mac_bsdextended/ugidfw_internal.h
index c53326db0cfd..5597fd15d43d 100644
--- a/sys/security/mac_bsdextended/ugidfw_internal.h
+++ b/sys/security/mac_bsdextended/ugidfw_internal.h
@@ -72,8 +72,7 @@ int ugidfw_vnode_check_exec(struct ucred *cred, struct vnode *vp,
int ugidfw_vnode_check_getacl(struct ucred *cred, struct vnode *vp,
struct label *vplabel, acl_type_t type);
int ugidfw_vnode_check_getextattr(struct ucred *cred, struct vnode *vp,
- struct label *vplabel, int attrnamespace, const char *name,
- struct uio *uio);
+ struct label *vplabel, int attrnamespace, const char *name);
int ugidfw_vnode_check_link(struct ucred *cred, struct vnode *dvp,
struct label *dvplabel, struct vnode *vp, struct label *label,
struct componentname *cnp);
@@ -98,8 +97,7 @@ int ugidfw_vnode_check_revoke(struct ucred *cred, struct vnode *vp,
int ugidfw_check_setacl_vnode(struct ucred *cred, struct vnode *vp,
struct label *vplabel, acl_type_t type, struct acl *acl);
int ugidfw_vnode_check_setextattr(struct ucred *cred, struct vnode *vp,
- struct label *vplabel, int attrnamespace, const char *name,
- struct uio *uio);
+ struct label *vplabel, int attrnamespace, const char *name);
int ugidfw_vnode_check_setflags(struct ucred *cred, struct vnode *vp,
struct label *vplabel, u_long flags);
int ugidfw_vnode_check_setmode(struct ucred *cred, struct vnode *vp,
diff --git a/sys/security/mac_bsdextended/ugidfw_vnode.c b/sys/security/mac_bsdextended/ugidfw_vnode.c
index bfcc5ac0c635..8ec2d485bd99 100644
--- a/sys/security/mac_bsdextended/ugidfw_vnode.c
+++ b/sys/security/mac_bsdextended/ugidfw_vnode.c
@@ -127,8 +127,7 @@ ugidfw_vnode_check_getacl(struct ucred *cred, struct vnode *vp,
int
ugidfw_vnode_check_getextattr(struct ucred *cred, struct vnode *vp,
- struct label *vplabel, int attrnamespace, const char *name,
- struct uio *uio)
+ struct label *vplabel, int attrnamespace, const char *name)
{
return (ugidfw_check_vp(cred, vp, MBI_READ));
@@ -236,8 +235,7 @@ ugidfw_check_setacl_vnode(struct ucred *cred, struct vnode *vp,
int
ugidfw_vnode_check_setextattr(struct ucred *cred, struct vnode *vp,
- struct label *vplabel, int attrnamespace, const char *name,
- struct uio *uio)
+ struct label *vplabel, int attrnamespace, const char *name)
{
return (ugidfw_check_vp(cred, vp, MBI_WRITE));
diff --git a/sys/security/mac_lomac/mac_lomac.c b/sys/security/mac_lomac/mac_lomac.c
index da3aa30fa44c..ab41c0a5ac17 100644
--- a/sys/security/mac_lomac/mac_lomac.c
+++ b/sys/security/mac_lomac/mac_lomac.c
@@ -2631,8 +2631,7 @@ lomac_vnode_check_setacl(struct ucred *cred, struct vnode *vp,
static int
lomac_vnode_check_setextattr(struct ucred *cred, struct vnode *vp,
- struct label *vplabel, int attrnamespace, const char *name,
- struct uio *uio)
+ struct label *vplabel, int attrnamespace, const char *name)
{
struct mac_lomac *subj, *obj;
diff --git a/sys/security/mac_mls/mac_mls.c b/sys/security/mac_mls/mac_mls.c
index 0ca6bf324bd9..81030d7adcf1 100644
--- a/sys/security/mac_mls/mac_mls.c
+++ b/sys/security/mac_mls/mac_mls.c
@@ -2398,8 +2398,7 @@ mls_vnode_check_getacl(struct ucred *cred, struct vnode *vp,
static int
mls_vnode_check_getextattr(struct ucred *cred, struct vnode *vp,
- struct label *vplabel, int attrnamespace, const char *name,
- struct uio *uio)
+ struct label *vplabel, int attrnamespace, const char *name)
{
struct mac_mls *subj, *obj;
@@ -2739,8 +2738,7 @@ mls_vnode_check_setacl(struct ucred *cred, struct vnode *vp,
static int
mls_vnode_check_setextattr(struct ucred *cred, struct vnode *vp,
- struct label *vplabel, int attrnamespace, const char *name,
- struct uio *uio)
+ struct label *vplabel, int attrnamespace, const char *name)
{
struct mac_mls *subj, *obj;
diff --git a/sys/security/mac_stub/mac_stub.c b/sys/security/mac_stub/mac_stub.c
index 169198ac5938..cecf2ea9b6fd 100644
--- a/sys/security/mac_stub/mac_stub.c
+++ b/sys/security/mac_stub/mac_stub.c
@@ -1283,8 +1283,7 @@ stub_vnode_check_getacl(struct ucred *cred, struct vnode *vp,
static int
stub_vnode_check_getextattr(struct ucred *cred, struct vnode *vp,
- struct label *vplabel, int attrnamespace, const char *name,
- struct uio *uio)
+ struct label *vplabel, int attrnamespace, const char *name)
{
return (0);
@@ -1422,8 +1421,7 @@ stub_vnode_check_setacl(struct ucred *cred, struct vnode *vp,
static int
stub_vnode_check_setextattr(struct ucred *cred, struct vnode *vp,
- struct label *vplabel, int attrnamespace, const char *name,
- struct uio *uio)
+ struct label *vplabel, int attrnamespace, const char *name)
{
return (0);
diff --git a/sys/security/mac_test/mac_test.c b/sys/security/mac_test/mac_test.c
index 95ce8a3d5fd3..20ca542f4ebf 100644
--- a/sys/security/mac_test/mac_test.c
+++ b/sys/security/mac_test/mac_test.c
@@ -2435,8 +2435,7 @@ test_vnode_check_getacl(struct ucred *cred, struct vnode *vp,
COUNTER_DECL(vnode_check_getextattr);
static int
test_vnode_check_getextattr(struct ucred *cred, struct vnode *vp,
- struct label *vplabel, int attrnamespace, const char *name,
- struct uio *uio)
+ struct label *vplabel, int attrnamespace, const char *name)
{
LABEL_CHECK(cred->cr_label, MAGIC_CRED);
@@ -2642,8 +2641,7 @@ test_vnode_check_setacl(struct ucred *cred, struct vnode *vp,
COUNTER_DECL(vnode_check_setextattr);
static int
test_vnode_check_setextattr(struct ucred *cred, struct vnode *vp,
- struct label *vplabel, int attrnamespace, const char *name,
- struct uio *uio)
+ struct label *vplabel, int attrnamespace, const char *name)
{
LABEL_CHECK(cred->cr_label, MAGIC_CRED);