lkml.org 
[lkml]   [1999]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] New version of mmid patch, against 2.3.12


On Thu, 29 Jul 1999 cd_smith@ou.edu wrote:

> Hey,
>
> Here's my mmid patch against 2.3.12. I took the suggestion of Martijn van
> Oosterhout to use current->mm as the mm_id. I thought about it, and I've
> convinced myself there are no security issues with that. So it's actually
> substantially smaller than the old one. And there's really no extra
> memory required besides a tiny amount of additional code in the proc
> filesystem. That worked out very nicely. (Thanks Martijn!)
>
> If anyone has any comments or complaints, let me know. If not, Linus
> please consider this for 2.3.13.

First of all, check for init_mm is wrong. Kernel threads have NULL
->mm now. Another thing being that you have a potential race here. Correct
way to do the thing:

static int get_mm_id(int pid, char * buffer)
{
struct mm_struct *mm = get_mm(pid);
int res = sprintf(buffer,"%lu\n", (unsigned long)mm);
mmput(mm);
return res;
}

and the rest as in your variant.

Cheers,
Al (tweaking procfs right now ;-)


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

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