SECURITY: selinux, fix update_rlimit_cpu parameter
authorJiri Slaby <jirislaby@gmail.com>
Fri, 28 Aug 2009 08:47:16 +0000 (10:47 +0200)
committerJiri Slaby <jslaby@suse.cz>
Mon, 4 Jan 2010 10:27:18 +0000 (11:27 +0100)
Don't pass current RLIMIT_RTTIME to update_rlimit_cpu() in
selinux_bprm_committing_creds, since update_rlimit_cpu expects
RLIMIT_CPU limit.

Use proper rlim[RLIMIT_CPU].rlim_cur instead to fix that.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Acked-by: James Morris <jmorris@namei.org>
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Eric Paris <eparis@parisplace.org>
Cc: David Howells <dhowells@redhat.com>
security/selinux/hooks.c

index 7a374c2eb043b1f611069bd1c67d64f7f64c7f13..9a2ee845e9d4c4b40bc29a9f33c67d591f2e8c30 100644 (file)
@@ -2365,7 +2365,7 @@ static void selinux_bprm_committing_creds(struct linux_binprm *bprm)
                        initrlim = init_task.signal->rlim + i;
                        rlim->rlim_cur = min(rlim->rlim_max, initrlim->rlim_cur);
                }
-               update_rlimit_cpu(rlim->rlim_cur);
+               update_rlimit_cpu(current->signal->rlim[RLIMIT_CPU].rlim_cur);
        }
 }