All of lore.kernel.org
 help / color / mirror / Atom feed
From: Solar Designer <solar@openwall.com>
To: kernel-hardening@lists.openwall.com
Subject: Re: [kernel-hardening] destroy unused shmem segments
Date: Wed, 15 Jun 2011 18:42:45 +0400	[thread overview]
Message-ID: <20110615144245.GC32753@openwall.com> (raw)
In-Reply-To: <20110614083318.GA8710@albatros>

Vasiliy,

On Tue, Jun 14, 2011 at 12:33:45PM +0400, Vasiliy Kulikov wrote:
> It is used in case shmem segment was created, but never used.  In this
> case refcount is never incremented and never decremented, shm_clone()
> isn't called.
> 
> If shmctl() sets IPC_RMID, it is deleted, but as you have implemented
> implicit semantics (like IPC_RMID is always set), actual check in
> shmget()+exit() is needed.
> 
> Spotted by reading -ow README and testing :)

Oh, right.  Having documentation is good.

> I think forcing IPC_RMID should be configurable via sysctl like other
> ipc variables.  Something like /proc/sys/kernel/shm_orphans_denied.
> And I think changing it from 0 to 1 should destroy already orphaned
> segments without users.

OK.

Thanks,

Alexander

  reply	other threads:[~2011-06-15 14:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-13  6:42 [kernel-hardening] destroy unused shmem segments Vasiliy Kulikov
2011-06-13  7:07 ` Solar Designer
2011-06-14  8:33   ` Vasiliy Kulikov
2011-06-15 14:42     ` Solar Designer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-06-14 17:51 Vasiliy Kulikov

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=20110615144245.GC32753@openwall.com \
    --to=solar@openwall.com \
    --cc=kernel-hardening@lists.openwall.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.