summaryrefslogtreecommitdiff
path: root/scripts/Makefile.thinlto
diff options
context:
space:
mode:
authorChuck Lever <cel@kernel.org>2026-08-16 13:19:14 -0400
committerChuck Lever <cel@kernel.org>2026-10-04 21:15:29 -0400
commite27c63245903402ccfdb46c576462981a7e032e3 (patch)
treee19b29cf7302dba5380e1aac6b97bb8027c75cfa /scripts/Makefile.thinlto
parent0995447b8059c4d23853cdcddbe789c4a2b6bb88 (diff)
NFSD: Fail a pool_threads read whose reply does not fit
The reply to a pool_threads read is the list of per-pool thread counts, formatted into a buffer of SIMPLE_TRANSACTION_LIMIT bytes. snprintf() truncates its last write and strlen() measures only what fit, so a reply too long for that buffer ends mid-number with no terminating newline. A pool running 4096 threads is reported as 40. Nothing marks the reply as incomplete, so an administrator reads a plausible but wrong count. Take snprintf()'s return value, which reports the truncation strlen() cannot see, and fail the read with -ENAMETOOLONG when the list does not fit. That is the errno svc_one_xprt_name() already returns for the same condition. Suggested-by: David Laight <david.laight.linux@gmail.com> Fixes: eed2965af1ba ("[PATCH] knfsd: allow admin to set nthreads per node") Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260812193349.13347-1-david.laight.linux@gmail.com Signed-off-by: Chuck Lever <cel@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions