<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/scripts/kconfig/tests/warn_num_bounds/Kconfig, branch master</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>kconfig: prevent out-of-bounds user input for numeric options</title>
<updated>2026-09-17T23:31:00+00:00</updated>
<author>
<name>Julian Braha</name>
<email>julianbraha@gmail.com</email>
</author>
<published>2026-09-15T21:15:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=54f11924e4854177b357af499ebc447dc8c3c590'/>
<id>54f11924e4854177b357af499ebc447dc8c3c590</id>
<content type='text'>
Currently, user input of out-of-bounds values for 'int' and 'hex' options
is possible, leading to later silent failures in Kconfig if that value is
used in a comparison, or a warning by GCC or error by Clang if used in the
C code.

Let's factor out the out-of-bounds check on constants, so that it can be
reused for checking user input.

The frontend will now reject an attempted user input of an out-of-bounds
numeric value, similarly to how a value outside the active 'range' already
does.

For migration of existing configurations, a .config file with an
out-of-bounds numeric value will be allowed for now, but will warn the
user when read in by confdata.c

Assisted-by: LLM
Signed-off-by: Julian Braha &lt;julianbraha@gmail.com&gt;
Reviewed-by: Nicolas Schier &lt;n.schier@fritz.com&gt;
Link: https://patch.msgid.link/20260915211508.291790-5-julianbraha@gmail.com
Signed-off-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, user input of out-of-bounds values for 'int' and 'hex' options
is possible, leading to later silent failures in Kconfig if that value is
used in a comparison, or a warning by GCC or error by Clang if used in the
C code.

Let's factor out the out-of-bounds check on constants, so that it can be
reused for checking user input.

The frontend will now reject an attempted user input of an out-of-bounds
numeric value, similarly to how a value outside the active 'range' already
does.

For migration of existing configurations, a .config file with an
out-of-bounds numeric value will be allowed for now, but will warn the
user when read in by confdata.c

Assisted-by: LLM
Signed-off-by: Julian Braha &lt;julianbraha@gmail.com&gt;
Reviewed-by: Nicolas Schier &lt;n.schier@fritz.com&gt;
Link: https://patch.msgid.link/20260915211508.291790-5-julianbraha@gmail.com
Signed-off-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
