linux/Documentation
Joe Perches 2efc459d06 sysfs: Add sysfs_emit and sysfs_emit_at to format sysfs output
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>
2020-10-02 12:02:30 +02:00
..
ABI powerpc/perf/hv-24x7: Move cpumask file to top folder of hv-24x7 driver 2020-08-21 23:35:27 +10:00
accounting
admin-guide Char / Misc driver fixes for 5.9-rc5 2020-09-13 08:52:21 -07:00
arm
arm64
block
bpf
cdrom
core-api
cpu-freq
crypto
dev-tools
devicetree ARM: SoC fixes 2020-09-13 14:54:40 -07:00
doc-guide
driver-api Merge 5.9-rc5 into driver-core-next 2020-09-14 10:08:57 +02:00
fault-injection nvme: rename and document nvme_end_request 2020-08-21 17:14:28 -06:00
fb
features
filesystems sysfs: Add sysfs_emit and sysfs_emit_at to format sysfs output 2020-10-02 12:02:30 +02:00
firmware_class
firmware-guide
fpga
gpu
hid
hwmon Documentation: fix typo for abituguru documentation 2020-08-24 17:19:07 -06:00
i2c
ia64
ide
iio
infiniband
input
isdn
kbuild kbuild: Documentation: clean up makefiles.rst 2020-09-03 12:21:22 +09:00
kernel-hacking
leds
litmus-tests
livepatch
locking Documentation/locking/locktypes: fix local_locks documentation 2020-08-24 17:18:51 -06:00
m68k
maintainer Documentation: add riscv entry in list of existing profiles 2020-08-24 17:19:07 -06:00
mhi
mips
misc-devices
netlabel
networking doc: net: dsa: Fix typo in config code sample 2020-09-03 10:38:22 -07:00
nios2
nvdimm
openrisc
parisc
PCI
pcmcia
power
powerpc Documentation/powerpc: fix malformed table in syscall64-abi 2020-08-27 17:40:55 +10:00
process docs: Fix function name trailing double-()s 2020-08-24 17:19:07 -06:00
RCU docs: Fix function name trailing double-()s 2020-08-24 17:19:07 -06:00
riscv
s390
scheduler
scsi
security
sh
sound ALSA: hda: use consistent HDAudio spelling in comments/docs 2020-09-02 19:31:32 +02:00
sparc
sphinx
sphinx-static
spi
staging
target
timers
trace
translations docs: Fix function name trailing double-()s 2020-08-24 17:19:07 -06:00
usb
userspace-api
virt arm64/x86: KVM: Introduce steal-time cap 2020-08-21 14:05:19 +01:00
vm
w1
watchdog
x86
xtensa
.gitignore
asm-annotations.rst
atomic_bitops.txt
atomic_t.txt
Changes
CodingStyle
conf.py
COPYING-logo
docutils.conf
dontdiff
index.rst
Kconfig
logo.gif
Makefile
memory-barriers.txt
SubmittingPatches
watch_queue.rst