All of lore.kernel.org
 help / color / mirror / Atom feed
From: yangyingliang@huawei.com (Yang Yingliang)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 0/4] arm64: vdso: check whether the params is invalid address
Date: Wed, 8 Jun 2016 17:18:26 +0800	[thread overview]
Message-ID: <5757E2E2.3010609@huawei.com> (raw)
In-Reply-To: <20160606171248.GL669@arm.com>



On 2016/6/7 1:12, Will Deacon wrote:
> On Wed, Jun 01, 2016 at 11:05:58AM +0800, Yang Yingliang wrote:
>> The params of gettimeofday(), clock_gettime() and clock_getres()
>> is not checked. This will cause segment faults when the address is
>> invalid.
>> E.g. gettimeofday(-1, -1);
>>       clock_gettime(0, -1);
>>       clock_getres(0, -1);
>> This patchset add a macro and use it to check the validation of these
>> pointer params.
>
> Is this really necessary? It doesn't look to me like other architectures
> bother with this, and you're just adding code to the fastpath to handle
> cases that shouldn't happen to start with.
I agree.

I find clock_gettime() don't check if tp is NULL. I think it need a
checking like clock_getres().

What's your suggestion ?

Thanks,
Yang
>
> Also, I think I remember seeing SEGVs from libc wrappers for other syscalls
> in the past, so this just isn't compelling to me.
>
> Will
>
> .
>

  reply	other threads:[~2016-06-08  9:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01  3:05 [RFC PATCH 0/4] arm64: vdso: check whether the params is invalid address Yang Yingliang
2016-06-01  3:05 ` [RFC PATCH 1/4] arm64: vdso: introdce a macro for checking the address Yang Yingliang
2016-06-01  3:06 ` [RFC PATCH 2/4] arm64: vdso: check whether the params of gettimeofday() is valid Yang Yingliang
2016-06-01  3:06 ` [RFC PATCH 3/4] arm64: vdso: check whether the tp pointer is valid in clock_gettime() Yang Yingliang
2016-06-01  3:06 ` [RFC PATCH 4/4] arm64: vdso: check whether the res pointer is valid in clock_getres() Yang Yingliang
2016-06-06 17:12 ` [RFC PATCH 0/4] arm64: vdso: check whether the params is invalid address Will Deacon
2016-06-08  9:18   ` Yang Yingliang [this message]
2016-06-08  9:33     ` Will Deacon

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=5757E2E2.3010609@huawei.com \
    --to=yangyingliang@huawei.com \
    --cc=linux-arm-kernel@lists.infradead.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.