Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cff4edb5 authored by Kees Cook's avatar Kees Cook Committed by Linus Torvalds
Browse files

proc: fix reported unit for RLIMIT_CPU



/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: default avatarKees Cook <kees.cook@canonical.com>
Acked-by: default avatarWANG Cong <xiyou.wangcong@gmail.com>
Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 27f6cb16
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -458,7 +458,7 @@ struct limit_names {
};
};


static const struct limit_names lnames[RLIM_NLIMITS] = {
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_FSIZE] = {"Max file size", "bytes"},
	[RLIMIT_DATA] = {"Max data size", "bytes"},
	[RLIMIT_DATA] = {"Max data size", "bytes"},
	[RLIMIT_STACK] = {"Max stack size", "bytes"},
	[RLIMIT_STACK] = {"Max stack size", "bytes"},