public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Robin Murphy <robin.murphy@arm.com>
Cc: catalin.marinas@arm.com, will@kernel.org, james.morse@arm.com,
	hch@lst.de, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCHv3 10/17] arm64: uaccess: simplify __copy_user_flushcache()
Date: Mon, 2 Nov 2020 10:14:15 +0000	[thread overview]
Message-ID: <20201102101415.GA71783@C02TD0UTHF1T.local> (raw)
In-Reply-To: <bc671c33-bf9f-f6d7-0ef5-7ef1ed229cce@arm.com>

On Tue, Oct 27, 2020 at 05:33:31PM +0000, Robin Murphy wrote:
> On 2020-10-26 13:31, Mark Rutland wrote:
> > Currently __copy_user_flushcache() open-codes raw_copy_from_user(), and
> > doesn't use uaccess_mask_ptr() on the user address. Let's have it call
> > raw_copy_from_user(), which is both a simplification and ensures that
> > user pointers are masked under speculation.
> 
> I think this originally stems from the fact that "raw_*" were merely generic
> aliases for "__arch_*" at the time. Then whichever chump subsequently
> implemented uaccess_mask_ptr() for arm64 clearly did a terrible job... ;)

:)

> > There should be no functional change as a result of this patch.
> 
> Reviewed-by: Robin Murphy <robin.murphy@arm.com>

Thanks!

Mark.

> 
> > Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> > Cc: Catalin Marinas <catalin.marinas@arm.com>
> > Cc: Christoph Hellwig <hch@lst.de>
> > Cc: Robin Murphy <robin.murphy@arm.com>
> > Cc: Will Deacon <will@kernel.org>
> > ---
> >   arch/arm64/lib/uaccess_flushcache.c | 4 +---
> >   1 file changed, 1 insertion(+), 3 deletions(-)
> > 
> > diff --git a/arch/arm64/lib/uaccess_flushcache.c b/arch/arm64/lib/uaccess_flushcache.c
> > index bfa30b75b2b8e..c83bb5a4aad2c 100644
> > --- a/arch/arm64/lib/uaccess_flushcache.c
> > +++ b/arch/arm64/lib/uaccess_flushcache.c
> > @@ -30,9 +30,7 @@ unsigned long __copy_user_flushcache(void *to, const void __user *from,
> >   {
> >   	unsigned long rc;
> > -	uaccess_enable_not_uao();
> > -	rc = __arch_copy_from_user(to, from, n);
> > -	uaccess_disable_not_uao();
> > +	rc = raw_copy_from_user(to, from, n);
> >   	/* See above */
> >   	__clean_dcache_area_pop(to, n - rc);
> > 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-11-02 10:15 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26 13:31 [PATCHv3 00/17] arm64: remove set_fs() and friends Mark Rutland
2020-10-26 13:31 ` [PATCHv3 01/17] arm64: ensure ERET from kthread is illegal Mark Rutland
2020-10-26 13:31 ` [PATCHv3 02/17] arm64: add C wrappers for SET_PSTATE_*() Mark Rutland
2020-10-26 13:31 ` [PATCHv3 03/17] arm64: head.S: rename el2_setup -> init_kernel_el Mark Rutland
2020-10-26 13:31 ` [PATCHv3 04/17] arm64: head.S: cleanup SCTLR_ELx initialization Mark Rutland
2020-10-26 13:31 ` [PATCHv3 05/17] arm64: head.S: always initialize PSTATE Mark Rutland
2020-10-26 13:31 ` [PATCHv3 06/17] arm64: sdei: move uaccess logic to arch/arm64/ Mark Rutland
2020-10-26 13:31 ` [PATCHv3 07/17] arm64: sdei: explicitly simulate PAN/UAO entry Mark Rutland
2020-10-26 13:31 ` [PATCHv3 08/17] arm64: uaccess: move uao_* alternatives to asm-uaccess.h Mark Rutland
2020-11-03 14:26   ` Will Deacon
2020-11-03 14:41     ` Mark Rutland
2020-10-26 13:31 ` [PATCHv3 09/17] arm64: uaccess: rename privileged uaccess routines Mark Rutland
2020-10-26 13:31 ` [PATCHv3 10/17] arm64: uaccess: simplify __copy_user_flushcache() Mark Rutland
2020-10-27 17:33   ` Robin Murphy
2020-11-02 10:14     ` Mark Rutland [this message]
2020-10-26 13:31 ` [PATCHv3 11/17] arm64: uaccess: refactor __{get,put}_user Mark Rutland
2020-10-27 18:03   ` Robin Murphy
2020-11-02 10:25     ` Mark Rutland
2020-10-26 13:31 ` [PATCHv3 12/17] arm64: uaccess: split user/kernel routines Mark Rutland
2020-11-02 10:48   ` Mark Rutland
2020-10-26 13:31 ` [PATCHv3 13/17] arm64: uaccess cleanup macro naming Mark Rutland
2020-10-27 18:45   ` Robin Murphy
2020-11-02 10:35     ` Mark Rutland
2020-10-26 13:31 ` [PATCHv3 14/17] arm64: uaccess: remove set_fs() Mark Rutland
2020-10-26 13:31 ` [PATCHv3 15/17] arm64: uaccess: remove addr_limit_user_check() Mark Rutland
2020-10-26 13:31 ` [PATCHv3 16/17] arm64: uaccess: remove redundant PAN toggling Mark Rutland
2020-10-26 13:31 ` [PATCHv3 17/17] arm64: uaccess: remove vestigal UAO support Mark Rutland

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=20201102101415.GA71783@C02TD0UTHF1T.local \
    --to=mark.rutland@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=hch@lst.de \
    --cc=james.morse@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=robin.murphy@arm.com \
    --cc=will@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