From: David Laight <David.Laight@ACULAB.COM>
To: 'Thomas Gleixner' <tglx@linutronix.de>,
Andreas Schwab <schwab@linux-m68k.org>
Cc: Nathan Lynch <nathanl@linux.ibm.com>,
"linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>,
Vincenzo Frascino <vincenzo.frascino@arm.com>
Subject: RE: passing NULL to clock_getres (VDSO): terminated by unexpected signal 11
Date: Mon, 21 Oct 2019 09:03:25 +0000 [thread overview]
Message-ID: <9530114b895a41d293c27af76cc47302@AcuMS.aculab.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1910202145160.2090@nanos.tec.linutronix.de>
From: Thomas Gleixner
> Sent: 20 October 2019 20:53
> On Sun, 20 Oct 2019, Andreas Schwab wrote:
> > On Okt 20 2019, Thomas Gleixner wrote:
> >
> > > POSIX does not mention anything about the validity of the pointer handed to
> > > clock_getres().
> >
> > Sure it does: "If the argument res is not NULL, the resolution of the
> > specified clock shall be stored in the location pointed to by res. If
> > res is NULL, the clock resolution is not returned.".
>
> Sigh, that makes a lot of sense - NOT.
>
> But for the sake of making a non-sensical specification happy we can add a
> NULL pointer check for this. The interesting question is what should be
> returned in this case. The kernel returns EFAULT which is probably not
> POSIX compliant either.
The application won't see errno == EFAULT.
EFAULT gets converted to SIGSEGV (probably) in the return-to-user code path.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2019-10-21 9:07 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <0fc22a08-31d9-e4d1-557e-bf5b482a9a20__6444.28012180782$1571503753$gmane$org@c-s.fr>
2019-10-19 19:18 ` passing NULL to clock_getres (VDSO): terminated by unexpected signal 11 Andreas Schwab
2019-10-20 9:20 ` Christophe Leroy
2019-10-20 9:53 ` Andreas Schwab
2019-10-20 10:25 ` Christophe Leroy
2019-10-20 11:44 ` Thomas Gleixner
2019-10-20 12:07 ` Andreas Schwab
2019-10-20 15:45 ` Thomas Gleixner
2019-10-20 16:08 ` Andreas Schwab
2019-10-20 19:53 ` Thomas Gleixner
2019-10-20 21:17 ` Andreas Schwab
2019-10-21 10:07 ` [PATCH] lib/vdso: Make clock_getres() POSIX compliant again Thomas Gleixner
2019-10-21 15:23 ` Christophe Leroy
2019-10-21 9:03 ` David Laight [this message]
2019-10-19 16:46 passing NULL to clock_getres (VDSO): terminated by unexpected signal 11 Christophe Leroy
2019-10-28 15:46 ` Nathan Lynch
2019-10-28 15:50 ` Christophe Leroy
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=9530114b895a41d293c27af76cc47302@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=nathanl@linux.ibm.com \
--cc=schwab@linux-m68k.org \
--cc=tglx@linutronix.de \
--cc=vincenzo.frascino@arm.com \
/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).