From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12160 Path: news.gmane.org!.POSTED!not-for-mail From: Florian Weimer Newsgroups: gmane.linux.lib.musl.general Subject: Re: Should calls to mmap/brk handle EINTR? Date: Tue, 28 Nov 2017 15:29:00 +0100 Message-ID: <4c6e2a7a-7618-db76-1e11-1ad9c58df12a@redhat.com> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1511879362 12274 195.159.176.226 (28 Nov 2017 14:29:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 28 Nov 2017 14:29:22 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 Cc: musl@lists.openwall.com To: Nicholas Wilson Original-X-From: musl-return-12176-gllmg-musl=m.gmane.org@lists.openwall.com Tue Nov 28 15:29:17 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1eJgsp-0002Zs-PD for gllmg-musl@m.gmane.org; Tue, 28 Nov 2017 15:29:11 +0100 Original-Received: (qmail 6088 invoked by uid 550); 28 Nov 2017 14:29:15 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 6070 invoked from network); 28 Nov 2017 14:29:14 -0000 In-Reply-To: Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 28 Nov 2017 14:29:02 +0000 (UTC) Xref: news.gmane.org gmane.linux.lib.musl.general:12160 Archived-At: 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