From: Borislav Petkov <bp@alien8.de>
To: Steven Noonan <steven@uplinklabs.net>
Cc: linux-kernel@vger.kernel.org,
Ariadne Conill <ariadne@ariadne.space>,
Yazen Ghannam <yazen.ghannam@amd.com>,
x86@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 1/2] x86/amd_node: fix integer divide by zero during init
Date: Wed, 3 Dec 2025 22:18:13 +0100 [thread overview]
Message-ID: <20251203211813.GAaTCpFeDir7jXkEPf@fat_crate.local> (raw)
In-Reply-To: <20251114195730.1503879-1-steven@uplinklabs.net>
On Fri, Nov 14, 2025 at 07:57:35PM +0000, Steven Noonan wrote:
> On a Xen dom0 boot, this feature does not behave, and we end up
> calculating:
>
> num_roots = 1
> num_nodes = 2
> roots_per_node = 0
>
> This causes a divide-by-zero in the modulus inside the loop.
>
> This change adds a couple of guards for invalid states where we might
> get a divide-by-zero.
>
> Signed-off-by: Steven Noonan <steven@uplinklabs.net>
> Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
> CC: Yazen Ghannam <yazen.ghannam@amd.com>
> CC: x86@vger.kernel.org
> CC: stable@vger.kernel.org
> ---
> arch/x86/kernel/amd_node.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/arch/x86/kernel/amd_node.c b/arch/x86/kernel/amd_node.c
> index 3d0a4768d603c..cdc6ba224d4ad 100644
> --- a/arch/x86/kernel/amd_node.c
> +++ b/arch/x86/kernel/amd_node.c
> @@ -282,6 +282,17 @@ static int __init amd_smn_init(void)
That better not be loading at all on a X86_FEATURE_HYPERVISOR configuration.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
next prev parent reply other threads:[~2025-12-03 21:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-14 19:57 Steven Noonan
2025-11-14 19:57 ` [PATCH 2/2] x86/amd_node: fix null pointer dereference if amd_smn_init failed Steven Noonan
2025-12-03 20:54 ` Yazen Ghannam
2025-12-03 20:45 ` [PATCH 1/2] x86/amd_node: fix integer divide by zero during init Yazen Ghannam
2025-12-04 20:16 ` Steven Noonan
2025-12-05 15:37 ` Yazen Ghannam
2025-12-03 21:18 ` Borislav Petkov [this message]
2025-12-04 16:45 ` Yazen Ghannam
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=20251203211813.GAaTCpFeDir7jXkEPf@fat_crate.local \
--to=bp@alien8.de \
--cc=ariadne@ariadne.space \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=steven@uplinklabs.net \
--cc=x86@vger.kernel.org \
--cc=yazen.ghannam@amd.com \
/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®