proc: fix reported unit for RLIMIT_CPU
authorKees Cook <[email protected]>
Tue, 22 Sep 2009 23:45:32 +0000 (16:45 -0700)
committerLinus Torvalds <[email protected]>
Wed, 23 Sep 2009 14:39:40 +0000 (07:39 -0700)
/proc/$pid/limits should show RLIMIT_CPU as seconds, which is the unit
used in kernel/posix-cpu-timers.c:

        unsigned long psecs = cputime_to_secs(ptime);
        ...
        if (psecs >= sig->rlim[RLIMIT_CPU].rlim_max) {
                ...
                __group_send_sig_info(SIGKILL, SEND_SIG_PRIV, tsk);

Signed-off-by: Kees Cook <[email protected]>
Acked-by: WANG Cong <[email protected]>
Acked-by: Neil Horman <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/proc/base.c

index 55c4c805a756178ed608097fa13cb2a964e27e2a..69bb70351b9b0ef3118ed62c19a3b6a69202b350 100644 (file)
@@ -458,7 +458,7 @@ struct limit_names {
 };
 
 static const struct limit_names lnames[RLIM_NLIMITS] = {
-       [RLIMIT_CPU] = {"Max cpu time", "ms"},
+       [RLIMIT_CPU] = {"Max cpu time", "seconds"},
        [RLIMIT_FSIZE] = {"Max file size", "bytes"},
        [RLIMIT_DATA] = {"Max data size", "bytes"},
        [RLIMIT_STACK] = {"Max stack size", "bytes"},