Received: by 10.223.164.221 with SMTP id h29csp2546887wrb; Mon, 30 Oct 2017 05:55:53 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Sq8rSiE2QI4j6HoSq1gOnMBD+eIWQnbDrdnIsg0rUqPgS8ZJKfOTtGwwptTX1kYfOhkyBn X-Received: by 10.84.168.101 with SMTP id e92mr7544979plb.128.1509368153279; Mon, 30 Oct 2017 05:55:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509368153; cv=none; d=google.com; s=arc-20160816; b=BO1zG9+yDjaCQRMLzPSRIQWQhr29BLAIDfs2ypNxqxdeAbRQ7gvbdw3ApWuZ53/LMZ SHwY8XNX+IVwnMvNIM0t3MOmYb2oKdrJc6i6UY/cG0oYmmdI4aZ86/bCVod8UFUYWGvQ ER//HRWdzRl4D59YN6H6JV+y+msXaE942+55K/+SS8AJPB9XaG9EknOD1qKKWMbxXWWY C8lztJi3BaD3hqw+JUM9tLKQvVWFrjIphYt20Be9nasZXF9K3SPXvaN9fyiuLOU7PKM4 CUXRUpV1CX+1T/5u58wnVzF1Z7XD/tpTzMNrbVChWUWVZ3K1A7Fu/6U+Z/60nJh4bV3S IX9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:subject:cc:to:mime-version:user-agent:reply-to:from:date :message-id:arc-authentication-results; bh=PPz/8lKT8WAZTyHgnUITYk2We8eHlGIuac6RRu8jzXo=; b=RqwACKPZNyAGzcu/Y2uNNHwBDESnKdx/MAJGaSG8C4QlqA5vp686Uu9QG9vDiI9Cpc DJxiaZ318woCiP86gzlH6ZqUIFF1zMUWj766XmN/AEDimaIJHtdpq80E6mDzCHF49MOR dzwgRb6UyB8jBrCZH5r3vyPQKsGtPuA/a4ylY43jQ4jUTs/V5NPeN2OIHV8rq3QmlyIJ EfVemvuzzg+pEQnEJOdQqQreUC270C3QjSqR2DP5JNYR38JDXADB/TX0pcPLfZ0grhWj cC0Oj2UHTiZU++0TFpVhuKhHyltdiKDWv4qGloevrz54TLw+DrDFpHB3iv8CujDa1j5q a5Wg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u18si10899220pfk.328.2017.10.30.05.55.39; Mon, 30 Oct 2017 05:55:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751608AbdJ3My6 (ORCPT + 99 others); Mon, 30 Oct 2017 08:54:58 -0400 Received: from mx02-sz.bfs.de ([194.94.69.103]:27897 "EHLO mx02-sz.bfs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751167AbdJ3My5 (ORCPT ); Mon, 30 Oct 2017 08:54:57 -0400 Received: from localhost (localhost [127.0.0.1]) by mx02-sz.bfs.de (Postfix) with ESMTP id A8AA9481; Mon, 30 Oct 2017 13:54:55 +0100 (CET) X-Virus-Scanned: amavisd-new at bfs.de Received: from mx02-sz.bfs.de ([127.0.0.1]) by localhost (mx02-sz.bfs.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PstuROpQrTzf; Mon, 30 Oct 2017 13:54:54 +0100 (CET) Received: from mail-fr.bfs.de (mail-fr.bfs.de [10.177.18.200]) by mx02-sz.bfs.de (Postfix) with ESMTPS; Mon, 30 Oct 2017 13:54:54 +0100 (CET) Received: from [134.92.181.33] (unknown [134.92.181.33]) by mail-fr.bfs.de (Postfix) with ESMTPS id 149C2BEE6D; Mon, 30 Oct 2017 13:54:54 +0100 (CET) Message-ID: <59F7211D.8080500@bfs.de> Date: Mon, 30 Oct 2017 13:54:53 +0100 From: walter harms Reply-To: wharms@bfs.de User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.1.16) Gecko/20101125 SUSE/3.0.11 Thunderbird/3.0.11 MIME-Version: 1.0 To: "Michael Kerrisk (man-pages)" CC: Stas Sergeev , linux-man , Andy Lutomirski , Oleg Nesterov , lkml Subject: Re: Documenting sigaltstack SS_AUTODISRM References: <08467ae1-7187-3b2a-9a78-8af0c10bf816@list.ru> <3907bc2a-0645-8d93-6ee5-3f99874e7022@gmail.com> <32d95303-5839-9279-a1d3-a06f34e3484e@list.ru> <50de8f3b-8a1e-df50-b5dd-d1b74cb77fad@list.ru> <026308b5-4e92-4439-1eb2-82b67584d548@gmail.com> <3a4f9f3e-fc33-cf98-2322-27087664813f@list.ru> <59F6FD39.40502@bfs.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 30.10.2017 11:50, schrieb Michael Kerrisk (man-pages): > Hi Walter, > > On 10/30/2017 11:21 AM, walter harms wrote: >> >> >> Am 30.10.2017 11:04, schrieb Michael Kerrisk (man-pages): >>> [So, things fell on the floor, a while back.] >>> >>> On 05/25/2017 11:17 AM, Stas Sergeev wrote: >>>> 24.05.2017 14:09, Michael Kerrisk (man-pages) пишет: >>>>> One could do this I suppose, but I read POSIX differently from >>>>> you and, more importantly, SS_ONSTACK breaks portability on >>>>> numerous other systems and is a no-op on Linux. So, the Linux man >>>>> page really should warn against its use in the strongest terms. >>>> So how about instead of the strongest terms towards >>>> the code's author, just explain that SS_ONSTACK is a >>>> bit-value on some/many OSes, and as such, 0 is a >>>> valid value to enable sas on them, plus all the other >>>> values would give EINVAL? >>>> No strongest terms will help w/o an explanation, >>>> because people will keep looking for something that >>>> suits as a missing SS_ENABLE. >>> >>> Fair enough. I've removed the statement in the manual page >>> about "confusion". By now the page says: >>> >>> BUGS >>> In the lead up to the release of the Linux 2.4 kernel, a change >>> was made to allow sigaltstack() to accept SS_ONSTACK in >>> ss.ss_flags, which results in behavior that is the same as when >>> ss_flags is 0 (i.e., the inclusion of SS_ONSTACK in ss.ss_flags is >>> a no-op). On other implementations, and according to POSIX.1, >> >> i am confused, i understand that: >> ss.ss_sp = malloc(SIGSTKSZ); >> >> ss.ss_size = SIGSTKSZ; >> ss.ss_flags = 0; >> if (sigaltstack(&ss, NULL) == -1) >> >> is equivalent to: >> ss.ss_sp = malloc(SIGSTKSZ); >> >> ss.ss_size = SIGSTKSZ; >> ss.ss_flags = SS_ONSTACK ; >> if (sigaltstack(&ss, NULL) == -1) >> >> but also to >> ss.ss_sp = malloc(SIGSTKSZ); >> >> ss.ss_size = SIGSTKSZ; >> ss.ss_flags = SS_ONSTACK | SOMETHING_FLAG ; >> if (sigaltstack(&ss, NULL) == -1) >> >> so the use of SS_ONSTACK would result in ss.ss_flags = 0 no matter what. >> OR >> SS_ONSTACK is a no-op in Linux > > I see what you mean. The point is back then that SS_ONSTACK was > the only flag that could (on Linux) be specified in ss.ss_flags, > so that "SS_ONSTACK | SOMETHING_FLAG" was a nonexistent case. > These days, it's possible to specify the new SS_AUTODISARM > flag in ss.ss_flags, which I think is why you are doubtful > about the new page text. How about this, as a tightened-up > version: > > BUGS > In Linux 2.2 and earlier, the only flag that could be specified in > ss.sa_flags was SS_DISABLE. In the lead up to the release of the > Linux 2.4 kernel, a change was made to allow sigaltstack() to > allow ss.ss_flags==SS_ONSTACK with the same meaning as > ss.ss_flags==0 (i.e., the inclusion of SS_ONSTACK in ss.ss_flags > is a no-op). On other implementations, and according to POSIX.1, > SS_ONSTACK appears only as a reported flag in old_ss.ss_flags. On > Linux, there is no need ever to specify SS_ONSTACK in ss.ss_flags, > and indeed doing so should be avoided on portability grounds: var‐ > ious other systems give an error if SS_ONSTACK is specified in > ss.ss_flags. > > ? what about the other way around (general to special) .... the inclusion of SS_ONSTACK in ss.ss_flags is a no-op (setting ss.ss_flags=SS_ONSTACK will result in ss.ss_flags=0). The details about older release will be helpful for upgrading pruposes. So we can say: Since Linux 2.4 the inclusion .... does this help ? re, wh > > Thanks, > > Michael > From 1582686252420888936@xxx Mon Oct 30 12:40:29 +0000 2017 X-GM-THRID: 1582678540934340950 X-Gmail-Labels: Inbox,Category Forums