Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20110622090331.fd6a3cc7.rdunlap@xenotime.net>
Date: Wed, 22 Jun 2011 09:03:31 -0700
From: Randy Dunlap <rdunlap@...otime.net>
To: Vasiliy Kulikov <segoon@...nwall.com>
Cc: kernel-hardening@...ts.openwall.com, Andrew Morton
 <akpm@...ux-foundation.org>, "Eric W. Biederman" <ebiederm@...ssion.com>,
 "Serge E. Hallyn" <serge.hallyn@...onical.com>, Daniel Lezcano
 <daniel.lezcano@...e.fr>, Oleg Nesterov <oleg@...hat.com>, Tejun Heo
 <tj@...nel.org>, Ingo Molnar <mingo@...e.hu>, linux-doc@...r.kernel.org,
 linux-kernel@...r.kernel.org, linux-security-module@...r.kernel.org
Subject: Re: [RFC] ipc: introduce shm_rmid_forced sysctl

On Wed, 22 Jun 2011 19:25:14 +0400 Vasiliy Kulikov wrote:

> Signed-off-by: Vasiliy Kulikov <segoon@...nwall.com>
> ---
> 
>  Documentation/sysctl/kernel.txt |   22 ++++++++++
>  include/linux/ipc_namespace.h   |    3 +
>  include/linux/shm.h             |    5 ++
>  ipc/ipc_sysctl.c                |   33 +++++++++++++++
>  ipc/shm.c                       |   87 +++++++++++++++++++++++++++++++++++++--
>  kernel/exit.c                   |    1 +
>  6 files changed, 147 insertions(+), 4 deletions(-)
> 
> ---
> diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt
> index 5e7cb39..7a0ecfd 100644
> --- a/Documentation/sysctl/kernel.txt
> +++ b/Documentation/sysctl/kernel.txt
> @@ -62,6 +62,7 @@ show up in /proc/sys/kernel:
>  - shmall
>  - shmmax                      [ sysv ipc ]
>  - shmmni
> +- shm_rmid_forced
>  - stop-a                      [ SPARC only ]
>  - sysrq                       ==> Documentation/sysrq.txt
>  - tainted
> @@ -475,6 +476,27 @@ kernel.  This value defaults to SHMMAX.
>  
>  ==============================================================
>  
> +shm_rmid_forced:
> +
> +Linux lets you set resource limits, including on how much memory one

                                       including how much memory one

> +process can consume, via setrlimit(2).  Unfortunately, shared memory
> +segments are allowed to exist without association with any process, and
> +thus might not be counted against any resource limits.  If enabled,
> +shared memory segments are automatically destroyed when their attach
> +count becomes zero after a detach or a process termination.  It will
> +also destroy segments that were created, but never attached to, on exit
> +from the process.  The only use left for IPC_RMID is to immediately
> +destroy an unattached segment.  Of course, this breaks the way things are
> +defined, so some applications might stop working.  Note that this
> +feature will do you no good unless you also configure your resource
> +limits (in particular, RLIMIT_AS and RLIMIT_NPROC).  Most systems don't
> +need this.
> +
> +Note that if you change this from 0 to 1, already created segments
> +without users and with a dead originative process will be destroyed.

                                 originating (?)

> +
> +==============================================================
> +
>  softlockup_thresh:
>  
>  This value can be used to lower the softlockup tolerance threshold.  The



---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.