From owner-svn-src-projects@freebsd.org Tue Sep 3 14:07:23 2019 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67806DD9F5 for ; Tue, 3 Sep 2019 14:07:23 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N80V6YFQz4QXk; Tue, 3 Sep 2019 14:07:22 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 57BDA1B52B; Tue, 3 Sep 2019 14:06:37 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id C65DF12AAA; Mon, 22 Apr 2019 17:10:45 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 384426D621; Mon, 22 Apr 2019 17:10:45 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 1610612A6A; Mon, 22 Apr 2019 17:10:45 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id DEDA212A67; Mon, 22 Apr 2019 17:10:41 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A76406D60E; Mon, 22 Apr 2019 17:10:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x3MHAX5N018069 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 22 Apr 2019 20:10:36 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x3MHAX5N018069 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x3MHAX1U018068; Mon, 22 Apr 2019 20:10:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f From: Konstantin Belousov To: Alan Somers Cc: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: Re: svn commit: r346507 - in projects/fuse2/sys: kern sys Message-ID: <20190422171033.GX12936@kib.kiev.ua> References: <201904212304.x3LN46Pt046728@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201904212304.x3LN46Pt046728@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: 384426D621 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:07:23 -0000 X-Original-Date: Mon, 22 Apr 2019 20:10:33 +0300 X-List-Received-Date: Tue, 03 Sep 2019 14:07:23 -0000 On Sun, Apr 21, 2019 at 11:04:06PM +0000, Alan Somers wrote: > Author: asomers > Date: Sun Apr 21 23:04:06 2019 > New Revision: 346507 > URL: https://svnweb.freebsd.org/changeset/base/346507 > > Log: > fusefs: commit missing files from r346387 > > PR: 346357 > Sponsored by: The FreeBSD Foundation > > Modified: > projects/fuse2/sys/kern/kern_sig.c > projects/fuse2/sys/sys/signalvar.h > > Modified: projects/fuse2/sys/kern/kern_sig.c > ============================================================================== > --- projects/fuse2/sys/kern/kern_sig.c Sun Apr 21 22:53:51 2019 (r346506) > +++ projects/fuse2/sys/kern/kern_sig.c Sun Apr 21 23:04:06 2019 (r346507) > @@ -929,6 +929,23 @@ osigreturn(struct thread *td, struct osigreturn_args * > #endif > #endif /* COMPAT_43 */ > > +/* Will this signal be fatal to the current process ? */ > +bool > +sig_isfatal(struct proc *p, int sig) > +{ > + intptr_t act; > + > + act = (intptr_t)p->p_sigacts->ps_sigact[_SIG_IDX(sig)]; > + if ((intptr_t)SIG_DFL == act) { > + int prop; This is against style. > + > + prop = sigprop(sig); > + return (0 != (prop & (SIGPROP_KILL | SIGPROP_CORE))); > + } else { > + return (false); > + } > +} Either your function lacks asserts about the owned locks, or it is racy. Said that, is the comment above describes the intent ? The implementation is too naive. Just for example, blocked signals with default disposition do not result in the termination. On the other hand, blocked ignored traps cause immediate termination. Overall, I do not believe that it is possible to implement that without duplicating the code of tdsendsignal() and trapsignal(), i.e. you should additionally provide the originating context, besides a signal number. What you are trying to do there ? > + > /* > * Initialize signal state for process 0; > * set to ignore signals that are ignored by default. > > Modified: projects/fuse2/sys/sys/signalvar.h > ============================================================================== > --- projects/fuse2/sys/sys/signalvar.h Sun Apr 21 22:53:51 2019 (r346506) > +++ projects/fuse2/sys/sys/signalvar.h Sun Apr 21 23:04:06 2019 (r346507) > @@ -384,6 +384,7 @@ int sigacts_shared(struct sigacts *ps); > void sigexit(struct thread *td, int sig) __dead2; > int sigev_findtd(struct proc *p, struct sigevent *sigev, struct thread **); > int sig_ffs(sigset_t *set); > +bool sig_isfatal(struct proc *p, int sig); > void siginit(struct proc *p); > void signotify(struct thread *td); > void sigqueue_delete(struct sigqueue *queue, int sig);