From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753270AbcBASwc (ORCPT ); Mon, 1 Feb 2016 13:52:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36328 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752415AbcBASwa (ORCPT ); Mon, 1 Feb 2016 13:52:30 -0500 Date: Mon, 1 Feb 2016 19:52:23 +0100 From: Oleg Nesterov To: Stas Sergeev Cc: Linux kernel , linux-api@vger.kernel.org, Andy Lutomirski , Ingo Molnar , Peter Zijlstra , Andrew Morton , "Amanieu d'Antras" , Richard Weinberger , Tejun Heo , "Kirill A. Shutemov" , Jason Low , Heinrich Schuchardt , Andrea Arcangeli , Konstantin Khlebnikov , Josh Triplett , "Eric W. Biederman" , Aleksa Sarai , Paul Moore , Palmer Dabbelt , Vladimir Davydov Subject: Re: [PATCH 4/4] sigaltstack: allow disabling and re-enabling sas within sighandler Message-ID: <20160201185223.GA21136@redhat.com> References: <56AE3369.2090709@list.ru> <56AE3626.7080706@list.ru> <20160201160625.GA18276@redhat.com> <20160201170958.GA20735@redhat.com> <56AF955D.7060601@list.ru> <20160201180443.GA21064@redhat.com> <56AFA0E2.1030302@list.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56AFA0E2.1030302@list.ru> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Stas, I probably missed something, but I don't understand your concerns, On 02/01, Stas Sergeev wrote: > > 01.02.2016 21:04, Oleg Nesterov пишет: > > Yes, and SS_FORCE means "I know what I do", looks very simple. > But to me its not because I don't know what to do with > uc_stack after SS_FORCE is applied. Nothing? restore_sigaltstack() should work as expected? > >I won't argue, but to me it would be better to keep this EPERM if !force. > >Just because we should avoid the incompatible changes if possible. > Ok then. Lets implement SS_FORCE. > What semantic should it have wrt uc_stack? > > sigaltstack(SS_DISABLE | SS_FORCE); > swapcontext(); > sigaltstack(set up new_sas); > rt_sigreturn(); Yes, or sigaltstack({ DISABLE | FORCE}, &old_ss); swapcontext(); sigaltstack(&old_ss, NULL); rt_sigreturn(); and if you are going to return from sighandler you do not even need the 2nd sigaltstack(), you can rely on sigreturn. > What's at the end? Do we want a surprise for the user > that he's new_sas got ignored? Can't understand.... do you mean "set up new_sas" will be ignored because rt_sigreturn() does restore_sigaltstack() ? I see no problem here... Oleg.