Skip to content

RFC Task references..

Eric W. Biederman lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 25 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5pid: Implement task references.include/linux/pid.h include/linux/sched.h kernel/fork.c +1 more+119 -016 replies
2/5pid: Add macros for interating through tasks by type.include/linux/pid.h+12 -00 replies
3/5pid: Implement kill_tref.include/linux/sched.h kernel/signal.c+34 -00 replies
4/5vt: Update spawnpid to use a task_ref.drivers/char/keyboard.c drivers/char/vt_ioctl.c+7 -64 replies
5/5file: Modify struct fown_struct to contain a treffs/fcntl.c fs/file_table.c include/linux/fs.h +1 more+30 -222 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC][PATCH 0/5] Task references..

In the pid virtualization thread it was noticed that currently in the kernel we have a variables that hold pids of processes or process groups that we later intend to send signals to.

It was suggest that we instead use pointers to struct task_struct and reference count them to get around this problem.

The problem was that each file descriptor in the system has one of these variables in f_owner an instance of struct fown_struct it would allow user to bypass the limits on the number of processes and type of megabytes of memory with invisible zombie processes.

For kernel threads where things are tightly coordinated this is not an issue hand holding a reference to the task struct of a kernel thread seems the sane thing to do.

The other problem was that pointers to struct task_struct don't map well to process groups.

I believe the solution to these problems is to introduce a small data structure that can be reference counted and holds a pointer to a
struct task_struct. The struct task_struct holds a pointer to this
small data structure that will be used to remove the pointer to itself when the struct task_struct is freed.

The following series of patches implement the data structure and the routines for manipulating it. As well as implementing this data structure in two common cases in the kernel, that demonstrate it's usefulness.

Eric