Skip to content

RFC proc: Add allowlist for procfs files

Alexey Gladkov containers linux-fsdevel lkml llvm oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6proc: Fix separator for subset optionfs/proc/root.c+1 -10 replies
2/6proc: Add allowlist to control access to procfs filesfs/proc/Kconfig fs/proc/Makefile fs/proc/generic.c +4 more+306 -53 replies
3/6proc: Check that subset= option has been setfs/proc/generic.c fs/proc/inode.c fs/proc/internal.h +3 more+43 -470 replies
4/6proc: Allow to use the allowlist filter in usernsfs/proc/proc_allowlist.c+2 -20 replies
5/6proc: Validate incoming allowlistfs/proc/internal.h fs/proc/proc_allowlist.c fs/proc/root.c +1 more+149 -550 replies
6/6doc: proc: Add description of subset=allowlistDocumentation/filesystems/proc.rst+10 -00 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 v1 0/6] proc: Add allowlist for procfs files

The patch expands subset= option. If the proc is mounted with the subset=allowlist option, the /proc/allowlist file will appear. This file contains the filenames and directories that are allowed for this mountpoint. By default, /proc/allowlist contains only its own name. Changing the allowlist is possible as long as it is present in the allowlist itself.

This allowlist is applied in lookup/readdir so files that will create modules after mounting will not be visible.

Compared to the previous patches [1][2], I switched to a special virtual file from listing filenames in the mount options.

[1] https://lore.kernel.org/lkml/[email protected]/
[2] https://lore.kernel.org/lkml/[email protected]/

---

Alexey Gladkov (6):
proc: Fix separator for subset option
proc: Add allowlist to control access to procfs files
proc: Check that subset= option has been set
proc: Allow to use the allowlist filter in userns
proc: Validate incoming allowlist
doc: proc: Add description of subset=allowlist

 Documentation/filesystems/proc.rst |  10 +
 fs/proc/Kconfig                    |  10 +
 fs/proc/Makefile                   |   1 +
 fs/proc/generic.c                  |  15 +-
 fs/proc/inode.c                    |  16 +-
 fs/proc/internal.h                 |  33 ++++
 fs/proc/proc_allowlist.c           | 300 +++++++++++++++++++++++++++++
 fs/proc/root.c                     |  36 +++-
 include/linux/proc_fs.h            |  18 +-
 9 files changed, 420 insertions(+), 19 deletions(-)
 create mode 100644 fs/proc/proc_allowlist.c
Signature · 1 line
2.33.6