From: "Huang, Kai" <kai.huang@intel.com>
To: "linux-sgx@vger.kernel.org" <linux-sgx@vger.kernel.org>,
"jarkko@kernel.org" <jarkko@kernel.org>
Cc: "pmenzel@molgen.mpg.de" <pmenzel@molgen.mpg.de>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"bp@alien8.de" <bp@alien8.de>,
"Dhanraj, Vijay" <vijay.dhanraj@intel.com>,
"Chatre, Reinette" <reinette.chatre@intel.com>,
"mingo@redhat.com" <mingo@redhat.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"x86@kernel.org" <x86@kernel.org>,
"haitao.huang@linux.intel.com" <haitao.huang@linux.intel.com>,
"stable@vger.kernel.org" <stable@vger.kernel.org>,
"hpa@zytor.com" <hpa@zytor.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 1/2] x86/sgx: Do not fail on incomplete sanitization on premature stop of ksgxd
Date: Tue, 6 Sep 2022 10:01:50 +0000 [thread overview]
Message-ID: <eb23aa52c7ef9a6665bc966972947a085a1d1af6.camel@intel.com> (raw)
In-Reply-To: <20220906000221.34286-2-jarkko@kernel.org>
On Tue, 2022-09-06 at 03:02 +0300, 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@vger.kernel.org # v5.13+
> Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
(Given the idea of moving sgx_page_reclaimer_init() to the end of sgx_init() is
considered too big to fix this bug:)
Acked-by: Kai Huang <kai.huang@intel.com>
--
Thanks,
-Kai
next prev parent reply other threads:[~2022-09-06 10:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220906000221.34286-1-jarkko@kernel.org>
2022-09-06 0:02 ` Jarkko Sakkinen
2022-09-06 10:01 ` Huang, Kai [this message]
2022-09-08 19:53 ` Reinette Chatre
2022-09-08 21:10 ` Jarkko Sakkinen
2022-09-09 15:31 ` [tip: x86/urgent] " tip-bot2 for Jarkko Sakkinen
2022-09-06 0:02 ` [PATCH v3 2/2] x86/sgx: Handle VA page allocation failure for EAUG on PF Jarkko Sakkinen
2022-09-09 15:31 ` [tip: x86/urgent] " tip-bot2 for Haitao Huang
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=eb23aa52c7ef9a6665bc966972947a085a1d1af6.camel@intel.com \
--to=kai.huang@intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=haitao.huang@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jarkko@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sgx@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pmenzel@molgen.mpg.de \
--cc=reinette.chatre@intel.com \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=vijay.dhanraj@intel.com \
--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®