[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210105145749.GF28649@zn.tnic>
Date: Tue, 5 Jan 2021 15:57:49 +0100
From: Borislav Petkov <bp@...en8.de>
To: Jarkko Sakkinen <jarkko@...nel.org>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org,
linux-sgx@...r.kernel.org, Sean Christopherson <seanjc@...gle.com>,
Haitao Huang <haitao.huang@...ux.intel.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
Jethro Beekman <jethro@...tanix.com>
Subject: Re: [PATCH v3] x86/sgx: Synchronize encl->srcu in sgx_encl_release().
On Wed, Dec 16, 2020 at 03:49:20PM +0200, Jarkko Sakkinen wrote:
> Add synchronize_srcu_expedited() to sgx_encl_release() to catch a grace
> period initiated by sgx_mmu_notifier_release().
>
> A trivial example of a failing sequence with tasks A and B:
>
> 1. A: -> sgx_release()
> 2. B: -> sgx_mmu_notifier_release()
> 3. B: -> list_del_rcu()
> 3. A: -> sgx_encl_release()
> 4. A: -> cleanup_srcu_struct()
>
> The loop in sgx_release() observes an empty list because B has removed its
> entry in the middle, and calls cleanup_srcu_struct() before B has a chance
> to calls synchronize_srcu().
Leading to what? NULL ptr?
https://lkml.kernel.org/r/X9e2jOWz1hfXVpQ5@google.com
already suggested that you should explain the bug better and add the
splat but I'm still missing that explanation.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists