Skip to content

proc cleanup.

Eric W. Biederman lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest23 patches 24 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/23tref: Implement task references.include/linux/pid.h include/linux/task_ref.h kernel/Makefile +3 more+224 -119 replies
2/23proc: Fix the .. inode number on /proc/<pid>/fdfs/proc/base.c+3 -20 replies
3/23proc: Remove useless BKL in proc_pid_readlink.fs/proc/base.c+0 -20 replies
4/23proc: Remove unnecessary and misleading assignments from proc_pid_make_inode.fs/proc/base.c+0 -20 replies
5/23proc: Simplify the ownership rules for /procfs/proc/base.c+2 -20 replies
5/23proc: Simplify the ownership rules for /procfs/proc/base.c+2 -20 replies
6/23proc: Replace proc_inode.type with proc_inode.fdfs/proc/base.c fs/proc/inode.c fs/proc/internal.h +1 more+7 -70 replies
7/23proc: Remove bogus proc_task_permission.fs/proc/base.c+0 -630 replies
8/23proc: Kill proc_mem_inode_operations.fs/proc/base.c+0 -50 replies
9/23proc: Properly filter out files that are not visible to a process.fs/proc/base.c+87 -660 replies
10/23proc: Fix the link count for /proc/<pid>/taskfs/proc/base.c+19 -20 replies
11/23proc: Move proc_maps_operations into task_mmu.cfs/proc/base.c fs/proc/internal.h fs/proc/task_mmu.c +1 more+75 -650 replies
12/23proc: Rewrite the proc dentry flush on exit optimization.fs/exec.c fs/proc/base.c include/linux/init_task.h +4 more+72 -1050 replies
13/23proc: Close the race of a process dying durning lookup.fs/proc/base.c+29 -250 replies
14/23proc: Make PROC_NUMBUF the buffer size for holding a integers as strings.fs/proc/base.c+15 -150 replies
15/23proc: refactor reading directories of tasks.fs/proc/base.c+174 -1110 replies
16/23proc: Don't lock task_structs indefinitely.fs/proc/base.c fs/proc/inode.c fs/proc/internal.h +3 more+252 -1170 replies
17/23proc: Give the root directory a task.fs/proc/root.c+13 -00 replies
18/23proc: Reorder the functions in base.cfs/proc/base.c+533 -5290 replies
19/23proc: Modify proc_pident_lookup to be completely table driven.fs/proc/base.c include/linux/proc_fs.h+109 -2330 replies
20/23proc: Make the generation of the self symlink table driven.fs/proc/base.c+17 -230 replies
21/23proc: Factor out an instantiate method from every lookup method.fs/proc/base.c+125 -870 replies
22/23proc: Remove the hard coded inode numbers.fs/proc/base.c+164 -1920 replies
23/23proc: Merge proc_tid_attr and proc_tgid_attrfs/proc/base.c+11 -390 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 00/23] proc cleanup.

When working on pid namespaces I keep tripping over /proc. It's hard coded inode numbers and the amount of cruft accumulated over the years makes it hard to deal with.

So to put /proc out of my misery here is a series of patches that removes the worst of the warts.

The first patch which introduces task_refs is used later to address one of the worst faults how much low kernel memory it allows an unprivileged process to pin. There are other patches to cleanup the permission checking, to cleanup how /proc interacts with the rest of the kernel, and to patches to simply clean /proc up.

At least some of the cleans up go back to cruft that was introduced in 2.2. That was a challenge to track down and understand the thinking at the time because even the historic git archive I have doesn't go back that far :(

Ultimately the biggest cleanup is that this patchset removes the hard coded inode numbers from /proc. There are still a few theoretical issues about non-unique inode numbers but the /proc code doesn't care, and it is no worse than the current situation with the file descriptor inode numbers. I would have loved to have made the inode number the address of the inode data structure in the kernel but I can't because on alpha __kernel_ino_t is an unsigned int! Oh well, the current situation keeps the inode numbers small and readable, and 32bit.

Eric