OpenCloudOS-Kernel/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
PCI pci-v5.9-changes 2020-08-07 18:48:15 -07:00
RCU docs: Fix function name trailing double-()s 2020-08-24 17:19:07 -06:00
accounting
admin-guide Char / Misc driver fixes for 5.9-rc5 2020-09-13 08:52:21 -07:00
arm ARM development for 5.9-rc1: 2020-08-06 10:17:00 -07:00
arm64 IOMMU Updates for Linux v5.9 2020-08-11 14:13:24 -07:00
block for-5.9/drivers-20200803 2020-08-05 10:51:40 -07:00
bpf doc: Add link to bpf helpers man page 2020-08-13 22:48:06 +02:00
cdrom A handful of obvious fixes that wandered in during the merge window. 2020-08-13 13:57:45 -07:00
core-api A handful of obvious fixes that wandered in during the merge window. 2020-08-13 13:57:45 -07:00
cpu-freq
crypto It's been a busy cycle for documentation - hopefully the busiest for a 2020-08-04 22:47:54 -07:00
dev-tools A handful of obvious fixes that wandered in during the merge window. 2020-08-13 13:57:45 -07:00
devicetree ARM: SoC fixes 2020-09-13 14:54:40 -07:00
doc-guide A handful of late-arriving docs fixes, along with a patch changing a lot of 2020-06-10 14:12:15 -07:00
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 drm next for 5.9-rc1 2020-08-05 19:50:06 -07:00
features A handful of obvious fixes that wandered in during the merge window. 2020-08-13 13:57:45 -07:00
filesystems sysfs: Add sysfs_emit and sysfs_emit_at to format sysfs output 2020-10-02 12:02:30 +02:00
firmware-guide ACPI: Replace HTTP links with HTTPS ones 2020-07-27 14:47:08 +02:00
firmware_class
fpga Char/Misc driver patches for 5.9-rc1 2020-08-05 11:43:47 -07:00
gpu - Core Frameworks 2020-08-11 13:48:02 -07:00
hid docs: hid: Convert link to https 2020-07-13 11:26:37 -06:00
hwmon Documentation: fix typo for abituguru documentation 2020-08-24 17:19:07 -06:00
i2c Merge branch 'i2c/for-5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2020-08-13 18:41:00 -07:00
ia64 docs: ia64: correct typo 2020-07-31 11:09:09 -06:00
ide
iio
infiniband
input Input: uinput - fix typo in function name documentation 2020-07-28 18:24:11 -07:00
isdn
kbuild kbuild: Documentation: clean up makefiles.rst 2020-09-03 12:21:22 +09:00
kernel-hacking
leds LEDs changes for 5.9-rc1. 2020-08-05 19:24:27 -07:00
litmus-tests Documentation/litmus-tests: Add note on herd7 7.56 in atomic litmus test 2020-06-29 12:05:18 -07:00
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 It's been a busy cycle for documentation - hopefully the busiest for a 2020-08-04 22:47:54 -07:00
misc-devices Documentation: misc/xilinx_sdfec: eliminate duplicated word 2020-07-13 09:44:07 -06:00
netlabel
networking doc: net: dsa: Fix typo in config code sample 2020-09-03 10:38:22 -07:00
nios2
nvdimm
openrisc docs: openrisc: Replace HTTP links with HTTPS ones 2020-07-13 11:34:09 -06:00
parisc
pcmcia
power Merge branches 'pm-sleep', 'pm-domains', 'powercap' and 'pm-tools' 2020-08-03 13:12:44 +02:00
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
riscv
s390 It's been a busy cycle for documentation - hopefully the busiest for a 2020-08-04 22:47:54 -07:00
scheduler sched/doc: Factorize bits between sched-energy.rst & sched-capacity.rst 2020-08-01 09:19:43 +02:00
scsi scsi: advansys: docs: Eliminate duplicated word 2020-07-08 01:32:11 -04:00
security Documentation: security/keys: eliminate duplicated word 2020-07-13 09:45:03 -06:00
sh docs: sh: convert register-banks.txt to ReST 2020-06-19 14:10:13 -06:00
sound ALSA: hda: use consistent HDAudio spelling in comments/docs 2020-09-02 19:31:32 +02:00
sparc
sphinx Replace HTTP links with HTTPS ones: Documentation/sphinx/parse-headers.pl 2020-06-26 10:57:33 -06:00
sphinx-static
spi SPI SUBSYSTEM: Replace HTTP links with HTTPS ones 2020-07-09 22:41:11 +01:00
staging remoteproc updates for v5.9 2020-08-11 11:17:45 -07:00
target doc: don't use deprecated "---help---" markers in target docs 2020-06-13 13:32:40 -07:00
timers docs: timers: drop documentation about LB_BIAS 2020-07-23 14:32:44 -06:00
trace A handful of obvious fixes that wandered in during the merge window. 2020-08-13 13:57:45 -07:00
translations docs: Fix function name trailing double-()s 2020-08-24 17:19:07 -06:00
usb USB: Replace HTTP links with HTTPS ones 2020-07-21 13:41:57 +02:00
userspace-api remoteproc updates for v5.9 2020-08-11 11:17:45 -07:00
virt arm64/x86: KVM: Introduce steal-time cap 2020-08-21 14:05:19 +01:00
vm mm/vmstat: add events for THP migration without split 2020-08-12 10:57:57 -07:00
w1
watchdog watchdog: add support for adjusting last known HW keepalive time 2020-08-05 18:43:02 +02:00
x86 It's been a busy cycle for documentation - hopefully the busiest for a 2020-08-04 22:47:54 -07:00
xtensa
.gitignore
COPYING-logo Replace HTTP links with HTTPS ones: documentation 2020-06-08 09:30:19 -06:00
Changes
CodingStyle
Kconfig
Makefile media updates for v5.8-rc1 2020-06-03 20:59:38 -07:00
SubmittingPatches
asm-annotations.rst
atomic_bitops.txt
atomic_t.txt Documentation/litmus-tests/atomic: Add a test for smp_mb__after_atomic() 2020-06-29 12:05:18 -07:00
conf.py Replace HTTP links with HTTPS ones: documentation 2020-06-08 09:30:19 -06:00
docutils.conf
dontdiff Documentation: dontdiff: Add zstd compressed files 2020-07-31 11:51:10 +02:00
index.rst docs: index.rst: Add watch_queue 2020-07-23 14:13:23 -06:00
logo.gif
memory-barriers.txt powerpc updates for 5.9 2020-08-07 10:33:50 -07:00
watch_queue.rst