summaryrefslogtreecommitdiff
path: root/tools/lib/python/kdoc/python_version.py
diff options
context:
space:
mode:
authorJulian Braha <julianbraha@gmail.com>2026-09-15 22:15:05 +0100
committerNathan Chancellor <nathan@kernel.org>2026-09-17 16:31:00 -0700
commita5e84d6f6df1fdb64c06fdb64894199aaf5ec899 (patch)
tree95178a3fdcbeb79b15878ac57e252daabe8262e4 /tools/lib/python/kdoc/python_version.py
parent95fde4bcc0b7c78b2db6e89a43d47074b79f2afa (diff)
downloadlinux-next-a5e84d6f6df1fdb64c06fdb64894199aaf5ec899.tar.gz
linux-next-a5e84d6f6df1fdb64c06fdb64894199aaf5ec899.zip
kconfig: check for out-of-bounds numeric constants
The Kconfig interpreter internally represents constants as strings, then attempts to parse them as 64-bit signed integers for 'int' options, and 64-bit unsigned integers for 'hex' options. However, there is currently no check that the conversion succeeds, leading to failures when the values are actually used. For example: config LARGE_INT int default 10000000000000000000 config BUGGED_INT_COMPARISON bool default y if LARGE_INT < 2 Obviously 10000000000000000000 is larger than 2, but the Kconfig interpreter will fallback to comparing the two values with strcmp() after the numeric conversion fails, causing the first character, '1', to be compared with '2', and giving the wrong result. Since none of these out-of-bounds values are used as constants anywhere in the tree, we can already make these error out. Assisted-by: LLM Signed-off-by: Julian Braha <julianbraha@gmail.com> Reviewed-by: Nicolas Schier <n.schier@fritz.com> Link: https://patch.msgid.link/20260915211508.291790-3-julianbraha@gmail.com Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions