Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F136138985
D53755.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D53755.id.diff
View Options
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -635,12 +635,7 @@
#ifdef MAC
if ((flags & SETCREDF_MAC_LABEL) != 0) {
-#ifdef COMPAT_FREEBSD32
- if (is_32bit)
- error = mac_label_copyin32(umac, &mac, NULL);
- else
-#endif
- error = mac_label_copyin(umac, &mac, NULL);
+ error = mac_label_copyin(umac, &mac, NULL);
if (error != 0)
goto free_groups;
wcred.sc_label = &mac;
diff --git a/sys/security/mac/mac_syscalls.h b/sys/security/mac/mac_syscalls.h
--- a/sys/security/mac/mac_syscalls.h
+++ b/sys/security/mac/mac_syscalls.h
@@ -23,13 +23,6 @@
char **const u_string);
void free_copied_label(const struct mac *const mac);
-#ifdef COMPAT_FREEBSD32
-struct mac32;
-
-int mac_label_copyin32(const struct mac32 *const u_mac,
- struct mac *const mac, char **const u_string);
-#endif /* COMPAT_FREEBSD32 */
-
int mac_set_proc_prepare(struct thread *const td,
const struct mac *const mac, void **const mac_set_proc_data);
int mac_set_proc_core(struct thread *const td, struct ucred *const newcred,
diff --git a/sys/security/mac/mac_syscalls.c b/sys/security/mac/mac_syscalls.c
--- a/sys/security/mac/mac_syscalls.c
+++ b/sys/security/mac/mac_syscalls.c
@@ -57,6 +57,7 @@
#include <sys/proc.h>
#include <sys/systm.h>
#include <sys/sysctl.h>
+#include <sys/sysent.h>
#include <sys/sysproto.h>
#include <sys/vnode.h>
#include <sys/mount.h>
@@ -94,15 +95,15 @@
* after use by calling free_copied_label() (which see). On success, 'u_string'
* if not NULL is filled with the userspace address for 'u_mac->m_string'.
*/
-static int
-mac_label_copyin_impl(const void *const u_mac, struct mac *const mac,
- char **const u_string, bool is_32bit)
+int
+mac_label_copyin(const struct mac *const u_mac, struct mac *const mac,
+ char **const u_string)
{
char *buffer;
int error;
#ifdef COMPAT_FREEBSD32
- if (is_32bit) {
+ if (SV_CURPROC_FLAG(SV_ILP32)) {
struct mac32 mac32;
error = copyin(u_mac, &mac32, sizeof(mac32));
@@ -138,28 +139,12 @@
return (0);
}
-int
-mac_label_copyin(const struct mac *const u_mac, struct mac *const mac,
- char **const u_string)
-{
- return (mac_label_copyin_impl(u_mac, mac, u_string, false));
-}
-
void
free_copied_label(const struct mac *const mac)
{
free(mac->m_string, M_MACTEMP);
}
-#ifdef COMPAT_FREEBSD32
-int
-mac_label_copyin32(const struct mac32 *const u_mac,
- struct mac *const mac, char **const u_string)
-{
- return (mac_label_copyin_impl(u_mac, mac, u_string, true));
-}
-#endif
-
int
sys___mac_get_pid(struct thread *td, struct __mac_get_pid_args *uap)
{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 17, 2:41 AM (21 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25352910
Default Alt Text
D53755.id.diff (2 KB)
Attached To
Mode
D53755: MAC: Use the current thread's user ABI to determine the layout of struct mac
Attached
Detach File
Event Timeline
Log In to Comment