Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp4121050ybd; Tue, 25 Jun 2019 14:35:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqyVBQ8v3I4t4tYEmAvGhM+5r61bAdkNrgKNnlf73zGtMEtRDrwZ6Ru+H0sbihVRAZHRA5Ok X-Received: by 2002:a17:902:16f:: with SMTP id 102mr914448plb.94.1561498556384; Tue, 25 Jun 2019 14:35:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561498556; cv=none; d=google.com; s=arc-20160816; b=Rg4oYnyc4SkONf6EouDIxDN1kTuJPgYQsGI33hYoAQ26Tn8Cs12tTT2fECxRXxDsO/ eeuBp1KFgF7GQCHAEAJN505BZiZsXZfHUe5hug9UVx8OSFMfDTnl0A3CE1eV9/E37Z46 3QibEtkTsO05BZMHiewYuuU5sN2chAFUm6fY1QtLFzW6jqHEuizZEsCK6+HAEhK4B5SL sMH/Y3IP8ofN4fHRIu+6APFzpARyfLTJP96iLzanKUPPQDox4T7NLY4l2olcGg1ufXBX NfwbG42oXrORV9yYBQXNr7WQ+qQChhyz0x87GzO9o26uUt1TfnN+JD44uSHInfdriVPr MaQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date; bh=e8cAtvM4WCUfMiGcVEJG6TSBW2T1yILr20tZ7LNWAu8=; b=R3uebK48qvCArBcPrZysFhPUOJTVDodwb9OjvZe6KRIeIxQwmNURmUXfYuKYe1uD/W BIhd9b7gfdERjeo9nJxIGhrFJbtE8jYtYyt7sRa2a4zJ5uiNaLKVZcYiRo7JSVTQBApq zvUsetm65QM7AS1oRhotqpAIgX2YTJqhsWBUL47/D4iatdpCUIIok3TEmvwhT46WYW3w y7bI7YtCY7ZyOQLVwdVSLUsMsl3k/4KaachBcXFGnnPNVMi7IzJaPFMPVvdggf5Fqa8V 0F9eLCZOTXzKwYBmG4cu4/Ilp5oCI3ypYPKpKWg3cAaGyZKGBnEXgm5Ru09XXmUttnMU +eQw== 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 a88si28447pje.6.2019.06.25.14.35.39; Tue, 25 Jun 2019 14:35:56 -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 S1726413AbfFYVdu (ORCPT + 99 others); Tue, 25 Jun 2019 17:33:50 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:54416 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726331AbfFYVdt (ORCPT ); Tue, 25 Jun 2019 17:33:49 -0400 Received: from callcc.thunk.org (guestnat-104-133-0-109.corp.google.com [104.133.0.109] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id x5PLWF3v023800 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jun 2019 17:32:16 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id 59DBA42002B; Tue, 25 Jun 2019 17:32:15 -0400 (EDT) Date: Tue, 25 Jun 2019 17:32:15 -0400 From: "Theodore Ts'o" To: Arseny Maslennikov Cc: Greg Kroah-Hartman , Jiri Slaby , Ingo Molnar , Peter Zijlstra , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Vladimir D. Seleznev" , Rob Landley , "Eric W. Biederman" , Pavel Machek Subject: Re: [PATCH v2 4/7] linux/signal.h: Ignore SIGINFO by default in new tasks Message-ID: <20190625213215.GB3116@mit.edu> Mail-Followup-To: Theodore Ts'o , Arseny Maslennikov , Greg Kroah-Hartman , Jiri Slaby , Ingo Molnar , Peter Zijlstra , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Vladimir D. Seleznev" , Rob Landley , "Eric W. Biederman" , Pavel Machek References: <20190625161153.29811-1-ar@cs.msu.ru> <20190625161153.29811-5-ar@cs.msu.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190625161153.29811-5-ar@cs.msu.ru> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 25, 2019 at 07:11:50PM +0300, Arseny Maslennikov wrote: > This matches the behaviour of other Unix-like systems that have SIGINFO > and causes less harm to processes that do not install handlers for this > signal, making the keyboard status character non-fatal for them. > > This is implemented with the assumption that SIGINFO is defined > to be equivalent to SIGPWR; still, there is no reason for PWR to > result in termination of the signal recipient anyway — it does not > indicate there is a fatal problem with the recipient's execution > context (like e.g. FPE/ILL do), and we have TERM/KILL for explicit > termination requests. So this is a consequence of trying to overload SIGINFO with SIGPWR. At least on some legacy Unix systems, the way SIGPWR worked was that init would broadcast SIGPWR to all userspace process (with system daemons on an exception list so they could get shutdown last). Applications which didn't have a SIGPWR handler registered, would just exit. Those that did, were expected to clean up in preparation with the impending shutdown. After some period of time, then processes would get hard killed and then system daemons would get shut down and the system would cleanly shut itself down. So SIGPWR acted much like SIGHUP, and that's why the default behavior was "terminate". Now, as far as I know, we've not actually used in that way, at least for most common distributions, but there is a sane reason why things are they way there are, and in there are people who have been using SIGPWR the way it had originally been intended, there is risk in overloading SIGINFO with SIGPWR --- in particular, typing ^T might cause some enterprise database to start shutting itself down. :-) (In particular it might be worth checking Linux ports of Oracle and DB2.) - Ted