From nobody Fri Nov 10 09:07:03 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 4SRXyV2V5Vz5121L for ; Fri, 10 Nov 2023 09:07:14 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SRXyV1zv9z4qlx; Fri, 10 Nov 2023 09:07:14 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699607234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Sfebl9ME+abbvY2AgqUi13llZ3hEWQB6W7GjrK0Jwqg=; b=EApVhuBPvc0DaucPE/6A2Fpp7LfAlqLcXFb6BIkYrRfcWZ9qqG0WjYOh2QtgqQkXo1yYVo nhh+GORRJz5tuO602YGJG5MK3K9JgcUdYQOy7HN+QRuOzzRTYSLQD7JJktihuI42pKIb/s 56lWG5P7w+Akqn55pXoyOFT/7aZIpWlLZIHRq5Qyi9MnkxTHGPKfciRxaNRIJn+B2ezGP2 oABG979AGJbRJnno5jaMN970rANd/t28Mq534MYRzup+4RMfxmTcqUVBwqlTCj1ewgw6Qf fPM8vUNG/h16grPUlpjt507QgM36abBVTSQnRH4r5c6Md8Tf1DoETaqyQiOT9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699607234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Sfebl9ME+abbvY2AgqUi13llZ3hEWQB6W7GjrK0Jwqg=; b=K8zNefXQb9Aic70nDBbkgDyKGxi/GRBZb6AblX3qIQ5AkzXMaCKIz/ytXhH2yzuflP9IsE Ay4G1P+kVjG4ipRaQAo/8NQD/+dcCuQAXQg9en29HOEKxrXs8qCmss8Wqxk4sxEsfsA46Z lLCOw3vnTbjsD687zl+SDJ7FJBUdpqJGCsDZ5KFpaKodCEXfp84FCrw8mkfH2LEAE8lxzW x5kH+wZyS3TJtwtKzhnERCR03lR+nSI+WHx2SAG44aUAeo35zRfHy2vIpHCKM66xkixp84 M0Le55OwpUB3dTnB1nQYWbW8XDfiQ6CdDLEZdO0ph9jLOxLFk+oe7aBzzZPkZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1699607234; a=rsa-sha256; cv=none; b=yMiHDqL894ZzouT7/myDAQCd8PwZWDdh020mQ8F716agzxzfRXyHxgtAnGE+1jj1u4NzSK nIPU2Unx4eOklxXqETdpI49HJt66wsI4ovw8yN/o3yFGv++tK0N3aGSaZldOX5LrNF/evi 5Ii3xxKxpCxRyfT5aPelJ+dsd6d+h8k+mAsz1hp1KfrH4FrDJVgR3wVEAYthH5Rjm9l5zu XTfJSiBVUxNpyAwYpxN+RrcE0V/TLJ3he9CeqxOIc6VB/LJfIHthjZMQUIlLjEUsKBolCB jODId1kOA35OJgMbpgtxm886ss0DHqZJ3yMPL/CeWp5iusLfpSF2f44RwULboQ== Received: from smtpclient.apple (ns1.oxydns.net [45.32.91.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: zlei/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4SRXyR5Fvkz12h2; Fri, 10 Nov 2023 09:07:11 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Content-Type: text/plain; charset=us-ascii 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 (Mac OS X Mail 16.0 \(3696.120.41.1.4\)) Subject: Re: kldunload kernel: How should the kernel behave when it is requested to unload itself From: Zhenlei Huang In-Reply-To: <20231110022812.ad04ffa521262e377fcb99ea@dec.sakura.ne.jp> Date: Fri, 10 Nov 2023 17:07:03 +0800 Cc: FreeBSD Current , Konstantin Belousov , Doug Rabson Content-Transfer-Encoding: quoted-printable Message-Id: <118579DF-2A14-4305-8DF1-24F4FE2EC8B6@FreeBSD.org> References: <07168C68-9F81-443C-AFB6-24958BB01F9E@FreeBSD.org> <20231110022812.ad04ffa521262e377fcb99ea@dec.sakura.ne.jp> To: Tomoaki AOKI X-Mailer: Apple Mail (2.3696.120.41.1.4) > On Nov 10, 2023, at 1:28 AM, Tomoaki AOKI = wrote: >=20 > On Fri, 10 Nov 2023 00:10:13 +0800 > Zhenlei Huang wrote: >=20 >> Hi, >>=20 >> This is *NOT* joking. >>=20 >> 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`. >>=20 >> 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? >>=20 >> I'm proposing https://reviews.freebsd.org/D42530 to do not allow = unloading >> the kernel. It is by intuition. >>=20 >> What do you think ? >>=20 >>=20 >> Best regards, >> Zhenlei >=20 > Possibly too paranoid, but the summery on D42530 looks a bit = confusing. > Would better to be >=20 > 'The userland or kernel shall not unload the module "kernel".' >=20 > or >=20 > 'The userland or kernel shall not unload the "kernel" module.' >=20 > . >=20 > The original SUMMARY could be read as, in meaning, 'The userland or > kernel shall not unload *.ko.' >=20 > *.ko is sometimes called as "kernel module", although it stants for > "kernel object". Thanks for point that out. I'll polish before committing it. >=20 > --=20 > Tomoaki AOKI