From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9584 Path: news.gmane.org!not-for-mail From: Linus Torvalds Newsgroups: gmane.linux.lib.musl.general,gmane.linux.kernel Subject: Re: Re: [RFC PATCH] x86/vdso/32: Add AT_SYSINFO cancellation helpers Date: Fri, 11 Mar 2016 11:39:28 -0800 Message-ID: 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> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1457725185 22453 80.91.229.3 (11 Mar 2016 19:39:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Mar 2016 19:39:45 +0000 (UTC) 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 To: Andy Lutomirski Original-X-From: musl-return-9597-gllmg-musl=m.gmane.org@lists.openwall.com Fri Mar 11 20:39:44 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1aeSuV-0005wb-2J for gllmg-musl@m.gmane.org; Fri, 11 Mar 2016 20:39:43 +0100 Original-Received: (qmail 28453 invoked by uid 550); 11 Mar 2016 19:39:40 -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 28429 invoked from network); 11 Mar 2016 19:39:40 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=q0wDyUNajHDZfd595IuhYVtv644f8o80ffDyjXgYPBE=; b=ANQOGwsr4uSV+6aVowkFsIw0pE+MJxzwrVPYL7Fp1cnbUyDMsBBNiv5b/eEE+mGNLE c2O8hrN49QSkU5XwvgahBccUU43HFzh5WVajp2aUIZgpb7O0QUKMTxYxcHUqRs77KAEF KP8jNv+vdUnpTq8vt57uCue2M4CSSNQkNWK4cCffq1NNpaDXBsJWkOMEpSkJ8PKgNNRP 1hFGo4uK4W4ECjxNFcJEu3MQ9KFXRgpryqkQNnTsdxm9LxQV2A+CJPrbVVfUDtXdnhZL PE7mIkt+PLpMcsR1i6PbRYgrheQstWn1UZDGrbK5ZIwCCR6oX+sdAt+bVGtAeRICETY5 0Siw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=q0wDyUNajHDZfd595IuhYVtv644f8o80ffDyjXgYPBE=; b=QkiZscC96CBbmvAU375zwem1FXtLXWyg2xntuh2MVB75/sZoVv1wHuduvJZjQUPd+Q d8zJFFh2at97XMng2TpJH8mMm7yZ6IJG9aKjrD+HQcpU0e0LFEbGU/Xi9EBwkzduWUVR YkIHmQUDSJ9wjxx0DEClmeKZn3pFLszLXW328= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=q0wDyUNajHDZfd595IuhYVtv644f8o80ffDyjXgYPBE=; b=WSmfo7yi+utwOJOu7qVeLuDXBAtq3e6UaAOAjxyR9Y90ElzL0hFBZV2/iq0pqU35uQ 6YY45LZH8YxNULMij0CovKELOJ6RAp7QqPLl7iLiNX0XPG5OQO4729NNz/PvxpeAyJNf a6Hvcffn+zQDbM0UjJp1pfsCVxQPZOWqvcyA22zCkw0iw35OZ132iQsjfkWvgPuTOnzk kSiCGKqqMkp9sjuP9WVeo1cp2mr2ZZPexwSf6MelAZ/+QK7rTpoM1uHVnH1yvg1Ko77a arobTR+Hqqm/dekEsAOMmbsG+eM+Ap6fD16/Ves8RV8QXdV8Afugot6Us1n7aXc/S9xv 6r1Q== X-Gm-Message-State: AD7BkJJibfc0cc6k8PNlI1lemnmt4H97zaxtt6i0K9iG5bA45yI3IGvpT+iw193LVt63SmTBrqsN+8bIqmAoOA== X-Received: by 10.107.13.65 with SMTP id 62mr12874373ion.186.1457725168236; Fri, 11 Mar 2016 11:39:28 -0800 (PST) Original-Sender: linus971@gmail.com In-Reply-To: X-Google-Sender-Auth: 2m5CkfSAPohoqX1pttNYUd2KDKo Xref: news.gmane.org gmane.linux.lib.musl.general:9584 gmane.linux.kernel:2175179 Archived-At: 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