mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: john moser <bluefoxicy@linux.net>
To: linux-kernel@vger.kernel.org
Subject: Entry points for execution
Date: Wed, 7 Jan 2004 12:15:35 -0800 (PST)	[thread overview]
Message-ID: <20040107201535.13922393A@sitemail.everyone.net> (raw)

I need to make a slight alteration to every task_struct for every task.  I've put my code into do_fork() but it seems that init (pid 1) has a parent process, as I checked for if (p->parent) and it evidently connected to. . . something.

#ifdef CONFIG_LINUX_JAIL
                /*
                 * If we have no parent (parent == 0, i.e. init), then NULL our
                 * jail.  Else, connect to the jail of the parent.
                 */
                 p->pjail = NULL;
                 if (p->parent)
                        linux_jail_attatch(p->parent->pjail, p);
#endif

The thing is, it denies me chroot when I try to choot with restricted chroot (no chroot in chroot).  Now, the code I have all looks correct, so I'm thinking, it has to be that init is the child of pid 0, and that pid 0 is started in some other way, and thus I'm not clipping the tsk->pjail.

My new code is:

#ifdef CONFIG_LINUX_JAIL
                /*
                 * If we have no parent (parent == 0, i.e. init), then NULL our
                 * jail.  Else, connect to the jail of the parent.
                 */
                 p->pjail = NULL;
                 if (p->pid != 1 && p->parent)
                        linux_jail_attatch(p->parent->pjail, p);
#endif

I'm thinking, the idle task maybe?  Or does that "not exist" physically?  If init has a parent then I'd PREFER to set that parent's pjail to NULL, not because it's magic and might blow up, but because I want things done *cleanly*, and even if the pointer will *NEVER* be examined, having a pointer pointing to something that doesn't belong to the struct is NOT my style.

Can anyone give me all of the lowest level entry points for tasks (i.e. all the places where I can modify a task_struct->* before the task begins execution at its earliest point in creation)?

--Bluefox

_____________________________________________________________
Linux.Net -->Open Source to everyone
Powered by Linare Corporation
http://www.linare.com/

                 reply	other threads:[~2004-01-07 20:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20040107201535.13922393A@sitemail.everyone.net \
    --to=bluefoxicy@linux.net \
    --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®