* Entry points for execution
@ 2004-01-07 20:15 john moser
0 siblings, 0 replies; only message in thread
From: john moser @ 2004-01-07 20:15 UTC (permalink / raw)
To: linux-kernel
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/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-01-07 20:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-07 20:15 Entry points for execution john moser
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®