minix/servers
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
..
devman devman: initialize libvtreefs hooks 2012-08-31 19:12:49 +02:00
ds drop safemap code 2012-10-30 13:55:42 +01:00
ext2 can't get_block(NO_DEV) any more 2012-11-16 16:37:44 +01:00
hgfs Create SFFS library out of HGFS 2012-04-09 18:08:26 +02:00
inet various warning/errorwarning fixes for gcc47 2012-08-27 16:19:18 +02:00
init Upgrading build system to new NetBSD revision 2012-11-15 16:07:29 +01:00
ipc VM: make mapping types explicit 2012-10-12 14:52:01 +02:00
is drop safemap code 2012-10-30 13:55:42 +01:00
iso9660fs iso9660fs: initialize buffer cache 2012-11-16 11:09:03 +00:00
lwip LWIP - fix, removed segments 2012-08-03 00:20:34 -07:00
mfs Removing useless minix/types.h header 2012-12-07 13:58:06 +01:00
pfs various warning/errorwarning fixes for gcc47 2012-08-27 16:19:18 +02:00
pm Remove ability to pass commands to bootloader 2012-11-22 19:16:17 +01:00
procfs Implement dynamic mtab support 2012-11-26 15:20:18 +00:00
rs RS: do not zero process name for boot processes 2012-12-06 13:24:30 +00:00
sched Remove MINIXSRCDIR and use NETBSDSRCDIR 2012-06-18 10:53:35 +00:00
vbfs Add VBFS: VirtualBox Shared Folder File System 2012-04-11 00:27:48 +02:00
vfs VFS: fix locking bugs 2013-01-11 09:18:35 +00:00
vm vm: fix region reporting bug 2013-01-09 19:50:52 +00:00
Makefile Add VBFS: VirtualBox Shared Folder File System 2012-04-11 00:27:48 +02:00
Makefile.inc Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00