linux-stable/Documentation/filesystems
Joe Perches cb1f69d53a sysfs: Add sysfs_emit and sysfs_emit_at to format sysfs output
commit 2efc459d06 upstream.

Output defects can exist in sysfs content using sprintf and snprintf.

sprintf does not know the PAGE_SIZE maximum of the temporary buffer
used for outputting sysfs content and it's possible to overrun the
PAGE_SIZE buffer length.

Add a generic sysfs_emit function that knows that the size of the
temporary buffer and ensures that no overrun is done.

Add a generic sysfs_emit_at function that can be used in multiple
call situations that also ensures that no overrun is done.

Validate the output buffer argument to be page aligned.
Validate the offset len argument to be within the PAGE_SIZE buf.

Signed-off-by: Joe Perches <joe@perches.com>
Link: https://lore.kernel.org/r/884235202216d464d61ee975f7465332c86f76b2.1600285923.git.joe@perches.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-07 12:19:01 +01:00
..
caching fscache: Pass object size in rather than calling back for it 2018-04-06 14:05:14 +01:00
cifs smb3: update readme to correct information about /proc/fs/cifs/Stats 2018-08-07 14:20:23 -05:00
configfs
ext4 docs: fix up the obviously obsolete bits in the new ext4 documentation 2018-07-29 16:35:23 -04:00
nfs ipconfig: Write NTP server IPs to /proc/net/ipconfig/ntp_servers 2018-04-24 13:40:42 -04:00
pohmelfs
00-INDEX Staging/IIO patches for 4.18-rc1 2018-06-09 10:32:39 -07:00
9p.txt
adfs.txt
affs.txt affs: fix basic permission bits to actually work 2020-09-09 19:04:30 +02:00
afs.txt afs: Implement @sys substitution handling 2018-04-09 21:12:31 +01:00
autofs-mount-control.txt autofs: use autofs instead of autofs4 in documentation 2018-06-07 17:34:39 -07:00
autofs.txt autofs: use autofs instead of autofs4 in documentation 2018-06-07 17:34:39 -07:00
automount-support.txt autofs: use autofs instead of autofs4 in documentation 2018-06-07 17:34:39 -07:00
befs.txt
bfs.txt
btrfs.txt
ceph.txt ceph: update description of some mount options 2018-06-04 20:46:02 +02:00
coda.txt
conf.py
cramfs.txt cramfs: rehabilitate it 2017-10-15 00:47:23 -04:00
dax.txt powerpc/cell: Remove axonram driver 2018-01-28 17:00:36 +11:00
debugfs.txt
devpts.txt
directory-locking
dlmfs.txt
dnotify.txt Documentation: fix selftests related file refs 2017-10-19 12:58:21 -06:00
ecryptfs.txt
efivarfs.txt
exofs.txt
ext2.txt fs/*/Kconfig: drop links to 404-compliant http://acl.bestbits.at 2018-01-01 12:45:37 -07:00
ext3.txt
f2fs.txt f2fs: support fault_type mount option 2018-08-13 10:48:17 -07:00
fiemap.txt
files.txt
fscrypt.rst fscrypt: return -EXDEV for incompatible rename or link into encrypted dir 2020-11-05 11:08:35 +01:00
fuse-io.txt fuse: add writeback documentation 2018-03-20 17:11:45 +01:00
fuse.txt
gfs2-glocks.txt GFS2: Minor improvements to comments and documentation 2018-04-12 10:07:51 -07:00
gfs2-uevents.txt
gfs2.txt
hfs.txt
hfsplus.txt
hpfs.txt
index.rst docs: create filesystem internal section 2018-07-29 16:14:02 -04:00
inotify.txt
isofs.txt
jfs.txt
Locking overlayfs update for 4.19 2018-08-21 18:19:09 -07:00
locks.txt
mandatory-locking.txt
nilfs2.txt MAINTAINERS, nilfs2: change project home URLs 2018-01-13 10:42:48 -08:00
ntfs.txt
ocfs2-online-filecheck.txt
ocfs2.txt
omfs.txt
orangefs.txt Orangefs: documentation updates 2018-04-04 14:05:48 -04:00
overlayfs.txt ovl: fix regression caused by overlapping layers detection 2019-09-21 07:17:14 +02:00
path-lookup.md autofs: use autofs instead of autofs4 in documentation 2018-06-07 17:34:39 -07:00
path-lookup.txt
porting cifs_atomic_open(): fix double-put on late allocation failure 2020-03-18 07:14:21 +01:00
proc.txt mm, thp, proc: report THP eligibility for each vma 2019-12-17 20:35:45 +01:00
qnx6.txt
quota.txt
ramfs-rootfs-initramfs.txt initramfs: move gen_initramfs_list.sh from scripts/ to usr/ 2018-08-22 23:21:44 +09:00
relay.txt Documentation : Update relay function types 2018-07-10 15:11:00 -06:00
romfs.txt
seq_file.txt seq_file: document how per-entry resources are managed. 2021-03-04 09:39:56 +01:00
sharedsubtree.txt
spufs.txt
squashfs.txt
sysfs-pci.txt
sysfs-tagging.txt
sysfs.txt sysfs: Add sysfs_emit and sysfs_emit_at to format sysfs output 2021-03-07 12:19:01 +01:00
sysv-fs.txt
tmpfs.txt docs/vm: move numa_memory_policy.rst to Documentation/admin-guide/mm 2018-05-08 09:31:31 -06:00
ubifs.txt
udf.txt udf: Remove never implemented mount options 2018-02-27 10:25:33 +01:00
ufs.txt
vfat.txt Documentation/filesystems/vfat.txt: fix a remark that implies UCS2 2017-12-21 13:39:28 -07:00
vfs.txt vfs: add the fadvise() file operation 2018-08-30 17:08:35 +02:00
xfs-delayed-logging-design.txt
xfs-self-describing-metadata.txt
xfs.txt xfs: remove deprecated barrier/nobarrier mount 2018-07-26 10:15:17 -07:00