Portál AbcLinuxu, 20. května 2024 18:27
fcntl_setlk()/close() race prevention has a subtle hole - we need to make sure that if we *do* have an fcntl/close race on SMP box, the access to descriptor table and inode->i_flock won't get reordered. As it is, we get STORE inode->i_flock, LOAD descriptor table entry vs. STORE descriptor table entry, LOAD inode->i_flock with not a single lock in common on both sides. We do have BKL around the first STORE, but check in locks_remove_posix() is outside of BKL and for a good reason - we don't want BKL on common path of close(2). Solution is to hold ->file_lock around fcheck() in there; that orders us wrt removal from descriptor table that preceded locks_remove_posix() on close path and we either come first (in which case eviction will be handled by the close side) or we'll see the effect of close and do eviction ourselves. Note that even though it's read-only access, we do need ->file_lock here - rcu_read_lock() won't be enough to order the things.Nejedná se pouze o větev 2.6.25. K dispozici jsou také opravená 2.6.24.7 a 2.4.36.4. Takže před opuštěním kanceláří nejenom pozavírat okna ale i ucpat nějaké ty díry.
$ uname -a Linux matrix 2.6.25.2 #1 Wed May 7 10:54:40 CEST 2008 i686 GNU/LinuxSobota:
$ uname -a Linux matrix 2.6.25.3 #1 Sat May 10 21:48:38 CEST 2008 i686 GNU/Linux
Tiskni Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.