From owner-p4-projects@FreeBSD.ORG Fri Jul 28 20:12:15 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6268016A4DE; Fri, 28 Jul 2006 20:12:15 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 28D1616A4DA for ; Fri, 28 Jul 2006 20:12:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E045C43D45 for ; Fri, 28 Jul 2006 20:12:14 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k6SKCEQP081298 for ; Fri, 28 Jul 2006 20:12:14 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k6SKCElo081295 for perforce@freebsd.org; Fri, 28 Jul 2006 20:12:14 GMT (envelope-from jhb@freebsd.org) Date: Fri, 28 Jul 2006 20:12:14 GMT Message-Id: <200607282012.k6SKCElo081295@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 102682 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jul 2006 20:12:15 -0000 http://perforce.freebsd.org/chv.cgi?CH=102682 Change 102682 by jhb@jhb_mutex on 2006/07/28 20:11:51 Include a new set of macros: SYS_AUE_foo in sysproto.h which resolve to the audit event for syscall 'foo' and make use of this in SYSCALL_MODULE_HELPER to define the correct audit events for system calls in loadable modules (e.g. sysv IPC). Affected files ... .. //depot/projects/smpng/sys/kern/makesyscalls.sh#19 edit .. //depot/projects/smpng/sys/sys/sysent.h#15 edit Differences ... ==== //depot/projects/smpng/sys/kern/makesyscalls.sh#19 (text+ko) ==== @@ -20,6 +20,7 @@ namesname="syscallnames" # tmp files: +sysaue="sysent.aue.$$" sysdcl="sysent.dcl.$$" syscompat="sysent.compat.$$" syscompatdcl="sysent.compatdcl.$$" @@ -30,9 +31,9 @@ sysarg="sysarg.switch.$$" sysprotoend="sysprotoend.$$" -trap "rm $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $sysent $sysinc $sysarg $sysprotoend" 0 +trap "rm $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $sysent $sysinc $sysarg $sysprotoend" 0 -touch $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $sysent $sysinc $sysarg $sysprotoend +touch $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $sysent $sysinc $sysarg $sysprotoend case $# in 0) echo "usage: $0 input-file " 1>&2 @@ -58,6 +59,7 @@ } ' < $1 | awk " BEGIN { + sysaue = \"$sysaue\" sysdcl = \"$sysdcl\" sysproto = \"$sysproto\" sysprotoend = \"$sysprotoend\" @@ -121,6 +123,7 @@ printf "#include \n" > sysarg printf "#include \n\n" > sysarg printf "#include \n\n" > sysarg + printf "#include \n\n" > sysarg printf "struct proc;\n\n" > sysarg printf "struct thread;\n\n" > sysarg printf "#define\tPAD_(t)\t(sizeof(register_t) <= sizeof(t) ? \\\n" > sysarg @@ -315,6 +318,8 @@ printf("%s\t%s(struct thread *, struct %s *)", rettype, funcname, argalias) > sysdcl printf(";\n") > sysdcl + printf("#define\t%sAUE_%s\t%s\n", syscallprefix, + funcalias, auditev) > sysaue } if (funcname == "nosys") nosys = 1 @@ -453,7 +458,7 @@ printf("\n#endif /* %s */\n\n", compat4) > syscompat4dcl - printf("#undef PAD_\n") > sysprotoend + printf("\n#undef PAD_\n") > sysprotoend printf("#undef PADL_\n") > sysprotoend printf("#undef PADR_\n") > sysprotoend printf("\n#endif /* !%s */\n", sysproto_h) > sysprotoend @@ -469,5 +474,5 @@ cat $sysarg $sysdcl \ $syscompat $syscompatdcl \ $syscompat4 $syscompat4dcl \ - $sysprotoend > $sysproto + $sysaue $sysprotoend > $sysproto ==== //depot/projects/smpng/sys/sys/sysent.h#15 (text+ko) ==== @@ -118,12 +118,13 @@ }; \ DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE) -#define SYSCALL_MODULE_HELPER(syscallname) \ +#define SYSCALL_MODULE_HELPER(syscallname) \ static int syscallname##_syscall = SYS_##syscallname; \ static struct sysent syscallname##_sysent = { \ (sizeof(struct syscallname ## _args ) \ / sizeof(register_t)), \ - (sy_call_t *)& syscallname \ + (sy_call_t *)& syscallname, \ + SYS_AUE_##syscallname \ }; \ SYSCALL_MODULE(syscallname, \ & syscallname##_syscall, & syscallname##_sysent, \