mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Amerigo Wang <xiyou.wangcong@gmail.com>
To: Kees Cook <kees.cook@canonical.com>
Cc: linux-kernel@vger.kernel.org, Neil Horman <nhorman@tuxdriver.com>
Subject: Re: [PATCH] proc: fix reported unit for RLIMIT_CPU
Date: Wed, 8 Jul 2009 12:51:26 +0800	[thread overview]
Message-ID: <20090708045126.GB5917@cr0.nay.redhat.com> (raw)
In-Reply-To: <20090708042331.GT11156@outflux.net>

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/

  reply	other threads:[~2009-07-08  4:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-08  4:23 Kees Cook
2009-07-08  4:51 ` Amerigo Wang [this message]
2009-07-08 10:17 ` Neil Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090708045126.GB5917@cr0.nay.redhat.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=kees.cook@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®