Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932258AbcCKTjc (ORCPT ); Fri, 11 Mar 2016 14:39:32 -0500 Received: from mail-io0-f181.google.com ([209.85.223.181]:35049 "EHLO mail-io0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932207AbcCKTj3 (ORCPT ); Fri, 11 Mar 2016 14:39:29 -0500 MIME-Version: 1.0 In-Reply-To: References: <06079088639eddd756e2092b735ce4a682081308.1457486598.git.luto@kernel.org> <20160309085631.GA3247@gmail.com> <20160309113449.GZ29662@port70.net> <20160310033446.GL9349@brightrain.aerifal.cx> <20160310111646.GA13102@gmail.com> <20160310164104.GM9349@brightrain.aerifal.cx> <20160310180331.GB15940@gmail.com> <20160310232819.GR9349@brightrain.aerifal.cx> <20160311093347.GA17749@gmail.com> <20160311113914.GD29662@port70.net> Date: Fri, 11 Mar 2016 11:39:28 -0800 X-Google-Sender-Auth: 2m5CkfSAPohoqX1pttNYUd2KDKo Message-ID: Subject: Re: [musl] Re: [RFC PATCH] x86/vdso/32: Add AT_SYSINFO cancellation helpers From: Linus Torvalds To: Andy Lutomirski Cc: Ingo Molnar , Rich Felker , Andy Lutomirski , "the arch/x86 maintainers" , Linux Kernel Mailing List , Borislav Petkov , "musl@lists.openwall.com" , Andrew Morton , Thomas Gleixner , Peter Zijlstra Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1257 Lines: 28 On Fri, Mar 11, 2016 at 11:30 AM, Andy Lutomirski wrote: > > I think that this would almost work for musl, except that musl would > still need to be able to tell whether the syscall that eventually gets > interrupted is a cancellation point, which still may require some > ability to unwind from the vdso. The syscall handler can easily tell > the syscall number (it's in EAX), but it may need the effective EIP as > well. So having tried to read the posix manual pages on this, it looks like there is a list of *minimal* cancellation points, but that saying "any system call is a cancellation point" is also perfectly valid. "An implementation may also mark other functions not specified in the standard as cancellation points" Of course, musl may have more strict ideas than that on cancellation points. The "any system call" would make even trivial non-blocking ones like "futex_wake()" and "getpid()" be cancellation points. So maybe "any system call" isn't acceptable. But if it *is* acceptable, that would be a pretty simple kernel mod, I think. And I could see others possibly wanting to use synchronous signal handlers. It's not like musl is the only project ever to have had races with signals.. Linus