lkml.org 
[lkml]   [2005]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kernel/fork.c: VM accounting bugfix (2.6.11-rc3-bk5)
Hi Mark,

* Mark F. Haigh (Mark.Haigh@SpirentCom.COM) wrote:
> [Aargh! Missing Signed-off-by.]
>
> Unless I'm missing something, in kernel/fork.c, dup_mmap():
>
> if (security_vm_enough_memory(len))
> goto fail_nomem;
> /* ... */
> fail_nomem:
> retval = -ENOMEM;
> vm_unacct_memory(charge);
> /* ... */
>
> If security_vm_enough_memory() fails there, then we vm_unacct_memory()
> that we never accounted (if security_vm_enough_memory() fails, no memory
> is accounted).

You missed one subtle point. That failure case actually unaccts 0 pages
(note the use of charge). Not the nicest, but I believe correct.

thanks,
-chris
--
Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

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