lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Ypjr5yIMan1N0bqH@yaz-fattaah>
Date:   Thu, 2 Jun 2022 16:57:11 +0000
From:   Yazen Ghannam <yazen.ghannam@....com>
To:     Mikulas Patocka <mpatocka@...hat.com>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Borislav Petkov <bp@...e.de>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Tony Luck <tony.luck@...el.com>, linux-kernel@...r.kernel.org,
        linux-edac@...r.kernel.org
Subject: Re: Warnings when suspending to disk

On Tue, May 31, 2022 at 03:42:12AM -0400, Mikulas Patocka wrote:

...

> > > The machine is two six-core Opterons 8435.
> > > 
> > > Mikulas

Hi Mikulas,

I'm not able to reproduce this issue on the systems I have access to. But I
think the following patch may be the solution. Can you please try this?

Thanks,
Yazen

=========

>From 811aab8b5eb96d7f62b30d745aeacf74447eeccc Mon Sep 17 00:00:00 2001
From: Yazen Ghannam <yazen.ghannam@....com>
Date: Tue, 31 May 2022 16:29:37 +0000
Subject: [PATCH] x86/MCE/AMD: Delete kobject for block instead of bank

The AMD Thresholding kobjects are laid out such that each "bank" is parent
to one or more "blocks". Systems from Family 10h to 16h have bank4 shared
between logical CPUs that are attached to the same Northbridge. This
sharing behavior is handled when creating and removing kobjects.

During removal, the block kobjects are deleted from each CPU sharing bank4.
The final CPU puts all the block kobjects, which also deletes them, and
then puts the bank kobject.

However, __threshold_remove_blocks() deletes the bank kobject before
deleting the block kobjects. This essentially deletes the parent before all
the children, and this may cause kernel warnings.

Don't delete the bank kobject in __threshold_remove_blocks(). Leave this
for the put at the end of threshold_remove_bank(). Instead delete the block
kobject which is used as the head of the list of blocks, after deleting
all the other blocks in the list. This follows the same behavior seen in
deallocate_threshold_blocks().

Fixes: 019f34fccfd5 ("x86, MCE, AMD: Move shared bank to node descriptor")
Cc: stable@...r.kernel.org
Signed-off-by: Yazen Ghannam <yazen.ghannam@....com>
---
 arch/x86/kernel/cpu/mce/amd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/mce/amd.c b/arch/x86/kernel/cpu/mce/amd.c
index 1c87501e0fa3..cda75aed8ea0 100644
--- a/arch/x86/kernel/cpu/mce/amd.c
+++ b/arch/x86/kernel/cpu/mce/amd.c
@@ -1258,10 +1258,10 @@ static void __threshold_remove_blocks(struct threshold_bank *b)
 	struct threshold_block *pos = NULL;
 	struct threshold_block *tmp = NULL;
 
-	kobject_del(b->kobj);
-
 	list_for_each_entry_safe(pos, tmp, &b->blocks->miscj, miscj)
 		kobject_del(&pos->kobj);
+
+	kobject_del(&b->blocks->kobj);
 }
 
 static void threshold_remove_bank(struct threshold_bank *bank)
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ