From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: linux-sgx@vger.kernel.org
Subject: [PATCH for_v23 v2 0/9] x86/sgx: Misc page related fixes
Date: Thu, 10 Oct 2019 16:20:59 -0700 [thread overview]
Message-ID: <20191010232108.27075-1-sean.j.christopherson@intel.com> (raw)
Two critical bug fixes for a memory leak in sgx_encl_destroy() and a
livelock due to the EPC page free count getting corrupted. The rest of
the patches are minor bug fixes and enhancements I collected in the
process of hunting down the livelock.
v2: Fully fix the memory leak, which was hilariously worse than originally
thought. Fun fact, the leak has existed since v18, i.e. nearly a year.
Sean Christopherson (9):
x86/sgx: WARN once if an enclave is released with unfreed EPC pages
x86/sgx: Do not EWB SECS if the enclave is dead
x86/sgx: Fix a memory leak in sgx_encl_destroy()
x86/sgx: WARN on any non-zero return from __eremove()
x86/sgx: WARN only once if EREMOVE fails
x86/sgx: Split second half of sgx_free_page() to a separate helper
x86/sgx: Use the post-reclaim variant of __sgx_free_page()
x86/sgx: Don't update free page count if EPC section allocation fails
x86/sgx: Reinstate per EPC section free page counts
arch/x86/kernel/cpu/sgx/encl.c | 34 ++++++++++++-------
arch/x86/kernel/cpu/sgx/ioctl.c | 6 ++--
arch/x86/kernel/cpu/sgx/main.c | 54 ++++++++++++++++++++++---------
arch/x86/kernel/cpu/sgx/reclaim.c | 25 +++++++-------
arch/x86/kernel/cpu/sgx/sgx.h | 19 ++++++++++-
5 files changed, 96 insertions(+), 42 deletions(-)
--
2.22.0
next reply other threads:[~2019-10-10 23:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-10 23:20 Sean Christopherson [this message]
2019-10-10 23:21 ` [PATCH for_v23 v2 1/9] x86/sgx: WARN once if an enclave is released with unfreed EPC pages Sean Christopherson
2019-10-10 23:21 ` [PATCH for_v23 v2 2/9] x86/sgx: Do not EWB SECS if the enclave is dead Sean Christopherson
2019-10-10 23:21 ` [PATCH for_v23 v2 3/9] x86/sgx: Fix a memory leak in sgx_encl_destroy() Sean Christopherson
2019-10-10 23:21 ` [PATCH for_v23 v2 4/9] x86/sgx: WARN on any non-zero return from __eremove() Sean Christopherson
2019-10-10 23:21 ` [PATCH for_v23 v2 5/9] x86/sgx: WARN only once if EREMOVE fails Sean Christopherson
2019-10-10 23:21 ` [PATCH for_v23 v2 6/9] x86/sgx: Split second half of sgx_free_page() to a separate helper Sean Christopherson
2019-10-10 23:21 ` [PATCH for_v23 v2 7/9] x86/sgx: Use the post-reclaim variant of __sgx_free_page() Sean Christopherson
2019-10-10 23:21 ` [PATCH for_v23 v2 8/9] x86/sgx: Don't update free page count if EPC section allocation fails Sean Christopherson
2019-10-10 23:21 ` [PATCH for_v23 v2 9/9] x86/sgx: Reinstate per EPC section free page counts Sean Christopherson
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=20191010232108.27075-1-sean.j.christopherson@intel.com \
--to=sean.j.christopherson@intel.com \
--cc=jarkko.sakkinen@linux.intel.com \
--cc=linux-sgx@vger.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;
as well as URLs for NNTP newsgroup(s).