mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: bmerry@cs.uct.ac.za
To: linux-kernel@vger.kernel.org
Subject: Holding ref to /proc/<pid> dentry prevents task being freed
Date: Thu, 5 May 2005 11:11:31 +0200	[thread overview]
Message-ID: <20050505091131.GA4472@omnius.cs.uct.ac.za> (raw)

[Please CC me on replies. I'm not subscribed to LKML]

Hi

I'm busy writing a security module that does some very basic ACL stuff
on a per-task basis. If my module obtains and holds a dentry for
/proc/<pid> (via path_lookup), then the task_free_security hook is
never called for that process. Since the module releases the dentry in
task_free_security, this creates a chicken-and-egg problem and neither
the task nor the dentry is ever released. A side-effect is that the
module refcount never drops to 0.

Perhaps the LSM framework needs a hook for a task exiting (transition
to zombie state), in addition to the task_free_security hook? That
would allow resources to be freed from zombies, including these types
of circular references.

Thanks
Bruce

[Please CC me on replies. I'm not subscribed to LKML]
-- 
/--------------------------------------------------------------------\
| Bruce Merry                      | bmerry at cs . uct . ac . za    |
| Proud user of Gentoo GNU/Linux   | http://www.cs.uct.ac.za/~bmerry |
|        Despite the high cost of living, it remains popular.        |
\--------------------------------------------------------------------/

             reply	other threads:[~2005-05-05  9:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-05  9:11 bmerry [this message]
2005-05-05 16:34 ` Chris Wright
2005-05-06  8:17   ` bmerry
2005-05-06 17:47     ` Chris Wright
2005-05-07  9:33       ` bmerry

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=20050505091131.GA4472@omnius.cs.uct.ac.za \
    --to=bmerry@cs.uct.ac.za \
    --cc=linux-kernel@vger.kernel.org \
    /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®