Re: [PATCH] Re: Race in fs/proc/generic.c:make_inode_number()

2001-04-06 Thread Tom Leete
Maneesh Soni wrote: > > Just a couple of points: > > On Thu, Apr 05, 2001 at 10:36:10AM -0400, Tom Leete wrote: > [...] > > +spinlock_t proc_alloc_map_lock = RW_LOCK_UNLOCKED; > > + > Why not make this static? > Initializer should be SPIN_LOCK_UNLOCKED. > Thanks, you're right on both counts.

Re: [PATCH] Re: Race in fs/proc/generic.c:make_inode_number()

2001-04-06 Thread Maneesh Soni
Just a couple of points: On Thu, Apr 05, 2001 at 10:36:10AM -0400, Tom Leete wrote: [...] > +spinlock_t proc_alloc_map_lock = RW_LOCK_UNLOCKED; > + Why not make this static? Initializer should be SPIN_LOCK_UNLOCKED. Maneesh Soni Linux Technology Center, IBM Bangalore. - To unsubscribe from this

Re: [PATCH] Re: Race in fs/proc/generic.c:make_inode_number()

2001-04-06 Thread Maneesh Soni
Just a couple of points: On Thu, Apr 05, 2001 at 10:36:10AM -0400, Tom Leete wrote: [...] +spinlock_t proc_alloc_map_lock = RW_LOCK_UNLOCKED; + Why not make this static? Initializer should be SPIN_LOCK_UNLOCKED. Maneesh Soni Linux Technology Center, IBM Bangalore. - To unsubscribe from this

Re: [PATCH] Re: Race in fs/proc/generic.c:make_inode_number()

2001-04-06 Thread Tom Leete
Maneesh Soni wrote: Just a couple of points: On Thu, Apr 05, 2001 at 10:36:10AM -0400, Tom Leete wrote: [...] +spinlock_t proc_alloc_map_lock = RW_LOCK_UNLOCKED; + Why not make this static? Initializer should be SPIN_LOCK_UNLOCKED. Thanks, you're right on both counts. Linus,

[PATCH] Re: Race in fs/proc/generic.c:make_inode_number()

2001-04-05 Thread Tom Leete
I wrote: > > The proc_alloc_map bitfield is unprotected by any lock, and > find_first_zero_bit() is not atomic. Concurrent module loading can race > here. Hello, Here is a patch for this. It looks like callers are always in user context (kmalloc flag GFP_KERNEL), so I used a light spinlock.

[PATCH] Re: Race in fs/proc/generic.c:make_inode_number()

2001-04-05 Thread Tom Leete
I wrote: The proc_alloc_map bitfield is unprotected by any lock, and find_first_zero_bit() is not atomic. Concurrent module loading can race here. Hello, Here is a patch for this. It looks like callers are always in user context (kmalloc flag GFP_KERNEL), so I used a light spinlock.

Race in fs/proc/generic.c:make_inode_number()

2001-04-04 Thread Tom Leete
Hello, The proc_alloc_map bitfield is unprotected by any lock, and find_first_zero_bit() is not atomic. Concurrent module loading can race here. static unsigned char proc_alloc_map[PROC_NDYNAMIC / 8]; static int make_inode_number(void) { int i = find_first_zero_bit((void *)

Race in fs/proc/generic.c:make_inode_number()

2001-04-04 Thread Tom Leete
Hello, The proc_alloc_map bitfield is unprotected by any lock, and find_first_zero_bit() is not atomic. Concurrent module loading can race here. static unsigned char proc_alloc_map[PROC_NDYNAMIC / 8]; static int make_inode_number(void) { int i = find_first_zero_bit((void *)