From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-tip-commits@vger.kernel.org"
<linux-tip-commits@vger.kernel.org>
Cc: kernel test robot <lkp@intel.com>,
Josh Poimboeuf <jpoimboe@kernel.org>,
Ingo Molnar <mingo@kernel.org>, Christoph Hellwig <hch@lst.de>,
Sagi Grimberg <sagi@grimberg.me>,
Chaitanya Kulkarni <chaitanyak@nvidia.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
"x86@kernel.org" <x86@kernel.org>,
"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Subject: Re: [tip: objtool/urgent] objtool, nvmet: Fix out-of-bounds stack access in nvmet_ctrl_state_show()
Date: Tue, 25 Mar 2025 22:20:48 +0000 [thread overview]
Message-ID: <1c9ca973-20a2-47b1-a156-ece2ef72e522@nvidia.com> (raw)
In-Reply-To: <174294059921.14745.13913646647268973086.tip-bot2@tip-bot2>
(+linux-nvme)
On 3/25/25 15:09, tip-bot2 for Josh Poimboeuf wrote:
> The following commit has been merged into the objtool/urgent branch of tip:
>
> Commit-ID: 107a23185d990e3df6638d9a84c835f963fe30a6
> Gitweb: https://git.kernel.org/tip/107a23185d990e3df6638d9a84c835f963fe30a6
> Author: Josh Poimboeuf <jpoimboe@kernel.org>
> AuthorDate: Mon, 24 Mar 2025 14:56:05 -07:00
> Committer: Ingo Molnar <mingo@kernel.org>
> CommitterDate: Tue, 25 Mar 2025 23:00:15 +01:00
>
> objtool, nvmet: Fix out-of-bounds stack access in nvmet_ctrl_state_show()
>
> The csts_state_names[] array only has six sparse entries, but the
> iteration code in nvmet_ctrl_state_show() iterates seven, resulting in a
> potential out-of-bounds stack read. Fix that.
>
> Fixes the following warning with an UBSAN kernel:
>
> vmlinux.o: warning: objtool: .text.nvmet_ctrl_state_show: unexpected end of section
>
> Fixes: 649fd41420a8 ("nvmet: add debugfs support")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
> Signed-off-by: Ingo Molnar <mingo@kernel.org>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Sagi Grimberg <sagi@grimberg.me>
> Cc: Chaitanya Kulkarni <kch@nvidia.com>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> Link: https://lore.kernel.org/r/f1f60858ee7a941863dc7f5506c540cb9f97b5f6.1742852847.git.jpoimboe@kernel.org
> Closes: https://lore.kernel.org/oe-kbuild-all/202503171547.LlCTJLQL-lkp@intel.com/
> ---
> drivers/nvme/target/debugfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/target/debugfs.c b/drivers/nvme/target/debugfs.c
> index 220c739..c6571fb 100644
> --- a/drivers/nvme/target/debugfs.c
> +++ b/drivers/nvme/target/debugfs.c
> @@ -78,7 +78,7 @@ static int nvmet_ctrl_state_show(struct seq_file *m, void *p)
> bool sep = false;
> int i;
>
> - for (i = 0; i < 7; i++) {
> + for (i = 0; i < ARRAY_SIZE(csts_state_names); i++) {
> int state = BIT(i);
>
> if (!(ctrl->csts & state))
Looks good.
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
-ck
next prev parent reply other threads:[~2025-03-25 22:20 UTC|newest]
Thread overview: 75+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-24 21:55 [PATCH 00/22] objtool: CONFIG_OBJTOOL_WERROR fixes and cleanups Josh Poimboeuf
2025-03-24 21:55 ` [PATCH 01/22] objtool: Fix detection of consecutive jump tables Josh Poimboeuf
2025-03-25 8:35 ` [tip: objtool/urgent] objtool: Fix detection of consecutive jump tables on Clang 20 tip-bot2 for Josh Poimboeuf
2025-03-24 21:55 ` [PATCH 02/22] objtool: Warn when disabling unreachable warnings Josh Poimboeuf
2025-03-25 8:35 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf
2025-03-24 21:55 ` [PATCH 03/22] objtool: Ignore entire functions rather than instructions Josh Poimboeuf
2025-03-25 8:35 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf
2025-03-24 21:55 ` [PATCH 04/22] objtool: Fix X86_FEATURE_SMAP alternative handling Josh Poimboeuf
2025-03-25 8:35 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf
2025-03-24 21:55 ` [PATCH 05/22] objtool: Fix CONFIG_OBJTOOL_WERROR for vmlinux.o Josh Poimboeuf
2025-03-25 8:35 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf
2025-03-24 21:55 ` [PATCH 06/22] objtool: Fix init_module() handling Josh Poimboeuf
2025-03-25 8:35 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf
2025-03-24 21:55 ` [PATCH 07/22] objtool: Silence more KCOV warnings Josh Poimboeuf
2025-03-25 8:35 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf
2025-03-24 21:55 ` [PATCH 08/22] objtool: Properly disable uaccess validation Josh Poimboeuf
2025-03-25 8:35 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf
2025-03-24 21:55 ` [PATCH 09/22] objtool: Improve error handling Josh Poimboeuf
2025-03-25 8:35 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf
2025-03-24 21:56 ` [PATCH 10/22] objtool: Reduce CONFIG_OBJTOOL_WERROR verbosity Josh Poimboeuf
2025-03-25 8:35 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf
2025-03-24 21:56 ` [PATCH 11/22] objtool: Fix up some outdated references to ENTRY/ENDPROC Josh Poimboeuf
2025-03-25 8:35 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf
2025-03-24 21:56 ` [PATCH 12/22] objtool: Remove --no-unreachable for noinstr-only vmlinux.o runs Josh Poimboeuf
2025-03-25 8:35 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf
2025-03-24 21:56 ` [PATCH 13/22] objtool: Remove redundant opts.noinstr dependency Josh Poimboeuf
2025-03-25 8:34 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf
2025-03-24 21:56 ` [PATCH 14/22] spi: amd: Fix out-of-bounds stack access in amd_set_spi_freq() Josh Poimboeuf
2025-03-25 8:34 ` [tip: objtool/urgent] objtool, " tip-bot2 for Josh Poimboeuf
2025-03-25 13:13 ` Mark Brown
2025-03-25 22:10 ` tip-bot2 for Josh Poimboeuf
2025-03-24 21:56 ` [PATCH 15/22] nvmet: Fix out-of-bounds stack access in nvmet_ctrl_state_show() Josh Poimboeuf
2025-03-25 8:34 ` [tip: objtool/urgent] objtool, " tip-bot2 for Josh Poimboeuf
2025-03-25 22:09 ` tip-bot2 for Josh Poimboeuf
2025-03-25 22:20 ` Chaitanya Kulkarni [this message]
2025-03-24 21:56 ` [PATCH 16/22] media: dib8000: Prevent divide-by-zero in dib8000_set_dds() Josh Poimboeuf
2025-03-25 8:34 ` [tip: objtool/urgent] objtool, " tip-bot2 for Josh Poimboeuf
2025-03-25 22:09 ` tip-bot2 for Josh Poimboeuf
2025-03-25 22:42 ` Mauro Carvalho Chehab
2025-03-26 1:46 ` Josh Poimboeuf
2025-03-24 21:56 ` [PATCH 17/22] panic: Disable SMAP in __stack_chk_fail() Josh Poimboeuf
2025-03-25 8:34 ` [tip: objtool/urgent] objtool, " tip-bot2 for Josh Poimboeuf
2025-03-25 22:09 ` tip-bot2 for Josh Poimboeuf
2025-03-24 21:56 ` [PATCH 18/22] Input: cyapa - remove undefined behavior in cyapa_update_fw_store() Josh Poimboeuf
2025-03-25 8:34 ` [tip: objtool/urgent] objtool, Input: cyapa - Remove " tip-bot2 for Josh Poimboeuf
2025-03-25 22:09 ` tip-bot2 for Josh Poimboeuf
2025-03-24 21:56 ` [PATCH 19/22] ASoC: codecs: wcd934x: Remove undefined behavior in wcd934x_slim_irq_handler() Josh Poimboeuf
2025-03-25 8:34 ` [tip: objtool/urgent] objtool, ASoC: codecs: wcd934x: Remove potential " tip-bot2 for Josh Poimboeuf
2025-03-25 11:32 ` Mark Brown
2025-03-25 11:36 ` Ingo Molnar
2025-03-25 13:12 ` Mark Brown
2025-03-25 22:09 ` tip-bot2 for Josh Poimboeuf
2025-03-24 21:56 ` [PATCH 20/22] regulator: rk808: Remove undefined behavior in rk806_set_mode_dcdc() Josh Poimboeuf
2025-03-25 8:34 ` [tip: objtool/urgent] objtool, regulator: rk808: Remove potential " tip-bot2 for Josh Poimboeuf
2025-03-25 13:17 ` Mark Brown
2025-03-25 22:09 ` tip-bot2 for Josh Poimboeuf
2025-03-24 21:56 ` [PATCH 21/22] pwm: mediatek: Prevent divide-by-zero in pwm_mediatek_config() Josh Poimboeuf
2025-03-25 8:34 ` [tip: objtool/urgent] objtool, pwm: mediatek: Prevent theoretical " tip-bot2 for Josh Poimboeuf
2025-03-26 10:35 ` Uwe Kleine-König
2025-03-26 11:11 ` Peter Zijlstra
2025-03-27 5:44 ` Josh Poimboeuf
2025-03-27 8:27 ` Uwe Kleine-König
[not found] ` <m7pgkp3ueo7iqgqf74upjrihr3mpmb3sqhwegnjxxwsrgx2jsw@dnec5iqiyobh>
[not found] ` <Z-Uv60sD_S2xYVB1@gmail.com>
2025-03-27 18:14 ` Uwe Kleine-König
2025-03-27 21:21 ` Ingo Molnar
2025-03-28 10:24 ` Uwe Kleine-König
2025-03-28 13:45 ` Ingo Molnar
2025-03-28 18:19 ` Uwe Kleine-König
2025-03-25 22:09 ` tip-bot2 for Josh Poimboeuf
2025-03-27 11:06 ` tip-bot2 for Josh Poimboeuf
2025-03-24 21:56 ` [PATCH 22/22] lkdtm: Obfuscate do_nothing() pointer Josh Poimboeuf
2025-03-25 8:34 ` [tip: objtool/urgent] objtool, lkdtm: Obfuscate the " tip-bot2 for Josh Poimboeuf
2025-03-25 19:39 ` [PATCH 22/22] lkdtm: Obfuscate " Kees Cook
2025-03-25 22:09 ` [tip: objtool/urgent] objtool, lkdtm: Obfuscate the " tip-bot2 for Josh Poimboeuf
2025-03-27 11:06 ` tip-bot2 for Josh Poimboeuf
2025-03-28 13:48 ` tip-bot2 for Josh Poimboeuf
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=1c9ca973-20a2-47b1-a156-ece2ef72e522@nvidia.com \
--to=chaitanyak@nvidia.com \
--cc=hch@lst.de \
--cc=jpoimboe@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=lkp@intel.com \
--cc=mingo@kernel.org \
--cc=sagi@grimberg.me \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.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
all inboxes | Powered by JetHome®