]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
kernel: fix off-by-one benign bugs
authorAlejandro Colomar <alx@kernel.org>
Thu, 11 Dec 2025 10:44:00 +0000 (11:44 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 21 Jan 2026 03:44:19 +0000 (19:44 -0800)
commita9e5620c9a9e237b3344702dec0839b89159a060
tree19672cb04e1191a74073fc070c11dc7234312aa6
parent8118f197b7b738285eb4b66a80d01a5c8f35e231
kernel: fix off-by-one benign bugs

We were wasting a byte due to an off-by-one bug.  s[c]nprintf() doesn't
write more than $2 bytes including the null byte, so trying to pass
'size-1' there is wasting one byte.

This is essentially the same as the previous commit, in a different
file.

Link: https://lkml.kernel.org/r/b4a945a4d40b7104364244f616eb9fb9f1fa691f.1765449750.git.alx@kernel.org
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Cc: Marco Elver <elver@google.com>
Cc: Kees Cook <kees@kernel.org>
Cc: Christopher Bazley <chris.bazley.wg14@gmail.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Jann Horn <jannh@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Marco Elver <elver@google.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Maciej W. Rozycki <macro@orcam.me.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/kcsan/kcsan_test.c