lkml.org 
[lkml]   [2005]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] acct_stack_growth nitpicks
- remove duplicate rlim assignment in acct_stack_growth()
- allow CAP_IPC_LOCK to override mlock rlimit during stack expansion as
in all other cases

Signed-off-by: Chris Wright <chrisw@osdl.org>

===== mm/mmap.c 1.155 vs edited =====
--- 1.155/mm/mmap.c 2005-01-10 11:23:35 -08:00
+++ edited/mm/mmap.c 2005-01-10 19:34:05 -08:00
@@ -1346,7 +1346,6 @@ static int acct_stack_growth(struct vm_a
struct rlimit *rlim = current->signal->rlim;

/* address space limit tests */
- rlim = current->signal->rlim;
if (mm->total_vm + grow > rlim[RLIMIT_AS].rlim_cur >> PAGE_SHIFT)
return -ENOMEM;

@@ -1360,7 +1359,7 @@ static int acct_stack_growth(struct vm_a
unsigned long limit;
locked = mm->locked_vm + grow;
limit = rlim[RLIMIT_MEMLOCK].rlim_cur >> PAGE_SHIFT;
- if (locked > limit)
+ if (locked > limit && !capable(CAP_IPC_LOCK))
return -ENOMEM;
}

-
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:09    [W:0.041 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site