mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Nicholas Wilson <nicholas.wilson@realvnc.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: "musl@lists.openwall.com" <musl@lists.openwall.com>
Subject: Re: Should calls to mmap/brk handle EINTR?
Date: Tue, 28 Nov 2017 14:44:00 +0000	[thread overview]
Message-ID: <VI1PR0502MB38854C05D6B32D9A63C56F1EE73A0@VI1PR0502MB3885.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <4c6e2a7a-7618-db76-1e11-1ad9c58df12a@redhat.com>

Ah, thanks very much!

I hadn't dug that deep, I just jumped to a conclusion when I saw "return -EINTR", without realising that was just a dummy return value.

Thanks for checking that, I haven't managed to reproduce it, I just guessed from seeing the code that it was possible.

Nick

________________________________________
From: Florian Weimer <fweimer@redhat.com>
Sent: 28 November 2017 14:29:00
To: Nicholas Wilson
Cc: musl@lists.openwall.com
Subject: Re: [musl] Should calls to mmap/brk handle EINTR?

On 11/28/2017 01:51 PM, Nicholas Wilson wrote:

> I've noticed that in Linux 4.7, there's a change compared to the Linux 4.6 code. The mmap and brk syscalls are protected by semaphores, and previously, those syscalls did an uninterruptible wait on the semaphore. Since Linux 4.7, those syscalls can now return EINTR if the semaphore is under contention, and a signal is received while waiting on it.

Is this really true?  How is this not a kernel bug?

Commit dc0ef0df7b6a90892ec41933212ac701152a254c says this:

“
…
Most of the patches are really trivial because the lock is help from a
shallow syscall paths where we can return EINTR trivially and allow the
current task to die (note that EINTR will never get to the userspace as
the task has fatal signal pending). …
”

Those EINTRs really have to be invisible from userspace.  If you can
reproduce EINTR returns to userspace, then something is very wrong.

Thanks,
Florian


      reply	other threads:[~2017-11-28 14:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-28 12:51 Nicholas Wilson
2017-11-28 14:29 ` Florian Weimer
2017-11-28 14:44   ` Nicholas Wilson [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=VI1PR0502MB38854C05D6B32D9A63C56F1EE73A0@VI1PR0502MB3885.eurprd05.prod.outlook.com \
    --to=nicholas.wilson@realvnc.com \
    --cc=fweimer@redhat.com \
    --cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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).