From 931f0826ea94ec758baa23638aee1650e017b8e7 Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Sat, 26 Mar 2011 10:59:24 +0000 Subject: [PATCH] linux compat: add non-dummy capget and capset system calls, regenerate And drop dummy definitions for those system calls. This may transiently break the build. PR: kern/149168 Submitted by: John Wehle Reviewed by: netchild MFC after: 2 weeks --- sys/amd64/linux32/linux32_dummy.c | 2 -- sys/amd64/linux32/linux32_proto.h | 8 +++--- sys/amd64/linux32/linux32_syscall.h | 2 +- sys/amd64/linux32/linux32_syscalls.c | 2 +- sys/amd64/linux32/linux32_sysent.c | 6 ++--- sys/amd64/linux32/linux32_systrace_args.c | 30 +++++++++++++++++++++-- sys/i386/linux/linux_dummy.c | 2 -- sys/i386/linux/linux_proto.h | 8 +++--- sys/i386/linux/linux_syscall.h | 2 +- sys/i386/linux/linux_syscalls.c | 2 +- sys/i386/linux/linux_sysent.c | 6 ++--- sys/i386/linux/linux_systrace_args.c | 30 +++++++++++++++++++++-- 12 files changed, 76 insertions(+), 24 deletions(-) diff --git a/sys/amd64/linux32/linux32_dummy.c b/sys/amd64/linux32/linux32_dummy.c index c20f422f4a37..a147b91c17c0 100644 --- a/sys/amd64/linux32/linux32_dummy.c +++ b/sys/amd64/linux32/linux32_dummy.c @@ -54,8 +54,6 @@ DUMMY(sysfs); DUMMY(query_module); DUMMY(nfsservctl); DUMMY(rt_sigqueueinfo); -DUMMY(capget); -DUMMY(capset); DUMMY(sendfile); DUMMY(setfsuid); DUMMY(setfsgid); diff --git a/sys/amd64/linux32/linux32_proto.h b/sys/amd64/linux32/linux32_proto.h index be7ef5d9a381..0fa4358ccf7b 100644 --- a/sys/amd64/linux32/linux32_proto.h +++ b/sys/amd64/linux32/linux32_proto.h @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 219559 2011-03-12 08:51:43Z avg + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 220028 2011-03-26 10:51:56Z avg */ #ifndef _LINUX_SYSPROTO_H_ @@ -589,10 +589,12 @@ struct linux_getcwd_args { char bufsize_l_[PADL_(l_ulong)]; l_ulong bufsize; char bufsize_r_[PADR_(l_ulong)]; }; struct linux_capget_args { - register_t dummy; + char hdrp_l_[PADL_(struct l_user_cap_header *)]; struct l_user_cap_header * hdrp; char hdrp_r_[PADR_(struct l_user_cap_header *)]; + char datap_l_[PADL_(struct l_user_cap_data *)]; struct l_user_cap_data * datap; char datap_r_[PADR_(struct l_user_cap_data *)]; }; struct linux_capset_args { - register_t dummy; + char hdrp_l_[PADL_(struct l_user_cap_header *)]; struct l_user_cap_header * hdrp; char hdrp_r_[PADR_(struct l_user_cap_header *)]; + char datap_l_[PADL_(struct l_user_cap_data *)]; struct l_user_cap_data * datap; char datap_r_[PADR_(struct l_user_cap_data *)]; }; struct linux_sigaltstack_args { char uss_l_[PADL_(l_stack_t *)]; l_stack_t * uss; char uss_r_[PADR_(l_stack_t *)]; diff --git a/sys/amd64/linux32/linux32_syscall.h b/sys/amd64/linux32/linux32_syscall.h index cee74f1cf1b2..edd9a03ed474 100644 --- a/sys/amd64/linux32/linux32_syscall.h +++ b/sys/amd64/linux32/linux32_syscall.h @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 219559 2011-03-12 08:51:43Z avg + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 220028 2011-03-26 10:51:56Z avg */ #define LINUX_SYS_exit 1 diff --git a/sys/amd64/linux32/linux32_syscalls.c b/sys/amd64/linux32/linux32_syscalls.c index 2f7b945cf217..5a95e8e4a172 100644 --- a/sys/amd64/linux32/linux32_syscalls.c +++ b/sys/amd64/linux32/linux32_syscalls.c @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 219559 2011-03-12 08:51:43Z avg + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 220028 2011-03-26 10:51:56Z avg */ const char *linux_syscallnames[] = { diff --git a/sys/amd64/linux32/linux32_sysent.c b/sys/amd64/linux32/linux32_sysent.c index 7320e8729e8d..c1a864f261f8 100644 --- a/sys/amd64/linux32/linux32_sysent.c +++ b/sys/amd64/linux32/linux32_sysent.c @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 219559 2011-03-12 08:51:43Z avg + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 220028 2011-03-26 10:51:56Z avg */ #include "opt_compat.h" @@ -203,8 +203,8 @@ struct sysent linux_sysent[] = { { AS(linux_pwrite_args), (sy_call_t *)linux_pwrite, AUE_PWRITE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 181 = linux_pwrite */ { AS(linux_chown16_args), (sy_call_t *)linux_chown16, AUE_CHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 182 = linux_chown16 */ { AS(linux_getcwd_args), (sy_call_t *)linux_getcwd, AUE_GETCWD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 183 = linux_getcwd */ - { 0, (sy_call_t *)linux_capget, AUE_CAPGET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 184 = linux_capget */ - { 0, (sy_call_t *)linux_capset, AUE_CAPSET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 185 = linux_capset */ + { AS(linux_capget_args), (sy_call_t *)linux_capget, AUE_CAPGET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 184 = linux_capget */ + { AS(linux_capset_args), (sy_call_t *)linux_capset, AUE_CAPSET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 185 = linux_capset */ { AS(linux_sigaltstack_args), (sy_call_t *)linux_sigaltstack, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 186 = linux_sigaltstack */ { 0, (sy_call_t *)linux_sendfile, AUE_SENDFILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 187 = linux_sendfile */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 188 = getpmsg */ diff --git a/sys/amd64/linux32/linux32_systrace_args.c b/sys/amd64/linux32/linux32_systrace_args.c index 68fb8e89ab53..42f0b331ea7d 100644 --- a/sys/amd64/linux32/linux32_systrace_args.c +++ b/sys/amd64/linux32/linux32_systrace_args.c @@ -1284,12 +1284,18 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) } /* linux_capget */ case 184: { - *n_args = 0; + struct linux_capget_args *p = params; + uarg[0] = (intptr_t) p->hdrp; /* struct l_user_cap_header * */ + uarg[1] = (intptr_t) p->datap; /* struct l_user_cap_data * */ + *n_args = 2; break; } /* linux_capset */ case 185: { - *n_args = 0; + struct linux_capset_args *p = params; + uarg[0] = (intptr_t) p->hdrp; /* struct l_user_cap_header * */ + uarg[1] = (intptr_t) p->datap; /* struct l_user_cap_data * */ + *n_args = 2; break; } /* linux_sigaltstack */ @@ -4051,9 +4057,29 @@ systrace_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; /* linux_capget */ case 184: + switch(ndx) { + case 0: + p = "struct l_user_cap_header *"; + break; + case 1: + p = "struct l_user_cap_data *"; + break; + default: + break; + }; break; /* linux_capset */ case 185: + switch(ndx) { + case 0: + p = "struct l_user_cap_header *"; + break; + case 1: + p = "struct l_user_cap_data *"; + break; + default: + break; + }; break; /* linux_sigaltstack */ case 186: diff --git a/sys/i386/linux/linux_dummy.c b/sys/i386/linux/linux_dummy.c index f0473612e107..bc300b1b9fd2 100644 --- a/sys/i386/linux/linux_dummy.c +++ b/sys/i386/linux/linux_dummy.c @@ -57,8 +57,6 @@ DUMMY(vm86); DUMMY(query_module); DUMMY(nfsservctl); DUMMY(rt_sigqueueinfo); -DUMMY(capget); -DUMMY(capset); DUMMY(sendfile); /* different semantics */ DUMMY(setfsuid); DUMMY(setfsgid); diff --git a/sys/i386/linux/linux_proto.h b/sys/i386/linux/linux_proto.h index 96635a004f9b..6f51bb2a8b7c 100644 --- a/sys/i386/linux/linux_proto.h +++ b/sys/i386/linux/linux_proto.h @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 219559 2011-03-12 08:51:43Z avg + * created from FreeBSD: head/sys/i386/linux/syscalls.master 220028 2011-03-26 10:51:56Z avg */ #ifndef _LINUX_SYSPROTO_H_ @@ -586,10 +586,12 @@ struct linux_getcwd_args { char bufsize_l_[PADL_(l_ulong)]; l_ulong bufsize; char bufsize_r_[PADR_(l_ulong)]; }; struct linux_capget_args { - register_t dummy; + char hdrp_l_[PADL_(struct l_user_cap_header *)]; struct l_user_cap_header * hdrp; char hdrp_r_[PADR_(struct l_user_cap_header *)]; + char datap_l_[PADL_(struct l_user_cap_data *)]; struct l_user_cap_data * datap; char datap_r_[PADR_(struct l_user_cap_data *)]; }; struct linux_capset_args { - register_t dummy; + char hdrp_l_[PADL_(struct l_user_cap_header *)]; struct l_user_cap_header * hdrp; char hdrp_r_[PADR_(struct l_user_cap_header *)]; + char datap_l_[PADL_(struct l_user_cap_data *)]; struct l_user_cap_data * datap; char datap_r_[PADR_(struct l_user_cap_data *)]; }; struct linux_sigaltstack_args { char uss_l_[PADL_(l_stack_t *)]; l_stack_t * uss; char uss_r_[PADR_(l_stack_t *)]; diff --git a/sys/i386/linux/linux_syscall.h b/sys/i386/linux/linux_syscall.h index a75decd62e4a..a00963c52a5c 100644 --- a/sys/i386/linux/linux_syscall.h +++ b/sys/i386/linux/linux_syscall.h @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 219559 2011-03-12 08:51:43Z avg + * created from FreeBSD: head/sys/i386/linux/syscalls.master 220028 2011-03-26 10:51:56Z avg */ #define LINUX_SYS_exit 1 diff --git a/sys/i386/linux/linux_syscalls.c b/sys/i386/linux/linux_syscalls.c index 48453fb8f28c..6f10d5dd31c8 100644 --- a/sys/i386/linux/linux_syscalls.c +++ b/sys/i386/linux/linux_syscalls.c @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 219559 2011-03-12 08:51:43Z avg + * created from FreeBSD: head/sys/i386/linux/syscalls.master 220028 2011-03-26 10:51:56Z avg */ const char *linux_syscallnames[] = { diff --git a/sys/i386/linux/linux_sysent.c b/sys/i386/linux/linux_sysent.c index 9e8a8f896201..509df3e570b9 100644 --- a/sys/i386/linux/linux_sysent.c +++ b/sys/i386/linux/linux_sysent.c @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 219559 2011-03-12 08:51:43Z avg + * created from FreeBSD: head/sys/i386/linux/syscalls.master 220028 2011-03-26 10:51:56Z avg */ #include @@ -202,8 +202,8 @@ struct sysent linux_sysent[] = { { AS(linux_pwrite_args), (sy_call_t *)linux_pwrite, AUE_PWRITE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 181 = linux_pwrite */ { AS(linux_chown16_args), (sy_call_t *)linux_chown16, AUE_CHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 182 = linux_chown16 */ { AS(linux_getcwd_args), (sy_call_t *)linux_getcwd, AUE_GETCWD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 183 = linux_getcwd */ - { 0, (sy_call_t *)linux_capget, AUE_CAPGET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 184 = linux_capget */ - { 0, (sy_call_t *)linux_capset, AUE_CAPSET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 185 = linux_capset */ + { AS(linux_capget_args), (sy_call_t *)linux_capget, AUE_CAPGET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 184 = linux_capget */ + { AS(linux_capset_args), (sy_call_t *)linux_capset, AUE_CAPSET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 185 = linux_capset */ { AS(linux_sigaltstack_args), (sy_call_t *)linux_sigaltstack, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 186 = linux_sigaltstack */ { 0, (sy_call_t *)linux_sendfile, AUE_SENDFILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 187 = linux_sendfile */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 188 = getpmsg */ diff --git a/sys/i386/linux/linux_systrace_args.c b/sys/i386/linux/linux_systrace_args.c index f183c043e071..ce454240139f 100644 --- a/sys/i386/linux/linux_systrace_args.c +++ b/sys/i386/linux/linux_systrace_args.c @@ -1327,12 +1327,18 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) } /* linux_capget */ case 184: { - *n_args = 0; + struct linux_capget_args *p = params; + uarg[0] = (intptr_t) p->hdrp; /* struct l_user_cap_header * */ + uarg[1] = (intptr_t) p->datap; /* struct l_user_cap_data * */ + *n_args = 2; break; } /* linux_capset */ case 185: { - *n_args = 0; + struct linux_capset_args *p = params; + uarg[0] = (intptr_t) p->hdrp; /* struct l_user_cap_header * */ + uarg[1] = (intptr_t) p->datap; /* struct l_user_cap_data * */ + *n_args = 2; break; } /* linux_sigaltstack */ @@ -4203,9 +4209,29 @@ systrace_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; /* linux_capget */ case 184: + switch(ndx) { + case 0: + p = "struct l_user_cap_header *"; + break; + case 1: + p = "struct l_user_cap_data *"; + break; + default: + break; + }; break; /* linux_capset */ case 185: + switch(ndx) { + case 0: + p = "struct l_user_cap_header *"; + break; + case 1: + p = "struct l_user_cap_data *"; + break; + default: + break; + }; break; /* linux_sigaltstack */ case 186: