[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YxpaWMoeQS2ccwY8@kernel.org>
Date: Fri, 9 Sep 2022 00:10:48 +0300
From: Jarkko Sakkinen <jarkko@...nel.org>
To: Reinette Chatre <reinette.chatre@...el.com>
Cc: linux-sgx@...r.kernel.org,
Haitao Huang <haitao.huang@...ux.intel.com>,
Vijay Dhanraj <vijay.dhanraj@...el.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Kai Huang <kai.huang@...el.com>, stable@...r.kernel.org,
Paul Menzel <pmenzel@...gen.mpg.de>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
"open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 1/2] x86/sgx: Do not fail on incomplete sanitization
on premature stop of ksgxd
On Thu, Sep 08, 2022 at 12:53:55PM -0700, Reinette Chatre wrote:
>
>
> On 9/5/2022 5:02 PM, Jarkko Sakkinen wrote:
> > Unsanitized pages trigger WARN_ON() unconditionally, which can panic the
> > whole computer, if /proc/sys/kernel/panic_on_warn is set.
> >
> > In sgx_init(), if misc_register() fails or misc_register() succeeds but
> > neither sgx_drv_init() nor sgx_vepc_init() succeeds, then ksgxd will be
> > prematurely stopped. This may leave unsanitized pages, which will result a
> > false warning.
> >
> > Refine __sgx_sanitize_pages() to return:
> >
> > 1. Zero when the sanitization process is complete or ksgxd has been
> > requested to stop.
> > 2. The number of unsanitized pages otherwise.
> >
> > Link: https://lore.kernel.org/linux-sgx/20220825051827.246698-1-jarkko@kernel.org/T/#u
> > Fixes: 51ab30eb2ad4 ("x86/sgx: Replace section->init_laundry_list with sgx_dirty_page_list")
> > Cc: stable@...r.kernel.org # v5.13+
> > Reported-by: Paul Menzel <pmenzel@...gen.mpg.de>
> > Signed-off-by: Jarkko Sakkinen <jarkko@...nel.org>
>
> Reviewed-by: Reinette Chatre <reinette.chatre@...el.com>
Thanks.
I also split down the long augment test also into pieces now,
as you requested, and I think it is now somewhat clean.
BR, Jarkko
Powered by blists - more mailing lists