Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1517132ybz; Thu, 30 Apr 2020 00:21:41 -0700 (PDT) X-Google-Smtp-Source: APiQypJz/iaydUj52lruUJm8DrArOvOfMPDptByzw6PSCQd9xqqykIM04yEipht8NVDjFHTZneGH X-Received: by 2002:a17:906:2b89:: with SMTP id m9mr1377391ejg.302.1588231301342; Thu, 30 Apr 2020 00:21:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588231301; cv=none; d=google.com; s=arc-20160816; b=nE8gtmohGq4ABEZLrAN300JEvVAarngwITJHh/wEuB5ywgTYsXlMA8vjUMxSBJnBMk CtB+tX6DWA0zQ1wM6LONPLwK5FI/Dy3VgQ/LoCNv2Tp3u82eJdRmb3u9wvRdE4lL0F1A voBsb7dtoBajuSQw/65s9t2SEWwwB3hX7hPkS4aFvT2jaj8yBOaVQX8nzZV74jT6JCi0 aypc+dd7CWGIyFk+TLXXAmw4wDgoxMj6uRipKW2zfTlLndyq99jyXTcRPuBE+DToAKxy BdGjXpTrhJyCKtdbRuG1279+d5z8FoM51iOgYMnA4flwt5B+KXrnBArTJF5AdWF7hVYB JQhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:cc:to:from :dkim-signature; bh=Yx55Thu7Gf0r0u/XFEjGbPEa2L3yF6iBFpJzZun4g9A=; b=GcC0uecf3x/8BzIjG5jlrNOedwHTBsMiyKSUsRiZCmvJi5zeWMTdaSCWM/QC9qFvus t468Ya/Met+F7otKVmh0AsX3IJEf+5wnxVCFjNC9dLXGUSBC/saxlrqUjbcx7t1q3bkH dfee6vh+A0cYlIpS+3E7s4f4IIQ9T777qLS69+fuQZ0OruoS1p+eneFJXF3ow+8vIEQ/ UhhG2u1fhViglo+QHvUH1xqHeyDf/sWle6q1WLB3W1PFN7gs4Jzyd3AakBSbgN/WwUXO Mtsi3QW3U19XUQ6GKiYXQlyDVcDeIPWSVIhrKE8M8V7ChTiTKxiW2lsfjK9bhjKNnbQy PDoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@cs.msu.ru header.s=dkim header.b=tYImIuIy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=cs.msu.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z16si5246189ejr.249.2020.04.30.00.21.17; Thu, 30 Apr 2020 00:21:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@cs.msu.ru header.s=dkim header.b=tYImIuIy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=cs.msu.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726968AbgD3HRR (ORCPT + 99 others); Thu, 30 Apr 2020 03:17:17 -0400 Received: from mail.cs.msu.ru ([188.44.42.39]:50590 "EHLO mail.cs.msu.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726924AbgD3HRP (ORCPT ); Thu, 30 Apr 2020 03:17:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cs.msu.ru; s=dkim; h=Subject:Content-Transfer-Encoding:Content-Type:MIME-Version: References:In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Yx55Thu7Gf0r0u/XFEjGbPEa2L3yF6iBFpJzZun4g9A=; b=tYImIuIyPJagcc6FPVaOYZLQPi 9kAFEOVgxEnOigCDvy0mExWX2v805sfZGc3kJK6SoxL/pCzdzOCAWkvnDv3KIPDHfo/lhJ6FhxaET DrHyMSPlI4YTxZ8axbx0GIo+OfL6Gvh73ZhFBXVyQe3VQTLG8omAv8GZlQJuu6kV5fHYgGcNUoYGT 4/ZsebLY3y2pzbgYa6zzQhtuLClMntI4B0vcOeXBWFsIy8uiaB60HLTpviorkpr2Z/GvBWc1soULz gBp4z5DQh6jUGBETpVMYRmlin6sKajWSVq7B5AI4a8tDLUDTnA9OzvMX43561gzaHV5c/rQlLvSsT nensbArw==; Received: from [37.204.119.143] (port=42272 helo=localhost.localdomain) by mail.cs.msu.ru with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93.0.4 (FreeBSD)) (envelope-from ) id 1jU2uv-000B4I-Do; Thu, 30 Apr 2020 09:43:29 +0300 From: Arseny Maslennikov To: Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Arseny Maslennikov , Rob Landley , "Eric W. Biederman" , Pavel Machek , linux-api@vger.kernel.org, "Vladimir D. Seleznev" Date: Thu, 30 Apr 2020 09:42:58 +0300 Message-Id: <20200430064301.1099452-5-ar@cs.msu.ru> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200430064301.1099452-1-ar@cs.msu.ru> References: <20200430064301.1099452-1-ar@cs.msu.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 37.204.119.143 X-SA-Exim-Mail-From: ar@cs.msu.ru X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mail.cs.msu.ru X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_ALL autolearn=no autolearn_force=no version=3.4.4 Subject: [PATCH v3 4/7] linux/signal.h: Ignore SIGINFO by default in new tasks X-SA-Exim-Version: 4.2.1 X-SA-Exim-Scanned: Yes (on mail.cs.msu.ru) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. To put it another way: The only scenario where system behaviour actually changes is when the signal recipient has default disposition for SIGPWR. If a process chose to interpret a SIGPWR as an incentive to cleanly terminate, it would supply its own handler — and this commit does not affect processes with non-default handlers. Signed-off-by: Arseny Maslennikov --- include/linux/signal.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/linux/signal.h b/include/linux/signal.h index 05bacd2ab..dc31da8fc 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h @@ -369,7 +369,7 @@ extern bool unhandled_signal(struct task_struct *tsk, int sig); * | SIGSYS/SIGUNUSED | coredump | * | SIGSTKFLT | terminate | * | SIGWINCH | ignore | - * | SIGPWR | terminate | + * | SIGPWR | ignore | * | SIGRTMIN-SIGRTMAX | terminate | * +--------------------+------------------+ * | non-POSIX signal | default action | @@ -420,7 +420,8 @@ extern bool unhandled_signal(struct task_struct *tsk, int sig); #define SIG_KERNEL_IGNORE_MASK (\ rt_sigmask(SIGCONT) | rt_sigmask(SIGCHLD) | \ - rt_sigmask(SIGWINCH) | rt_sigmask(SIGURG) ) + rt_sigmask(SIGWINCH) | rt_sigmask(SIGURG) | \ + rt_sigmask(SIGINFO) ) #define SIG_SPECIFIC_SICODES_MASK (\ rt_sigmask(SIGILL) | rt_sigmask(SIGFPE) | \ -- 2.26.2