summaryrefslogtreecommitdiffstats
path: root/sys/kern/init_sysent.c
diff options
context:
space:
mode:
authorcsjp <csjp@FreeBSD.org>2005-09-24 23:47:04 +0000
committercsjp <csjp@FreeBSD.org>2005-09-24 23:47:04 +0000
commit2c840e0d4e7aab9b8ec257561b86f371e6bd6dbe (patch)
treefc76a93a93e61aa3b7c886c9d66fc2c7d773baaf /sys/kern/init_sysent.c
parent3b94f1f11456e1d6262201f2798870579d745791 (diff)
downloadFreeBSD-src-2c840e0d4e7aab9b8ec257561b86f371e6bd6dbe.zip
FreeBSD-src-2c840e0d4e7aab9b8ec257561b86f371e6bd6dbe.tar.gz
Implement new world order in VFS locking for extended attributes. This will
remove the unconditional acquisition of Giant for extended attribute related operations. If the file system is set as being MP safe and debug.mpsafevfs is 1, do not pickup Giant. Mark the following system calls as being MP safe so we no longer pickup Giant in the system call handler: o extattrctl o extattr_set_file o extattr_get_file o extattr_delete_file o extattr_set_fd o extattr_get_fd o extattr_delete_fd o extattr_set_link o extattr_get_link o extattr_delete_link o extattr_list_file o extattr_list_link o extattr_list_fd -Pass MPSAFE flags to namei(9) lookup and introduce vfslocked variable which will keep track of any Giant acquisitions. -Wrap any fd operations which manipulate vnodes in VFS_{UN}LOCK_GIANT -Drop VFS_ASSERT_GIANT into function which operate on vnodes to ensure that we are sufficiently protected. I've tested these changes with various TrustedBSD MAC policies which use extended attribute a lot on SMP and UP systems (thanks to Scott Long for making some SMP hardware available to me for testing). Discussed with: jeff Requested by: jhb, rwatson
Diffstat (limited to 'sys/kern/init_sysent.c')
-rw-r--r--sys/kern/init_sysent.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c
index e67baf2..03a0d6e 100644
--- a/sys/kern/init_sysent.c
+++ b/sys/kern/init_sysent.c
@@ -384,10 +384,10 @@ struct sysent sysent[] = {
{ SYF_MPSAFE | AS(__acl_delete_fd_args), (sy_call_t *)__acl_delete_fd, AUE_NULL }, /* 352 = __acl_delete_fd */
{ SYF_MPSAFE | AS(__acl_aclcheck_file_args), (sy_call_t *)__acl_aclcheck_file, AUE_NULL }, /* 353 = __acl_aclcheck_file */
{ SYF_MPSAFE | AS(__acl_aclcheck_fd_args), (sy_call_t *)__acl_aclcheck_fd, AUE_NULL }, /* 354 = __acl_aclcheck_fd */
- { AS(extattrctl_args), (sy_call_t *)extattrctl, AUE_NULL }, /* 355 = extattrctl */
- { AS(extattr_set_file_args), (sy_call_t *)extattr_set_file, AUE_NULL }, /* 356 = extattr_set_file */
- { AS(extattr_get_file_args), (sy_call_t *)extattr_get_file, AUE_NULL }, /* 357 = extattr_get_file */
- { AS(extattr_delete_file_args), (sy_call_t *)extattr_delete_file, AUE_NULL }, /* 358 = extattr_delete_file */
+ { SYF_MPSAFE | AS(extattrctl_args), (sy_call_t *)extattrctl, AUE_NULL }, /* 355 = extattrctl */
+ { SYF_MPSAFE | AS(extattr_set_file_args), (sy_call_t *)extattr_set_file, AUE_NULL }, /* 356 = extattr_set_file */
+ { SYF_MPSAFE | AS(extattr_get_file_args), (sy_call_t *)extattr_get_file, AUE_NULL }, /* 357 = extattr_get_file */
+ { SYF_MPSAFE | AS(extattr_delete_file_args), (sy_call_t *)extattr_delete_file, AUE_NULL }, /* 358 = extattr_delete_file */
{ AS(aio_waitcomplete_args), (sy_call_t *)lkmressys, AUE_NULL }, /* 359 = aio_waitcomplete */
{ SYF_MPSAFE | AS(getresuid_args), (sy_call_t *)getresuid, AUE_NULL }, /* 360 = getresuid */
{ SYF_MPSAFE | AS(getresgid_args), (sy_call_t *)getresgid, AUE_NULL }, /* 361 = getresgid */
@@ -400,9 +400,9 @@ struct sysent sysent[] = {
{ 0, (sy_call_t *)nosys, AUE_NULL }, /* 368 = __cap_set_fd */
{ 0, (sy_call_t *)nosys, AUE_NULL }, /* 369 = __cap_set_file */
{ AS(nosys_args), (sy_call_t *)lkmressys, AUE_NULL }, /* 370 = lkmressys */
- { AS(extattr_set_fd_args), (sy_call_t *)extattr_set_fd, AUE_NULL }, /* 371 = extattr_set_fd */
- { AS(extattr_get_fd_args), (sy_call_t *)extattr_get_fd, AUE_NULL }, /* 372 = extattr_get_fd */
- { AS(extattr_delete_fd_args), (sy_call_t *)extattr_delete_fd, AUE_NULL }, /* 373 = extattr_delete_fd */
+ { SYF_MPSAFE | AS(extattr_set_fd_args), (sy_call_t *)extattr_set_fd, AUE_NULL }, /* 371 = extattr_set_fd */
+ { SYF_MPSAFE | AS(extattr_get_fd_args), (sy_call_t *)extattr_get_fd, AUE_NULL }, /* 372 = extattr_get_fd */
+ { SYF_MPSAFE | AS(extattr_delete_fd_args), (sy_call_t *)extattr_delete_fd, AUE_NULL }, /* 373 = extattr_delete_fd */
{ SYF_MPSAFE | AS(__setugid_args), (sy_call_t *)__setugid, AUE_NULL }, /* 374 = __setugid */
{ AS(nfsclnt_args), (sy_call_t *)nosys, AUE_NULL }, /* 375 = nfsclnt */
{ SYF_MPSAFE | AS(eaccess_args), (sy_call_t *)eaccess, AUE_NULL }, /* 376 = eaccess */
@@ -441,9 +441,9 @@ struct sysent sysent[] = {
{ SYF_MPSAFE | AS(__mac_get_pid_args), (sy_call_t *)__mac_get_pid, AUE_NULL }, /* 409 = __mac_get_pid */
{ SYF_MPSAFE | AS(__mac_get_link_args), (sy_call_t *)__mac_get_link, AUE_NULL }, /* 410 = __mac_get_link */
{ SYF_MPSAFE | AS(__mac_set_link_args), (sy_call_t *)__mac_set_link, AUE_NULL }, /* 411 = __mac_set_link */
- { AS(extattr_set_link_args), (sy_call_t *)extattr_set_link, AUE_NULL }, /* 412 = extattr_set_link */
- { AS(extattr_get_link_args), (sy_call_t *)extattr_get_link, AUE_NULL }, /* 413 = extattr_get_link */
- { AS(extattr_delete_link_args), (sy_call_t *)extattr_delete_link, AUE_NULL }, /* 414 = extattr_delete_link */
+ { SYF_MPSAFE | AS(extattr_set_link_args), (sy_call_t *)extattr_set_link, AUE_NULL }, /* 412 = extattr_set_link */
+ { SYF_MPSAFE | AS(extattr_get_link_args), (sy_call_t *)extattr_get_link, AUE_NULL }, /* 413 = extattr_get_link */
+ { SYF_MPSAFE | AS(extattr_delete_link_args), (sy_call_t *)extattr_delete_link, AUE_NULL }, /* 414 = extattr_delete_link */
{ SYF_MPSAFE | AS(__mac_execve_args), (sy_call_t *)__mac_execve, AUE_NULL }, /* 415 = __mac_execve */
{ SYF_MPSAFE | AS(sigaction_args), (sy_call_t *)sigaction, AUE_NULL }, /* 416 = sigaction */
{ SYF_MPSAFE | AS(sigreturn_args), (sy_call_t *)sigreturn, AUE_NULL }, /* 417 = sigreturn */
@@ -466,9 +466,9 @@ struct sysent sysent[] = {
{ SYF_MPSAFE | AS(_umtx_lock_args), (sy_call_t *)_umtx_lock, AUE_NULL }, /* 434 = _umtx_lock */
{ SYF_MPSAFE | AS(_umtx_unlock_args), (sy_call_t *)_umtx_unlock, AUE_NULL }, /* 435 = _umtx_unlock */
{ SYF_MPSAFE | AS(jail_attach_args), (sy_call_t *)jail_attach, AUE_NULL }, /* 436 = jail_attach */
- { AS(extattr_list_fd_args), (sy_call_t *)extattr_list_fd, AUE_NULL }, /* 437 = extattr_list_fd */
- { AS(extattr_list_file_args), (sy_call_t *)extattr_list_file, AUE_NULL }, /* 438 = extattr_list_file */
- { AS(extattr_list_link_args), (sy_call_t *)extattr_list_link, AUE_NULL }, /* 439 = extattr_list_link */
+ { SYF_MPSAFE | AS(extattr_list_fd_args), (sy_call_t *)extattr_list_fd, AUE_NULL }, /* 437 = extattr_list_fd */
+ { SYF_MPSAFE | AS(extattr_list_file_args), (sy_call_t *)extattr_list_file, AUE_NULL }, /* 438 = extattr_list_file */
+ { SYF_MPSAFE | AS(extattr_list_link_args), (sy_call_t *)extattr_list_link, AUE_NULL }, /* 439 = extattr_list_link */
{ SYF_MPSAFE | AS(kse_switchin_args), (sy_call_t *)kse_switchin, AUE_NULL }, /* 440 = kse_switchin */
{ SYF_MPSAFE | AS(ksem_timedwait_args), (sy_call_t *)lkmressys, AUE_NULL }, /* 441 = ksem_timedwait */
{ SYF_MPSAFE | AS(thr_suspend_args), (sy_call_t *)thr_suspend, AUE_NULL }, /* 442 = thr_suspend */
OpenPOWER on IntegriCloud