From: Nathan Chancellor <nathan@kernel.org>
To: Xingjing Deng <micro6947@gmail.com>
Cc: nsc@kernel.org, rdunlap@infradead.org, masahiroy@kernel.org,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kconfig: fix potential NULL pointer dereference in conf_askvalue
Date: Thu, 26 Feb 2026 13:35:11 -0700 [thread overview]
Message-ID: <20260226203511.GB3196155@ax162> (raw)
In-Reply-To: <CAK+ZN9pkjJGD4h7jzQiMZGCr6kC4OFBVC4P9Y9zzm8orUjTp-Q@mail.gmail.com>
On Thu, Feb 26, 2026 at 09:25:28AM +0800, Xingjing Deng wrote:
> Nathan Chancellor <nathan@kernel.org> 于2026年2月26日周四 03:44写道:
> >
> > On Wed, Feb 25, 2026 at 07:22:46AM +0000, Xingjing Deng wrote:
> > > In conf_askvalue(), the 'def' argument (retrieved via sym_get_string_value)
> > > can be NULL. When the symbol is not changeable, the code calls
> > > printf("%s\n", def), which leads to a segmentation fault on certain
> > > systems/libc implementations when passing a NULL pointer to %s.
> >
> > How do you reproduce this segmentation fault? Surely someone would have
> > hit this if it were a real problem given the Fixes tag? Or is this a
> > corner case?
>
> I tested printing NULL with printf locally and confirmed that it does
> cause issues. In my opinion, this problem is more of a corner case—I
> identified it through static program analysis and have not yet
> reproduced it in practice.
Thanks for confirming. I think it would be better to make this clearer
in the commit message because it reads as though the problem is
reproducible in practice. Also, 'def ?: ""' would do the same thing with
fewer characters.
Cheers,
Nathan
next prev parent reply other threads:[~2026-02-26 20:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-25 7:22 [PATCH] kconfig: fix potential NULL pointer dereference in conf_askvalue Xingjing Deng
2026-02-25 19:44 ` Nathan Chancellor
2026-02-26 1:25 ` Xingjing Deng
2026-02-26 20:35 ` Nathan Chancellor [this message]
2026-03-01 5:31 ` Xingjing Deng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260226203511.GB3196155@ax162 \
--to=nathan@kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=micro6947@gmail.com \
--cc=nsc@kernel.org \
--cc=rdunlap@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox