From nobody Thu Nov 09 17:28:12 2023 X-Original-To: current@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 4SR87C48njz50d5R for ; Thu, 9 Nov 2023 17:28:23 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from www121.sakura.ne.jp (www121.sakura.ne.jp [153.125.133.21]) (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 4SR87B6WsNz4TFJ; Thu, 9 Nov 2023 17:28:22 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Authentication-Results: mx1.freebsd.org; none Received: from kalamity.joker.local (123-1-22-158.area1b.commufa.jp [123.1.22.158]) (authenticated bits=0) by www121.sakura.ne.jp (8.16.1/8.16.1/[SAKURA-WEB]/20201212) with ESMTPA id 3A9HSCDe064193; Fri, 10 Nov 2023 02:28:13 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) Date: Fri, 10 Nov 2023 02:28:12 +0900 From: Tomoaki AOKI To: Zhenlei Huang Cc: FreeBSD Current , Konstantin Belousov , Doug Rabson Subject: Re: kldunload kernel: How should the kernel behave when it is requested to unload itself Message-Id: <20231110022812.ad04ffa521262e377fcb99ea@dec.sakura.ne.jp> In-Reply-To: <07168C68-9F81-443C-AFB6-24958BB01F9E@FreeBSD.org> References: <07168C68-9F81-443C-AFB6-24958BB01F9E@FreeBSD.org> Organization: Junchoon corps X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:7684, ipnet:153.125.128.0/18, country:JP] X-Rspamd-Queue-Id: 4SR87B6WsNz4TFJ On Fri, 10 Nov 2023 00:10:13 +0800 Zhenlei Huang wrote: > Hi, > > This is *NOT* joking. > > While working on https://reviews.freebsd.org/D42527 I realized the > module kernel also has userrefs, that is to say, userland can request > to unload kernel, aka `kldunload kernel`. > > This is interesting. Well no doubt that the loader can unload kernel. > Then after the kernel is loaded and has been initialized (SYSINIT), how > should it behave when it get an unload request? > > I'm proposing https://reviews.freebsd.org/D42530 to do not allow unloading > the kernel. It is by intuition. > > What do you think ? > > > Best regards, > Zhenlei Possibly too paranoid, but the summery on D42530 looks a bit confusing. Would better to be 'The userland or kernel shall not unload the module "kernel".' or 'The userland or kernel shall not unload the "kernel" module.' . The original SUMMARY could be read as, in meaning, 'The userland or kernel shall not unload *.ko.' *.ko is sometimes called as "kernel module", although it stants for "kernel object". -- Tomoaki AOKI