From: Paul Fulghum <paulkf@microgate.com>
To: Jon Smirl <jonsmirl@gmail.com>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: Re: tty_mutex and tty_old_pgrp
Date: Tue, 27 Jun 2006 17:56:31 -0500 [thread overview]
Message-ID: <44A1B79F.9020204@microgate.com> (raw)
In-Reply-To: <9e4733910606261538i584e2203o9555d77094de6fe7@mail.gmail.com>
Jon Smirl wrote:
> In tty_io.c there is a comment that tty_mutex needs to be held before
> changing tty_old_pgrp. If I grep for tty_old_pgrp every place it is
> changed except for one is protected by tty_mutex.
> In security/selinux/hooks.c it appears to be changed without holding
> the lock, is this ok? If it is ok, I can add a comment saying it is.
>
> If someone were to provide me with the proper guidance, I have some
> time I could spend working on the tty code. For example from an object
> oriented perspective it doesn't look right to me that
> disassociate_ctty is a function in the tty layer. It makes more sense
> to me that this function would be located in the task code.
>
> How could things be rearranged to avoid the need for sys_setsid() and
> daemonize() to directly manipulate tty_mutex? What exactly is
> tty_mutex protecting, it appears to be used in multiple contexts.
No one has leaped in here with any wisdom, but the people
who wrote that code may be dead or otherwise employed.
If you have knowledge of how those bits work,
I encourage to you dig through the code and determine
what needs to be done. It is certainly an area that can
use more review.
I did see a comment that tty_mutex protects the creation
and destruction of tty structures, so I assume the coverage
of tty_old_pgrp has some relation to that. Unfortunately,
I have seen other locks get borrowed for multiple purposes.
--
Paul
next prev parent reply other threads:[~2006-06-27 22:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-26 22:38 tty_mutex and tty_old_pgrp Jon Smirl
2006-06-27 22:56 ` Paul Fulghum [this message]
2006-06-28 3:29 ` Jon Smirl
2006-06-28 10:24 ` Alan Cox
2006-06-28 17:36 ` Jon Smirl
2006-06-28 18:04 ` Alan Cox
2006-06-28 18:13 ` Jon Smirl
2006-06-29 5:41 ` Jon Smirl
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=44A1B79F.9020204@microgate.com \
--to=paulkf@microgate.com \
--cc=jonsmirl@gmail.com \
--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