PERFORCE change 19350 for review
Brian Feldman
green at freebsd.org
Tue Oct 15 21:24:24 GMT 2002
http://perforce.freebsd.org/chv.cgi?CH=19350
Change 19350 by green at green_laptop_2 on 2002/10/15 14:24:24
Fix syscall integ botches.
Affected files ...
.. //depot/projects/trustedbsd/mac/sys/kern/init_sysent.c#37 edit
.. //depot/projects/trustedbsd/mac/sys/kern/syscalls.master#33 edit
.. //depot/projects/trustedbsd/mac/sys/kern/vfs_syscalls.c#89 edit
.. //depot/projects/trustedbsd/mac/sys/security/sebsd/sebsd.c#38 edit
.. //depot/projects/trustedbsd/mac/sys/sys/syscall.h#37 edit
.. //depot/projects/trustedbsd/mac/sys/sys/syscall.mk#36 edit
.. //depot/projects/trustedbsd/mac/sys/sys/sysproto.h#38 edit
Differences ...
==== //depot/projects/trustedbsd/mac/sys/kern/init_sysent.c#37 (text+ko) ====
@@ -2,8 +2,8 @@
* System call switch table.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/kern/init_sysent.c,v 1.137 2002/10/10 04:08:11 rwatson Exp $
- * created from FreeBSD: src/sys/kern/syscalls.master,v 1.128 2002/10/10 04:02:49 rwatson Exp
+ * $FreeBSD$
+ * created from FreeBSD: src/sys/kern/syscalls.master,v 1.129 2002/10/15 01:36:45 peter Exp
*/
#include "opt_compat.h"
@@ -437,9 +437,9 @@
{ SYF_MPSAFE | AS(ksem_unlink_args), (sy_call_t *)lkmressys }, /* 406 = ksem_unlink */
{ SYF_MPSAFE | AS(ksem_getvalue_args), (sy_call_t *)lkmressys }, /* 407 = ksem_getvalue */
{ SYF_MPSAFE | AS(ksem_destroy_args), (sy_call_t *)lkmressys }, /* 408 = ksem_destroy */
- { 0, (sy_call_t *)nosys }, /* 409 = __mac_get_pid */
- { 0, (sy_call_t *)nosys }, /* 410 = __mac_get_link */
- { 0, (sy_call_t *)nosys }, /* 411 = __mac_set_link */
+ { SYF_MPSAFE | AS(__mac_get_pid_args), (sy_call_t *)__mac_get_pid }, /* 409 = __mac_get_pid */
+ { SYF_MPSAFE | AS(__mac_get_link_args), (sy_call_t *)__mac_get_link }, /* 410 = __mac_get_link */
+ { SYF_MPSAFE | AS(__mac_set_link_args), (sy_call_t *)__mac_set_link }, /* 411 = __mac_set_link */
{ AS(extattr_set_link_args), (sy_call_t *)extattr_set_link }, /* 412 = extattr_set_link */
{ AS(extattr_get_link_args), (sy_call_t *)extattr_get_link }, /* 413 = extattr_get_link */
{ AS(extattr_delete_link_args), (sy_call_t *)extattr_delete_link }, /* 414 = extattr_delete_link */
==== //depot/projects/trustedbsd/mac/sys/kern/syscalls.master#33 (text+ko) ====
@@ -30,10 +30,7 @@
; NOSTD implemented but as a lkm that can be statically
; compiled in sysent entry will be filled with lkmsys
; so the SYSCALL_MODULE macro works
-;
-; Please copy any additions and changes to the following compatability tables:
-; sys/ia64/ia32/syscalls.master (take a best guess)
-; [other 64 bit platforms with an alternate 32 bit syscall table go here too]
+
; #ifdef's, etc. may be included, and are copied to the output files.
#include <sys/param.h>
@@ -513,7 +510,7 @@
struct acl *aclp); }
355 STD BSD { int extattrctl(const char *path, int cmd, \
const char *filename, int attrnamespace, \
- const char *attrname); }
+ const char *attrname, void *extended); }
356 STD BSD { int extattr_set_file(const char *path, \
int attrnamespace, const char *attrname, \
void *data, size_t nbytes); }
@@ -587,9 +584,11 @@
406 MNOSTD BSD { int ksem_unlink(const char *name); }
407 MNOSTD BSD { int ksem_getvalue(semid_t id, int *val); }
408 MNOSTD BSD { int ksem_destroy(semid_t id); }
-409 UNIMPL BSD __mac_get_pid
-410 UNIMPL BSD __mac_get_link
-411 UNIMPL BSD __mac_set_link
+409 MSTD BSD { int __mac_get_pid(pid_t pid, struct mac *mac_p); }
+410 MSTD BSD { int __mac_get_link(const char *path_p, \
+ struct mac *mac_p); }
+411 MSTD BSD { int __mac_set_link(const char *path_p, \
+ struct mac *mac_p); }
412 STD BSD { int extattr_set_link(const char *path, \
int attrnamespace, const char *attrname, \
void *data, size_t nbytes); }
==== //depot/projects/trustedbsd/mac/sys/kern/vfs_syscalls.c#89 (text+ko) ====
@@ -3717,6 +3717,7 @@
syscallarg(const char *) filename;
syscallarg(int) attrnamespace;
syscallarg(const char *) attrname;
+ syscallarg(void *) extended;
} */ *uap;
{
struct vnode *filename_vp;
@@ -3769,7 +3770,7 @@
}
error = VFS_EXTATTRCTL(mp, uap->cmd, filename_vp, uap->attrnamespace,
- uap->attrname != NULL ? attrname : NULL, td);
+ uap->attrname != NULL ? attrname : NULL, uap->extended, td);
vn_finished_write(mp_writable);
/*
==== //depot/projects/trustedbsd/mac/sys/security/sebsd/sebsd.c#38 (text+ko) ====
@@ -297,7 +297,8 @@
static void
sebsd_execve_transition(struct ucred *old, struct ucred *new,
- struct vnode *vp, struct mac *vnodelabel)
+ struct vnode *vp, struct mac *vnodelabel,
+ struct vnode *shellvp, struct mac *shellvnodelabel)
{
struct task_security_struct *otask, *ntask;
struct vnode_security_struct *file;
@@ -305,7 +306,10 @@
otask = SLOT(&old->cr_label);
ntask = SLOT(&new->cr_label);
- file = SLOT(&vp->v_label);
+ if (shellvp != NULL)
+ file = SLOT(&shellvp->v_label);
+ else
+ file = SLOT(&vp->v_label);
/*
* Should have already checked all the permissions
@@ -331,7 +335,8 @@
static int
sebsd_execve_will_transition(struct ucred *old, struct vnode *vp,
- struct mac *vnodelabel)
+ struct mac *vnodelabel, struct vnode *shellvp,
+ struct mac *shellvnodelabel)
{
struct task_security_struct *task;
struct vnode_security_struct *file;
@@ -339,7 +344,10 @@
int rc;
task = SLOT(&old->cr_label);
- file = SLOT(&vp->v_label);
+ if (shellvp != NULL)
+ file = SLOT(&shellvp->v_label);
+ else
+ file = SLOT(&vp->v_label);
/*
* Should have already checked all the permissions, so just see if
==== //depot/projects/trustedbsd/mac/sys/sys/syscall.h#37 (text+ko) ====
@@ -2,8 +2,8 @@
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/sys/syscall.h,v 1.121 2002/10/10 04:08:11 rwatson Exp $
- * created from FreeBSD: src/sys/kern/syscalls.master,v 1.128 2002/10/10 04:02:49 rwatson Exp
+ * $FreeBSD$
+ * created from FreeBSD: src/sys/kern/syscalls.master,v 1.129 2002/10/15 01:36:45 peter Exp
*/
#define SYS_syscall 0
@@ -317,6 +317,9 @@
#define SYS_ksem_unlink 406
#define SYS_ksem_getvalue 407
#define SYS_ksem_destroy 408
+#define SYS___mac_get_pid 409
+#define SYS___mac_get_link 410
+#define SYS___mac_set_link 411
#define SYS_extattr_set_link 412
#define SYS_extattr_get_link 413
#define SYS_extattr_delete_link 414
==== //depot/projects/trustedbsd/mac/sys/sys/syscall.mk#36 (text+ko) ====
@@ -1,7 +1,7 @@
# FreeBSD system call names.
# DO NOT EDIT-- this file is automatically generated.
-# $FreeBSD: src/sys/sys/syscall.mk,v 1.76 2002/10/10 04:08:11 rwatson Exp $
-# created from FreeBSD: src/sys/kern/syscalls.master,v 1.128 2002/10/10 04:02:49 rwatson Exp
+# $FreeBSD$
+# created from FreeBSD: src/sys/kern/syscalls.master,v 1.129 2002/10/15 01:36:45 peter Exp
MIASM = \
syscall.o \
exit.o \
@@ -266,6 +266,9 @@
ksem_unlink.o \
ksem_getvalue.o \
ksem_destroy.o \
+ __mac_get_pid.o \
+ __mac_get_link.o \
+ __mac_set_link.o \
extattr_set_link.o \
extattr_get_link.o \
extattr_delete_link.o
==== //depot/projects/trustedbsd/mac/sys/sys/sysproto.h#38 (text+ko) ====
@@ -2,8 +2,8 @@
* System call prototypes.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/sys/sysproto.h,v 1.114 2002/10/10 04:08:11 rwatson Exp $
- * created from FreeBSD: src/sys/kern/syscalls.master,v 1.128 2002/10/10 04:02:49 rwatson Exp
+ * $FreeBSD$
+ * created from FreeBSD: src/sys/kern/syscalls.master,v 1.129 2002/10/15 01:36:45 peter Exp
*/
#ifndef _SYS_SYSPROTO_H_
@@ -978,6 +978,7 @@
char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)];
char attrnamespace_l_[PADL_(int)]; int attrnamespace; char attrnamespace_r_[PADR_(int)];
char attrname_l_[PADL_(const char *)]; const char * attrname; char attrname_r_[PADR_(const char *)];
+ char extended_l_[PADL_(void *)]; void * extended; char extended_r_[PADR_(void *)];
};
struct extattr_set_file_args {
char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
@@ -1157,6 +1158,18 @@
struct ksem_destroy_args {
char id_l_[PADL_(semid_t)]; semid_t id; char id_r_[PADR_(semid_t)];
};
+struct __mac_get_pid_args {
+ char pid_l_[PADL_(pid_t)]; pid_t pid; char pid_r_[PADR_(pid_t)];
+ char mac_p_l_[PADL_(struct mac *)]; struct mac * mac_p; char mac_p_r_[PADR_(struct mac *)];
+};
+struct __mac_get_link_args {
+ char path_p_l_[PADL_(const char *)]; const char * path_p; char path_p_r_[PADR_(const char *)];
+ char mac_p_l_[PADL_(struct mac *)]; struct mac * mac_p; char mac_p_r_[PADR_(struct mac *)];
+};
+struct __mac_set_link_args {
+ char path_p_l_[PADL_(const char *)]; const char * path_p; char path_p_r_[PADR_(const char *)];
+ char mac_p_l_[PADL_(struct mac *)]; struct mac * mac_p; char mac_p_r_[PADR_(struct mac *)];
+};
struct extattr_set_link_args {
char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char attrnamespace_l_[PADL_(int)]; int attrnamespace; char attrnamespace_r_[PADR_(int)];
@@ -1438,6 +1451,9 @@
int ksem_unlink(struct thread *, struct ksem_unlink_args *);
int ksem_getvalue(struct thread *, struct ksem_getvalue_args *);
int ksem_destroy(struct thread *, struct ksem_destroy_args *);
+int __mac_get_pid(struct thread *, struct __mac_get_pid_args *);
+int __mac_get_link(struct thread *, struct __mac_get_link_args *);
+int __mac_set_link(struct thread *, struct __mac_set_link_args *);
int extattr_set_link(struct thread *, struct extattr_set_link_args *);
int extattr_get_link(struct thread *, struct extattr_get_link_args *);
int extattr_delete_link(struct thread *, struct extattr_delete_link_args *);
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