https://github.com/torvalds/linux
Revision 095da6cbb6a1c54c19b11190218eb0fbac666b6d authored by Miklos Szeredi on 17 January 2006, 06:14:52 UTC, committed by Linus Torvalds on 17 January 2006, 07:15:31 UTC
Fix race in setting bitfields of fuse_conn.  Spotted by Andrew Morton.

The two fields ->connected and ->mounted were always changed with the
fuse_lock held.  But other bitfields in the same structure were changed
without the lock.  In theory this could lead to losing the assignment of
even the ones under lock.  The chosen solution is to change these two
fields to be a full unsigned type.  The other bitfields aren't "important"
enough to warrant the extra complexity of full locking or changing them to
bitops.

For all bitfields document why they are safe wrt. concurrent
assignments.

Also make the initialization of the 'num_waiting' atomic counter explicit.

Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent bacac38
History
Tip revision: 095da6cbb6a1c54c19b11190218eb0fbac666b6d authored by Miklos Szeredi on 17 January 2006, 06:14:52 UTC
[PATCH] fuse: fix bitfield race
Tip revision: 095da6c
File Mode Size
Documentation
arch
block
crypto
drivers
fs
include
init
ipc
kernel
lib
mm
net
scripts
security
sound
usr
.gitignore -rw-r--r-- 424 bytes
COPYING -rw-r--r-- 18.3 KB
CREDITS -rw-r--r-- 87.5 KB
Kbuild -rw-r--r-- 1.2 KB
MAINTAINERS -rw-r--r-- 65.0 KB
Makefile -rw-r--r-- 43.7 KB
README -rw-r--r-- 14.5 KB
REPORTING-BUGS -rw-r--r-- 3.0 KB

README

back to top