Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108410651
D14488.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D14488.diff
View Options
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -3442,7 +3442,7 @@
so, &extmac);
if (error)
goto bad;
- error = sooptcopyout(sopt, &extmac, sizeof extmac);
+ /* Don't copy out extmac, it is unchanged. */
#else
error = EOPNOTSUPP;
#endif
@@ -3458,7 +3458,7 @@
sopt->sopt_td->td_ucred, so, &extmac);
if (error)
goto bad;
- error = sooptcopyout(sopt, &extmac, sizeof extmac);
+ /* Don't copy out extmac, it is unchanged. */
#else
error = EOPNOTSUPP;
#endif
diff --git a/sys/security/mac/mac_framework.h b/sys/security/mac/mac_framework.h
--- a/sys/security/mac/mac_framework.h
+++ b/sys/security/mac/mac_framework.h
@@ -408,11 +408,11 @@
int mac_socket_init(struct socket *, int);
void mac_socket_newconn(struct socket *oldso, struct socket *newso);
int mac_getsockopt_label(struct ucred *cred, struct socket *so,
- struct mac *extmac);
+ const struct mac *extmac);
int mac_getsockopt_peerlabel(struct ucred *cred, struct socket *so,
- struct mac *extmac);
+ const struct mac *extmac);
int mac_setsockopt_label(struct ucred *cred, struct socket *so,
- struct mac *extmac);
+ const struct mac *extmac);
void mac_socketpeer_set_from_mbuf(struct mbuf *m, struct socket *so);
void mac_socketpeer_set_from_socket(struct socket *oldso,
diff --git a/sys/security/mac/mac_framework.c b/sys/security/mac/mac_framework.c
--- a/sys/security/mac/mac_framework.c
+++ b/sys/security/mac/mac_framework.c
@@ -725,9 +725,8 @@
}
int
-mac_check_structmac_consistent(struct mac *mac)
+mac_check_structmac_consistent(const struct mac *mac)
{
-
/* Require that labels have a non-zero length. */
if (mac->m_buflen > MAC_MAX_LABEL_BUF_LEN ||
mac->m_buflen <= sizeof(""))
diff --git a/sys/security/mac/mac_internal.h b/sys/security/mac/mac_internal.h
--- a/sys/security/mac/mac_internal.h
+++ b/sys/security/mac/mac_internal.h
@@ -210,7 +210,7 @@
void mac_init_label(struct label *label);
void mac_destroy_label(struct label *label);
-int mac_check_structmac_consistent(struct mac *mac);
+int mac_check_structmac_consistent(const struct mac *mac);
int mac_allocate_slot(void);
/*
diff --git a/sys/security/mac/mac_socket.c b/sys/security/mac/mac_socket.c
--- a/sys/security/mac/mac_socket.c
+++ b/sys/security/mac/mac_socket.c
@@ -521,7 +521,8 @@
}
int
-mac_setsockopt_label(struct ucred *cred, struct socket *so, struct mac *mac)
+mac_setsockopt_label(struct ucred *cred, struct socket *so,
+ const struct mac *mac)
{
struct label *intlabel;
char *buffer;
@@ -554,7 +555,8 @@
}
int
-mac_getsockopt_label(struct ucred *cred, struct socket *so, struct mac *mac)
+mac_getsockopt_label(struct ucred *cred, struct socket *so,
+ const struct mac *mac)
{
char *buffer, *elements;
struct label *intlabel;
@@ -593,7 +595,7 @@
int
mac_getsockopt_peerlabel(struct ucred *cred, struct socket *so,
- struct mac *mac)
+ const struct mac *mac)
{
char *elements, *buffer;
struct label *intlabel;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 25, 1:49 PM (17 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16146166
Default Alt Text
D14488.diff (3 KB)
Attached To
Mode
D14488: Remove gratuitous copyouts of unchanged struct mac.
Attached
Detach File
Event Timeline
Log In to Comment