All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <patch-notifications@ellerman.id.au>
To: Anton Blanchard <anton@ozlabs.org>,
	benh@kernel.crashing.org, paulus@samba.org
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: powerpc/vdso64: Use double word compare on pointers
Date: Thu, 29 Sep 2016 23:13:16 +1000 (AEST)	[thread overview]
Message-ID: <3slFPS1qsqz9sDG@ozlabs.org> (raw)
In-Reply-To: <1474787813-22587-1-git-send-email-anton@ozlabs.org>

On Sun, 2016-25-09 at 07:16:53 UTC, Anton Blanchard wrote:
> From: Anton Blanchard <anton@samba.org>
> 
> __kernel_get_syscall_map and __kernel_clock_getres use cmpli to
> check if the passed in pointer is non zero. cmpli maps to a 32 bit
> compare on binutils, so we ignore the top 32 bits.
> 
> A simple test case can be created by passing in a bogus pointer with
> the bottom 32 bits clear. Using a clk_id that is handled by the VDSO,
> then one that is handled by the kernel shows the problem:
> 
>         printf("%d\n", clock_getres(CLOCK_REALTIME, (void *)0x100000000));
>         printf("%d\n", clock_getres(CLOCK_BOOTTIME, (void *)0x100000000));
> 
> And we get:
> 
> 0
> -1
> 
> The bigger issue is if we pass a valid pointer with the bottom 32 bits
> clear, in this case we will return success but won't write any data
> to the pointer.
> 
> I stumbled across this issue because the LLVM integrated assembler
> doesn't accept cmpli with 3 arguments. Fix this by converting them to
> cmpldi.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Anton Blanchard <anton@samba.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/5045ea37377ce8cca6890d32b127ad

cheers

      reply	other threads:[~2016-09-29 13:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-25  7:16 [PATCH] powerpc/vdso64: Use double word compare on pointers Anton Blanchard
2016-09-29 13:13 ` Michael Ellerman [this message]

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=3slFPS1qsqz9sDG@ozlabs.org \
    --to=patch-notifications@ellerman.id.au \
    --cc=anton@ozlabs.org \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.