alistair23-linux/Documentation/filesystems
Richard W.M. Jones 3e42979e65 procfs: expose umask in /proc/<PID>/status
It's not possible to read the process umask without also modifying it,
which is what umask(2) does.  A library cannot read umask safely,
especially if the main program might be multithreaded.

Add a new status line ("Umask") in /proc/<PID>/status.  It contains the
file mode creation mask (umask) in octal.  It is only shown for tasks
which have task->fs.

This patch is adapted from one originally written by Pierre Carrier.

The use case is that we have endless trouble with people setting weird
umask() values (usually on the grounds of "security"), and then
everything breaking.  I'm on the hook to fix these.  We'd like to add
debugging to our program so we can dump out the umask in debug reports.

Previous versions of the patch used a syscall so you could only read
your own umask.  That's all I need.  However there was quite a lot of
push-back from those, so this new version exports it in /proc.

See:
  https://lkml.org/lkml/2016/4/13/704 [umask2]
  https://lkml.org/lkml/2016/4/13/487 [getumask]

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Acked-by: Konstantin Khlebnikov <koct9i@gmail.com>
Acked-by: Jerome Marchand <jmarchan@redhat.com>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Pierre Carrier <pierre@spotify.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-20 17:58:30 -07:00
..
caching FS-Cache: Count the number of initialised operations 2015-04-02 14:28:53 +01:00
cifs Documentation: fix common spelling mistakes 2016-04-28 07:51:59 -06:00
configfs configfs: switch ->default groups to a linked list 2016-03-06 16:11:24 +01:00
nfs Various bugfixes, a RDMA update from Chuck Lever, and support for a new 2016-03-24 19:50:32 -07:00
pohmelfs Documentation: fix common spelling mistakes 2016-04-28 07:51:59 -06:00
.gitignore Documentation: update .gitignore files 2014-09-26 11:02:59 +02:00
00-INDEX dax: replace XIP documentation with DAX documentation 2015-02-16 17:56:03 -08:00
9p.txt 9p: update documentation 2014-01-24 10:55:21 -06:00
adfs.txt
affs.txt affs: add mount option to avoid filename truncates 2014-04-07 16:36:08 -07:00
afs.txt
autofs4-mount-control.txt doc: fix double words 2014-03-21 13:16:58 +01:00
autofs4.txt autofs: the documentation I wanted to read 2014-10-14 02:18:17 +02:00
automount-support.txt Documentation: remove outdated information from automount-support.txt 2015-05-15 01:10:38 -04:00
befs.txt
bfs.txt
btrfs.txt Documentation: btrfs: remove usage specific information 2016-03-11 17:02:09 +01:00
ceph.txt
coda.txt
cramfs.txt mm, fs: remove remaining PAGE_CACHE_* and page_cache_{get,release} usage 2016-04-04 10:41:08 -07:00
dax.txt dax: add huge page fault support 2015-09-08 15:35:28 -07:00
debugfs.txt debugfs: Pass bool pointer to debugfs_create_bool() 2015-10-04 11:36:07 +01:00
devpts.txt TTY, devpts: document pty count limiting 2016-03-07 16:11:14 -08:00
directory-locking vfs: take i_mutex on renamed file 2013-11-09 00:16:40 -05:00
dlmfs.txt ocfs2: update web page + git tree in documentation 2015-02-28 09:57:50 -08:00
dnotify.txt
dnotify_test.c
ecryptfs.txt
efivarfs.txt efi: Make efivarfs entries immutable by default 2016-02-10 16:25:52 +00:00
exofs.txt
ext2.txt fs: Remove ext3 filesystem driver 2015-07-23 20:59:40 +02:00
ext3.txt fs: Remove ext3 filesystem driver 2015-07-23 20:59:40 +02:00
ext4.txt ext4: add DAX functionality 2015-02-16 17:56:04 -08:00
f2fs.txt f2fs: introduce new option for controlling data flush 2015-12-16 09:25:48 -08:00
fiemap.txt fsioctl.c: make generic_block_fiemap() signal-tolerant 2015-02-10 14:30:30 -08:00
files.txt
fuse.txt
gfs2-glocks.txt gfs2: Remove gl_spin define 2015-10-29 12:57:48 -05:00
gfs2-uevents.txt
gfs2.txt
hfs.txt
hfsplus.txt Documentation: update URL to hfsplus Technote 1150 2014-02-20 14:48:51 +01:00
hpfs.txt
inotify.txt inotify: update documentation to reflect code changes 2015-02-10 14:30:28 -08:00
isofs.txt
jfs.txt
Locking direct-io: eliminate the offset argument to ->direct_IO 2016-05-01 19:58:39 -04:00
locks.txt
logfs.txt
Makefile configfs: remove old API 2015-10-13 22:17:57 -07:00
mandatory-locking.txt
ncpfs.txt
nilfs2.txt nilfs2: update project's web site in nilfs2.txt 2014-04-03 16:21:26 -07:00
ntfs.txt NTFS: Remove changelog from Documentation/filesystems/ntfs.txt. 2014-10-16 12:43:57 +01:00
ocfs2-online-filecheck.txt ocfs2: add feature document for online file check 2016-03-22 15:36:02 -07:00
ocfs2.txt ocfs2: update web page + git tree in documentation 2015-02-28 09:57:50 -08:00
omfs.txt
orangefs.txt Orangefs: update orangefs.txt 2016-02-26 14:39:08 -05:00
overlayfs.txt Remove email address from Documentation/filesystems/overlayfs.txt 2015-11-11 10:04:53 -07:00
path-lookup.md Documentation: add new description of path-name lookup. 2015-11-02 18:18:25 -07:00
path-lookup.txt Documentation: add new description of path-name lookup. 2015-11-02 18:18:25 -07:00
porting lookup_open(): lock the parent shared unless O_CREAT is given 2016-05-02 19:51:17 -04:00
proc.txt procfs: expose umask in /proc/<PID>/status 2016-05-20 17:58:30 -07:00
qnx6.txt Documentation: fix common spelling mistakes 2016-04-28 07:51:59 -06:00
quota.txt quota: Update documentation 2015-05-18 11:23:07 +02:00
ramfs-rootfs-initramfs.txt initmpfs: use initramfs if rootfstype= or root= specified 2013-09-11 15:59:38 -07:00
relay.txt doc: Fix typo in doucmentations 2013-07-25 12:34:15 +02:00
romfs.txt
seq_file.txt Documentation: update seq_file 2014-12-29 15:40:18 -07:00
sharedsubtree.txt doc: fix grammar 2016-03-09 15:33:06 -07:00
spufs.txt
squashfs.txt Squashfs: Add LZ4 compression configuration option 2014-11-27 18:48:44 +00:00
sysfs-pci.txt
sysfs-tagging.txt sysfs-tagging.txt: fix pre-kernfs references 2015-09-13 14:38:51 -06:00
sysfs.txt sysfs.txt: mention that store method buffers are null-terminated 2015-09-13 14:38:51 -06:00
sysv-fs.txt
tmpfs.txt mm, fs: remove remaining PAGE_CACHE_* and page_cache_{get,release} usage 2016-04-04 10:41:08 -07:00
ubifs.txt
udf.txt
ufs.txt
vfat.txt fat: add config option to set UTF-8 mount option by default 2016-03-22 15:36:02 -07:00
vfs.txt direct-io: eliminate the offset argument to ->direct_IO 2016-05-01 19:58:39 -04:00
xfs-delayed-logging-design.txt
xfs-self-describing-metadata.txt
xfs.txt xfs: fix kernel version in docs 2015-06-01 07:15:38 +10:00