From: Oleg Nesterov Date: Thu, 3 Sep 2009 17:21:45 +0000 (+0200) Subject: rlimits: make sure ->rlim_max never grows in sys_setrlimit X-Git-Tag: v2.6.36-rc1~300^2~9 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fb9d2689a0041b88b25bc3187eada2968e25995;p=pandora-kernel.git rlimits: make sure ->rlim_max never grows in sys_setrlimit Mostly preparation for Jiri's changes, but probably makes sense anyway. sys_setrlimit() checks new_rlim.rlim_max <= old_rlim->rlim_max, but when it takes task_lock() old_rlim->rlim_max can be already lowered. Move this check under task_lock(). Currently this is not important, we can only race with our sub-thread, this means the application is stupid. But when we change the code to allow the update of !current task's limits, it becomes important to make sure ->rlim_max can be lowered "reliably" even if we race with the application doing sys_setrlimit(). Signed-off-by: Oleg Nesterov Signed-off-by: Jiri Slaby --- Reading git-diff-tree failed