freebsd-dev/module/icp
Richard Yao 303678350a
Convert some sprintf() calls to kmem_scnprintf()
These `sprintf()` calls are used repeatedly to write to a buffer. There
is no protection against overflow other than reviewers explicitly
checking to see if the buffers are big enough. However, such issues are
easily missed during review and when they are missed, we would rather
stop printing rather than have a buffer overflow, so we convert these
functions to use `kmem_scnprintf()`. The Linux kernel provides an entire
page for module parameters, so we are safe to write up to PAGE_SIZE.

Removing `sprintf()` from these functions removes the last instances of
`sprintf()` usage in our platform-independent kernel code. This improves
XNU kernel compatibility because the XNU kernel does not support
(removed support for?) `sprintf()`.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Jorgen Lundman <lundman@lundman.net>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14209
2022-11-28 13:49:58 -08:00
..
algs Convert some sprintf() calls to kmem_scnprintf() 2022-11-28 13:49:58 -08:00
api Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
asm-aarch64/blake3 Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
asm-ppc64/blake3 Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
asm-x86_64 icp: fix all !ENDBR objtool warnings in x86 Asm code 2022-11-04 11:25:56 -07:00
core Fix use-after-free bugs in icp code 2022-09-15 11:46:42 -07:00
include icp: fix all !ENDBR objtool warnings in x86 Asm code 2022-11-04 11:25:56 -07:00
io Fix possible NULL pointer dereference in sha2_mac_init() 2022-10-18 15:35:23 -07:00
spi Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
illumos-crypto.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00