lkml.org 
[lkml]   [2000]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH (2.4)] atomic use count for proc_dir_entry
On Fri, 17 Nov 2000, Francois romieu wrote:

> CPU A: assume de->count = 1 (in de_put)
> fs/proc/inode.c::44 if (!--de->count) {
> de->count = 0
>
> CPU B: (in remove_proc_entry)
> fs/proc/generic.c::577 if (!de->count)
> fs/proc/generic.c::578 free_proc_entry(de);
>
> CPU A: (in de_put)
> fs/proc/inode.c::45 if (de->deleted) { <-- dereferencing kfreed pointer
>
> What does protect us from the preceding if lock_kernel is thrown ?

Ok, anyway, notice that in line 41 we return from de_put() without
unlock_kernel()'ing the kernel. It doesn't look good.

--
Dan Aloni
dax@karrde.org

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:47    [W:0.031 / U:1.968 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site