No description
Find a file
Thomas Veerman 7c8b3ddfed VFS: fix locking bugs
.sync and fsync used unnecessarily restrictive locking type
.fsync violated locking order by obtaining a vmnt lock after a filp lock
.fsync contained a TOCTOU bug
.new_node violated locking rules (didn't upgrade lock upon file creation)
.do_pipe used unnecessarily restrictive locking type
.always lock pipes exclusively; even a read operation might require to do
 a write on a vnode object (update pipe size)
.when opening a file with O_TRUNC, upgrade vnode lock when truncating
.utime used unnecessarily restrictive locking type
.path parsing:
  .always acquire VMNT_WRITE or VMNT_EXCL on vmnt and downgrade to
   VMNT_READ if that was what was actually requested. This prevents the
   following deadlock scenario:
   thread A:
     lock_vmnt(vmp, TLL_READSER);
     lock_vnode(vp, TLL_READSER);
     upgrade_vmnt_lock(vmp, TLL_WRITE);

   thread B:
     lock_vmnt(vmp, TLL_READ);
     lock_vnode(vp, TLL_READSER);

   thread A will be stuck in upgrade_vmnt_lock and thread B is stuck in
   lock_vnode. This happens when, for example, thread A tries create a
   new node (open.c:new_node) and thread B tries to do eat_path to
   change dir (stadir.c:do_chdir). When the path is being resolved, a
   vnode is always locked with VNODE_OPCL (TLL_READSER) and then
   downgraded to VNODE_READ if read-only is actually requested. Thread
   A locks the vmnt with VMNT_WRITE (TLL_READSER) which still allows
   VMNT_READ locks. Thread B can't acquire a lock on the vnode because
   thread A has it; Thread A can't upgrade its vmnt lock to VMNT_WRITE
   (TLL_WRITE) because thread B has a VMNT_READ lock on it.

   By serializing vmnt locks during path parsing, thread B can only
   acquire a lock on vmp when thread A has completely finished its
   operation.
2013-01-11 09:18:35 +00:00
benchmarks Fixed unixbench Run script 2010-10-25 08:32:14 +00:00
bin pax: workaround for mkstemp() and long filenames 2012-12-11 12:00:37 +01:00
commands service: nonfatally ignore unknown call keywords 2013-01-08 18:54:04 +00:00
common Removing useless minix/types.h header 2012-12-07 13:58:06 +01:00
distrib Importing nbperf 2012-12-07 13:58:07 +01:00
docs docs/UPDATING: some tools have been added/upgraded 2012-12-07 14:24:25 +00:00
drivers Fix release.sh to work with NetBSD Build system. 2012-11-26 10:46:19 +01:00
etc vbfs: add DS to system.conf IPC list 2012-12-06 13:27:26 +00:00
external Removing warning about OSNAME. 2012-12-11 17:29:54 +01:00
gnu/dist Toolchain upgrade and portability improvements. 2012-11-15 16:07:29 +01:00
include kernel: trap-dependent state restore, trace fixes 2013-01-08 15:47:37 +00:00
kernel Drop obsolete klib16.S 2013-01-08 16:00:37 +00:00
lib libc, libutil: remove compat hacks 2013-01-08 15:47:37 +00:00
libexec Adding missing symlink to dynamic loader. 2012-11-28 17:35:56 +01:00
man deduplicate some installed files 2012-12-10 16:52:33 +01:00
releasetools release.sh: restore -jJAILDIR option 2013-01-08 18:50:32 +00:00
sbin Toolchain upgrade and portability improvements. 2012-11-15 16:07:29 +01:00
servers VFS: fix locking bugs 2013-01-11 09:18:35 +00:00
share Importing NetBSD tsort 2012-12-07 13:58:07 +01:00
sys Removing useless minix/types.h header 2012-12-07 13:58:06 +01:00
test test:update tests to fix compiler warnings. 2013-01-08 10:39:53 +01:00
tools Importing NetBSD tsort 2012-12-07 13:58:07 +01:00
usr.bin gzip: fix warning messages with off_t 2013-01-08 15:59:10 +00:00
usr.sbin mkfs.mfs: __dead and __UNCONST are unknown on Linux 2012-11-26 16:18:32 +00:00
.gitignore gitignore: ignore some more generated files 2012-12-06 13:29:20 +00:00
build.sh Cross compile on minix support 2012-11-15 16:07:30 +01:00
LICENSE Fix parameter parsing in cut 2010-01-21 10:16:05 +00:00
Makefile Adapting build target to also execute hdboot. 2012-11-26 23:42:32 +01:00