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

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:29 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 [this message]
2017-11-28 14:44   ` Nicholas Wilson

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=4c6e2a7a-7618-db76-1e11-1ad9c58df12a@redhat.com \
    --to=fweimer@redhat.com \
    --cc=musl@lists.openwall.com \
    --cc=nicholas.wilson@realvnc.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).