From: Leonardo Bras <leonardo@linux.ibm.com>
To: Paul Mackerras <paulus@ozlabs.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Michael Ellerman <mpe@ellerman.id.au>
Cc: Leonardo Bras <leonardo@linux.ibm.com>,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
kvm-ppc@vger.kernel.org
Subject: [PATCH v3 0/2] Replace current->mm by kvm->mm on powerpc/kvm
Date: Tue, 26 Nov 2019 19:36:29 -0300 [thread overview]
Message-ID: <20191126223631.389779-1-leonardo@linux.ibm.com> (raw)
Replace current->mm by kvm->mm on powerpc/kvm
By replacing, we would reduce the use of 'global' current on code,
relying more in the contents of kvm struct.
On code, I found that in kvm_create_vm() there is:
kvm->mm = current->mm;
And that on every kvm_*_ioctl we have tests like that:
if (kvm->mm != current->mm)
return -EIO;
So this change would be safe.
---
Changes since v2:
- Rebased on torvalds/master and updated the remaining patches.
Changes since v1:
- Fixes possible 'use after free' on kvm_spapr_tce_release (from v1)
- Fixes possible 'use after free' on kvm_vm_ioctl_create_spapr_tce
- Fixes undeclared variable error
Leonardo Bras (2):
powerpc/kvm/book3s: Replace current->mm by kvm->mm
powerpc/kvm/book3e: Replace current->mm by kvm->mm
arch/powerpc/kvm/book3s_64_mmu_hv.c | 4 ++--
arch/powerpc/kvm/book3s_64_vio.c | 10 ++++++----
arch/powerpc/kvm/book3s_hv.c | 10 +++++-----
arch/powerpc/kvm/booke.c | 2 +-
4 files changed, 14 insertions(+), 12 deletions(-)
--
2.23.0
next reply other threads:[~2019-11-26 22:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-26 22:36 Leonardo Bras [this message]
2019-11-26 22:36 ` [PATCH v3 1/2] powerpc/kvm/book3s: Replace current->mm by kvm->mm Leonardo Bras
2019-11-26 22:36 ` [PATCH v3 2/2] powerpc/kvm/book3e: " Leonardo Bras
2019-11-27 16:20 ` [PATCH v3 0/2] Replace current->mm by kvm->mm on powerpc/kvm Leonardo Bras
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=20191126223631.389779-1-leonardo@linux.ibm.com \
--to=leonardo@linux.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=kvm-ppc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@ozlabs.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).