mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] proc: fix reported unit for RLIMIT_CPU
@ 2009-07-08  4:23 Kees Cook
  2009-07-08  4:51 ` Amerigo Wang
  2009-07-08 10:17 ` Neil Horman
  0 siblings, 2 replies; 3+ messages in thread
From: Kees Cook @ 2009-07-08  4:23 UTC (permalink / raw)
  To: linux-kernel; +Cc: Neil Horman

/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 <kees.cook@canonical.com>
---
 fs/proc/base.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 3ce5ae9..5891360 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -461,7 +461,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"},
-- 
1.6.3.3

-- 
Kees Cook
Ubuntu Security Team

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] proc: fix reported unit for RLIMIT_CPU
  2009-07-08  4:23 [PATCH] proc: fix reported unit for RLIMIT_CPU Kees Cook
@ 2009-07-08  4:51 ` Amerigo Wang
  2009-07-08 10:17 ` Neil Horman
  1 sibling, 0 replies; 3+ messages in thread
From: Amerigo Wang @ 2009-07-08  4:51 UTC (permalink / raw)
  To: Kees Cook; +Cc: linux-kernel, Neil Horman

On Tue, Jul 07, 2009 at 09:23:32PM -0700, Kees Cook wrote:
>/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 <kees.cook@canonical.com>


Acked-by: WANG Cong <xiyou.wangcong@gmail.com>

>---
> fs/proc/base.c |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
>diff --git a/fs/proc/base.c b/fs/proc/base.c
>index 3ce5ae9..5891360 100644
>--- a/fs/proc/base.c
>+++ b/fs/proc/base.c
>@@ -461,7 +461,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"},
>-- 
>1.6.3.3
>
>-- 
>Kees Cook
>Ubuntu Security Team
>--
>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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] proc: fix reported unit for RLIMIT_CPU
  2009-07-08  4:23 [PATCH] proc: fix reported unit for RLIMIT_CPU Kees Cook
  2009-07-08  4:51 ` Amerigo Wang
@ 2009-07-08 10:17 ` Neil Horman
  1 sibling, 0 replies; 3+ messages in thread
From: Neil Horman @ 2009-07-08 10:17 UTC (permalink / raw)
  To: Kees Cook; +Cc: linux-kernel

On Tue, Jul 07, 2009 at 09:23:32PM -0700, Kees Cook wrote:
> /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 <kees.cook@canonical.com>
> ---
>  fs/proc/base.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/proc/base.c b/fs/proc/base.c
> index 3ce5ae9..5891360 100644
> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -461,7 +461,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"},

Yup, thanks!
Acked-by: Neil Horman <nhorman@tuxdriver.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-07-08 10:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-08  4:23 [PATCH] proc: fix reported unit for RLIMIT_CPU Kees Cook
2009-07-08  4:51 ` Amerigo Wang
2009-07-08 10:17 ` Neil Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®