From nobody Tue Jan 6 09:42:17 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dlmRW1CqMz6NPtQ; Tue, 06 Jan 2026 09:42:31 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4dlmRV3YgPz421G; Tue, 06 Jan 2026 09:42:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 6069gHl1096084; Tue, 6 Jan 2026 11:42:20 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 6069gHl1096084 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 6069gHbs096083; Tue, 6 Jan 2026 11:42:17 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 6 Jan 2026 11:42:17 +0200 From: Konstantin Belousov To: Enji Cooper Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Anagh Verma Subject: Re: git: f384784289db - main - kern_syscall_deregister: document syscall 0 no-op logic Message-ID: References: <695cbe7e.3daf1.20a5a762@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <695cbe7e.3daf1.20a5a762@gitrepo.freebsd.org> 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=4.0.2 X-Spam-Checker-Version: SpamAssassin 4.0.2 (2025-08-27) on tom.home X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_RCPT(0.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4dlmRV3YgPz421G On Tue, Jan 06, 2026 at 07:49:18AM +0000, Enji Cooper wrote: > The branch main has been updated by ngie: > > URL: https://cgit.FreeBSD.org/src/commit/?id=f384784289dba13b90138a89d3df3a8ea063aff9 > > commit f384784289dba13b90138a89d3df3a8ea063aff9 > Author: Anagh Verma > AuthorDate: 2026-01-06 07:42:56 +0000 > Commit: Enji Cooper > CommitDate: 2026-01-06 07:48:54 +0000 > > kern_syscall_deregister: document syscall 0 no-op logic > > Document syscall #0 being handled specially in > `kern_syscall_deregister(..)`: it's a reserved syscall and not > dynamically registered, and hence does not need to be deregistered in > the function. > > Co-authored-by: ngie@ > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D54326 > --- > sys/kern/kern_syscalls.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/sys/kern/kern_syscalls.c b/sys/kern/kern_syscalls.c > index a93d711e7597..7ddc28ed4e26 100644 > --- a/sys/kern/kern_syscalls.c > +++ b/sys/kern/kern_syscalls.c > @@ -161,8 +161,14 @@ kern_syscall_deregister(struct sysent *sysents, int offset, > { > struct sysent *se; > > - if (offset == 0) > - return (0); /* XXX? */ > + if (offset == 0) { > + /* > + * Syscall #0 is reserved and is not dynamically registered. Syscall number zero is not reserved, it is the mux syscall. It is indeed not dynamic, it is marked with the SY_THR_STATIC flag. > + * Treat deregistration as a no-op to simplify module unload > + * paths. > + */ > + return (0); > + } > > se = &sysents[offset]; > if ((se->sy_thrcnt & SY_THR_STATIC) != 0) This check for SY_THR_STATIC would catch it. That said, what is the use of silencing the error from an erronous attempt to deregister syscall handler not owned by caller?