梅毒螺旋体抗体是什么意思| 头发为什么会白| 肾上腺挂什么科| 2017是什么年| 肚子左边是什么器官| 昵称什么意思| 头发一把一把的掉是什么原因| 氨基酸态氮是什么| 女人大腿内侧黑是什么原因引起的| 血红蛋白低吃什么| 肺部不好有什么症状| 6月12号是什么星座| 是什么原因导致肥胖| 乙肝对身体有什么影响| st什么意思| jps是什么意思| 催供香是什么意思| 水黄是什么原因| 怕冷的人是什么原因| 安装空调需要注意什么| Iud是什么| 中秋吃什么| 3月2号什么星座| 姨妈的老公叫什么| 宝宝风热感冒吃什么药| 蚊子最怕什么气味| 灰溜溜是什么意思| 口腔溃疡用什么药好| 升白针是什么药| 头抖是什么原因| 局限性是什么意思| 尿电导率低是什么意思| 为什么会反复发烧| 胎毛什么时候剃最好| 平诊是什么意思| 敏五行属什么| 执子之手与子偕老是什么意思| 吃什么补筋和韧带最快| 肚子胀气放屁吃什么药| 36岁生日有什么讲究| 人艰不拆是什么意思| 剖腹产后可以吃什么水果| 一什么缸| 四月十六日是什么星座| 心灵手巧什么意思| 龙王庙是指什么生肖| 桑葚酒有什么功效| 外伤用什么药愈合最快| 苏联什么时候解体| 小气是什么意思| 儿童登机需要什么证件| 这是什么猫| 喝山楂水有什么功效与作用| 前额头疼是什么原因引起的| 什么汤养胃| 拍拖是什么意思| 智商130算什么水平| 脉濡是什么意思| 手足口用什么药| cc是什么意思| 拉开帷幕是什么意思| 无名指戴戒指代表什么| 熠五行属什么| 勾股定理是什么意思| 脸一边大一边小是什么原因| 心绞痛吃什么药缓解最快| 梦见情敌什么预兆| 立夏是什么意思| 健硕是什么意思| 螳螂捕蝉黄雀在后是什么生肖| 风疹病毒抗体阳性是什么意思| score什么意思| 深度睡眠是什么状态| 新疆有什么民族| 蔷薇色是什么颜色| 子宫肌瘤是什么病| 拉大便出血是什么原因| 最小的动物是什么| 疮疡是什么病| 什么是码率| 尿急是什么症状| 肺气不足吃什么食物可以补肺气| 吃凉的胃疼吃什么药| 胃疼吃什么药最管用| 眼睛干涩用什么药水| 人流前需要检查什么项目| 豆蔻年华什么意思| 仙人跳是什么意思啊| 氯丙嗪是什么药| 孤寡老人是什么意思| 生地黄是什么| 形婚是什么意思啊| 信徒是什么意思| 马代表什么数字| 新生儿拉肚子是什么原因引起的| 空调睡眠模式什么意思| 身陷囹圄是什么意思| 眼仁发黄是什么原因| 胰腺检查挂什么科| 虚热吃什么药| 什么是根管治疗| 爬虫是什么| 风寒感冒吃什么中成药| 月经突然提前一周是什么原因| 维生素什么时候吃效果最好| 鸡吃什么食物| 派出所什么时候上班| 四月十五日是什么日子| 子宫内膜炎是什么原因造成的| 硫酸钠是什么| 射进去有什么感觉| 酸菜鱼可以放什么配菜| 小腹胀痛什么原因女性| 爸爸的外婆叫什么| 水痘疫苗叫什么| 驴打滚是什么意思| 头疼是什么原因导致的| 剖腹产坐月子吃什么| 什么中不足成语| 为什么要拔智齿| 胆囊切除后有什么影响| 一头雾水什么意思| 什么是润年| 申时是什么生肖| 为什么刚小便完又有尿意| 酗酒是什么意思| 程度是什么意思| 龟头太敏感吃什么药| 男生肚子疼是什么原因| 脚麻是什么病的前兆| 系鞋带什么意思| 早上七八点是什么时辰| 欢是什么动物| hisense是什么牌子| 脑软化灶是什么意思| 经期适合喝什么汤| 621什么星座| 去侍庙有什么禁忌| 西洋参有什么用| 什么情况下需要做胃镜| 骨骼清奇什么意思| 9.23什么星座| nbcs是什么意思| 朋友圈屏蔽显示什么| 喜五行属什么| 什么叫市级以上医院| 经期肚子疼是什么原因| 心脏骤停是什么原因引起的| 梦见别人开车翻车是什么预兆| dw什么意思| 大便呈绿色是什么原因| 七月十四是什么节| 残疾证有什么好处| 为什么大拇指只有两节| 电波是什么意思| 毕业答辩是什么| 德高望重是什么生肖| 紫癜吃什么好得快| 脚发麻是什么原因| 稷字五行属什么| 顶胯是什么意思| 九五年属什么生肖| 康波是什么意思| 给小孩办身份证需要什么| 有什么赚钱的软件| 阴道长什么样| 苹果醋什么时候喝最好| 户口本可以干什么坏事| 开山鼻祖是什么意思| 精分是什么| 侵犯是什么意思| 更年期皮肤瘙痒是什么原因| 鼻子旁边长痘是什么原因| 家庭烧烤准备什么食材| 护照类型p是什么意思| 慢性非萎缩性胃炎吃什么药| 荸荠读音是什么| ucs是什么意思| 考研复试考什么| 皮下出血小红点是什么原因造成的| 妇科衣原体是什么病| 为什么叫拉丁美洲| 女性生活疼痛什么原因| 张紫妍为什么自杀| 每天一杯蜂蜜水有什么好处| 小孩耳鸣是什么原因引起的| 脚底脱皮用什么药| 渎什么意思| 什么克木| 鲫鱼吃什么| 阻生齿是什么| 为什么会长肥胖纹| 谵妄是什么意思| 婳是什么意思| 胰岛素是干什么的| 人的牙齿为什么不能再生| 医保统筹支付什么意思| dha孕妇什么时候吃| 银饰变黑是什么原因| 卜卜脆是什么意思| 造瘘手术是什么意思| 莳花弄草是什么意思| 多潘立酮片是什么药| 脑供血不足吃什么药好得快| 嫡传弟子是什么意思| 什么什么之什么| 淋巴细胞百分比高是什么意思| 胃不舒服挂什么科| 妇科和妇产科有什么区别| 火箭军是干什么的| 慢性肠炎用什么药| 咽炎吃什么| 什么零食热量低有利于减肥| 6月24日是什么日子| 90年属于什么生肖| 钦点是什么意思| 麻瓜是什么意思| 心率过缓吃什么药| 离子检测是检查什么| 急性扁桃体发炎吃什么药| 别开生面什么意思| 崩盘是什么意思| 脸上长痣是什么原因| ph值偏高是什么意思| 12月13号什么星座| qs认证是什么意思| 蜈蚣吃什么| 婚煞是什么意思| 橘子什么季节成熟| 慢性阑尾炎吃什么消炎药| 结婚一年是什么婚| 粽子叶是什么植物的叶子| 太阳什么的什么的| yellow是什么颜色| 嘴突然歪是什么原因造成的| 冰岛说什么语言| 胎记看什么科| 纵欲过度是什么意思| 7.14号是什么节日| 属马女和什么属相最配| 肝胆湿热用什么药| 风寒感冒吃什么药| 十八罗汉分别叫什么| 女人丹凤眼意味什么| 落魄是什么意思| 授课是什么意思| 什么面条好吃| 肩膀疼是什么原因| 爱出者爱返福往者福来是什么意思| 1985年牛五行属什么| 阎王是什么意思| 什么样的孕妇容易翻盘| 宠物兔吃什么| 政客是什么意思| 几月初几是叫什么历| 鸡眼去医院挂什么科| 胎位左枕前是什么意思| 天使轮是什么意思| 什么叫慢阻肺| 摩羯座后面是什么星座| 小孩下面痒用什么药| 什么叫封闭针| 细菌性阴道炎用什么药好得快| 美国现在什么季节| 百度Jump to content

From Wikipedia, the free encyclopedia
百度 这样,建构起党内监督体系的基本框架,把所有党组织和工作部门都纳入监督主体范围。

A loadable kernel module (LKM) is an executable library that extends the capabilities of a running kernel, or so-called base kernel, of an operating system. LKMs are typically used to add support for new hardware (as device drivers) and/or filesystems, or for adding system calls. When the functionality provided by an LKM is no longer required, it can be unloaded in order to free memory and other resources.

Most current Unix-like systems and Windows support loadable kernel modules but with different names, such as kernel loadable module (kld) in FreeBSD, kernel extension (kext) in macOS (although support for third-party modules is being dropped[1]),[2] kernel extension module in AIX, dynamically loadable kernel module in HP-UX,[3] kernel-mode driver in Windows NT[4] and downloadable kernel module (DKM) in VxWorks. They are also known as kernel loadable module (KLM), or simply as kernel module (KMOD).

Advantages

[edit]

Without loadable kernel modules, an operating system would have to include all possible anticipated functionality compiled directly into the base kernel. Much of that functionality would reside in memory without being used, wasting memory [citation needed], and would require that users rebuild and reboot the base kernel every time they require new functionality.

Disadvantages

[edit]

One minor criticism of preferring a modular kernel over a static kernel is the so-called fragmentation penalty. The base kernel is always unpacked into real contiguous memory by its setup routines; thus, the base kernel code is never fragmented. Once the system is in a state in which modules may be inserted, for example once the filesystems have been mounted that contain the modules, it is likely that any new kernel code insertion will cause the kernel to become fragmented, thereby introducing a minor performance penalty by using more TLB entries, causing more TLB misses.[citation needed]

Implementations in different operating systems

[edit]

Linux

[edit]

Loadable kernel modules in Linux are loaded (and unloaded) by the modprobe command. They are located in /lib/modules or /usr/lib/modules and have had the extension .ko ("kernel object") since version 2.6 (previous versions used the .o extension).[5] The lsmod command lists the loaded kernel modules. In emergency cases, when the system fails to boot due to e.g. broken modules, specific modules can be enabled or disabled by modifying the kernel boot parameters list (for example, if using GRUB, by pressing 'e' in the GRUB start menu, then editing the kernel parameter line).

License issues

[edit]

In the opinion of Linux maintainers, LKM are derived works of the kernel[citation needed]. The Linux maintainers tolerate the distribution of proprietary modules (such as NVIDIA GPU drivers),[citation needed] but allow only GNU General Public License (GPL) modules to merge to kernel tree of mainline Linux kernel.

Loading a proprietary or non-GPL-compatible module will set a 'taint' flag[6][7] in the running kernel—meaning that any problems or bugs experienced will be less likely to be investigated by the maintainers.[8][9] LKMs effectively become part of the running kernel, so can corrupt kernel data structures and produce bugs that may not be able to be investigated if the module is indeed proprietary.

Linuxant controversy

[edit]

In 2004, Linuxant, a consulting company that releases proprietary device drivers as loadable kernel modules, attempted to abuse a null terminator in their MODULE_LICENSE, as visible in the following code excerpt:

MODULE_LICENSE("GPL\0for files in the \"GPL\" directory; for others, only LICENSE file applies");

The string comparison code used by the kernel at the time tried to determine whether the module was GPLed stopped when it reached a null character (\0), so it was fooled into thinking that the module was declaring its license to be just "GPL".[10]

FreeBSD

[edit]

Kernel modules for FreeBSD are stored within /boot/kernel/ for modules distributed with the operating system, or usually /boot/modules/ for modules installed from FreeBSD ports or FreeBSD packages, or for proprietary or otherwise binary-only modules. FreeBSD kernel modules usually have the extension .ko. Once the machine has booted, they may be loaded with the kldload command, unloaded with kldunload, and listed with kldstat. Modules can also be loaded from the loader before the kernel starts, either automatically (through /boot/loader.conf) or by hand.

macOS

[edit]

Some loadable kernel modules in macOS can be loaded automatically. Loadable kernel modules can also be loaded by the kextload command. They can be listed by the kextstat command. Loadable kernel modules are located in bundles with the extension .kext. Modules supplied with the operating system are stored in the /System/Library/Extensions directory; modules supplied by third parties are in various other directories.

NetWare

[edit]

A NetWare kernel module is referred to as a NetWare Loadable Module (NLM). NLMs are inserted into the NetWare kernel by means of the LOAD command, and removed by means of the UNLOAD command; the modules command lists currently loaded kernel modules. NLMs may reside in any valid search path assigned on the NetWare server, and they have .NLM as the file name extension.

VxWorks

[edit]

A downloadable kernel module (DKM) type project can be created to generate a ".out" file which can then be loaded to kernel space using "ld" command. This downloadable kernel module can be unloaded using "unld" command.

Solaris

[edit]

Solaris has a configurable kernel module load path, which defaults to /platform/platform-name/kernel /kernel /usr/kernel. Most kernel modules live in subdirectories under /kernel; those not considered necessary to boot the system to the point that init can start are often (but not always) found in /usr/kernel. When running a DEBUG kernel build the system actively attempts to unload modules.

Binary compatibility

[edit]

Linux does not provide a stable API or ABI for kernel modules. This means that there are differences in internal structure and function between different kernel versions, which can cause compatibility problems. In an attempt to combat those problems, symbol versioning data is placed within the .modinfo section of loadable ELF modules. This versioning information can be compared with that of the running kernel before loading a module; if the versions are incompatible, the module will not be loaded.

Other operating systems, such as Solaris, FreeBSD, macOS, and Windows keep the kernel API and ABI relatively stable, thus avoiding this problem. For example, FreeBSD kernel modules compiled against kernel version 6.0 will work without recompilation on any other FreeBSD 6.x version, e.g. 6.4. However, they are not compatible with other major versions and must be recompiled for use with FreeBSD 7.x, as API and ABI compatibility is maintained only within a branch.

Security

[edit]

While loadable kernel modules are a convenient method of modifying the running kernel, this can be abused by attackers on a compromised system to prevent detection of their processes or files, allowing them to maintain control over the system. Many rootkits make use of LKMs in this way. Note that, on most operating systems, modules do not help privilege elevation in any way, as elevated privilege is required to load a LKM; they merely make it easier for the attacker to hide the break-in.[11]

Linux

[edit]

Linux allows disabling module loading via sysctl option /proc/sys/kernel/modules_disabled.[12][13] An initramfs system may load specific modules needed for a machine at boot and then disable module loading. This makes the security very similar to a monolithic kernel. If an attacker can change the initramfs, they can change the kernel binary.

macOS

[edit]

In OS X Yosemite and later releases, a kernel extension has to be code-signed with a developer certificate that holds a particular "entitlement." Such a developer certificate is only provided by Apple on request and not automatically given to Apple Developer members. This feature, called "kext signing", is enabled by default and it instructs the kernel to stop booting if unsigned kernel extensions are present.[14] In OS X El Capitan and later releases, it is part of System Integrity Protection.

In older versions of macOS, or if kext signing is disabled, a loadable kernel module in a kernel extension bundle can be loaded by non-root users if the OSBundleAllowUserLoad property is set to True in the bundle's property list.[15] However, if any of the files in the bundle, including the executable code file, are not owned by root and group wheel, or are writable by the group or "other", the attempt to load the kernel loadable module will fail.[16]

Solaris

[edit]

Kernel modules can optionally have a cryptographic signature ELF section which is verified on load depending on the Verified Boot policy settings. The kernel can enforce that modules are cryptographically signed by a set of trusted certificates; the list of trusted certificates is held outside of the OS in the ILOM on some SPARC based platforms. Userspace initiated kernel module loading is only possible from the Trusted Path when the system is running with the Immutable Global Zone feature enabled.

See also

[edit]

References

[edit]
  1. ^ "Deprecated Kernel Extensions and System Extension Alternatives". Apple Inc. Retrieved 13 March 2021.
  2. ^ "Kernel Extension Programming Topics: Introduction". Apple Inc. September 1, 2010. Archived from the original on May 4, 2013. Retrieved May 5, 2013.
  3. ^ "Managing and Developing DynamicallyLoadable Kernel Modules". Hewlett-Packard. June 7, 2001.
  4. ^ "What Determines When a Driver Is Loaded". Microsoft Developer Network. Microsoft. November 21, 2012. Archived from the original on March 6, 2013. Retrieved May 5, 2013.
  5. ^ "The Linux Kernel Module Programming Guide, section 2.2 "Compiling Kernel Modules"". Retrieved 2025-08-06.
  6. ^ Linus Torvalds; et al. (2025-08-06). "Documentation/oops-tracing.txt". kernel.org. Archived from the original on 2025-08-06. Retrieved 2025-08-06.
  7. ^ "Tainted kernels". The Linux kernel user’s and administrator’s guide.
  8. ^ Jonathan Corbet (2025-08-06). "Tainting from user space". LWN.net. Archived from the original on 2025-08-06. Retrieved 2025-08-06.
  9. ^ "Novell support documentation: Tainted kernel". 2025-08-06. Retrieved 2025-08-06.
  10. ^ Jonathan Corbet (April 27, 2004). "Being honest with MODULE_LICENSE". LWN.net. Archived from the original on November 2, 2012. Retrieved October 30, 2012.
  11. ^ Exploiting Loadable Kernel Modules Archived 2025-08-06 at the Wayback Machine
  12. ^ "Sysctl/kernel.txt". Archived from the original on April 15, 2013. Retrieved January 4, 2013.
  13. ^ Kees Cook (2025-08-06). "Clean module disabling". outflux.net. Retrieved 2025-08-06.
  14. ^ "Kernel Extensions". Mac Developer Library. Apple. September 16, 2015. Archived from the original on August 17, 2016. Retrieved September 29, 2016.
  15. ^ "Info.plist Properties for Kernel Extensions". Apple Inc. Archived from the original on September 26, 2012. Retrieved September 27, 2012.
  16. ^ kextload(8) – Darwin and macOS System Manager's Manual
淋巴结用什么药效果好 毛发旺盛女生什么原因引起的 伏天是什么意思 拉肚子喝什么饮料 dlco是医学上什么意思
片状低回声区什么意思 不遗余力的遗是什么意思 平五行属什么 与世隔绝的绝是什么意思 轻度抑郁有什么症状
很什么很什么 手掌疼是什么原因 免疫力低会引起什么病 宫颈糜烂是什么 arr是什么
倒走对身体有什么好处 特朗普是什么星座 什么是化疗和放疗 铁路12306什么时候放票 孔雀开屏是什么行为
瘢痕子宫是什么意思hcv8jop4ns2r.cn 智字五行属什么xinjiangjialails.com 昏厥是什么意思hcv7jop9ns8r.cn 宝宝积食吃什么药hcv7jop9ns5r.cn 蹦蹦跳跳的动物是什么生肖hcv8jop3ns0r.cn
apm是什么意思hcv9jop0ns8r.cn 熳是什么意思hcv8jop7ns4r.cn 临床医生是什么意思hcv9jop6ns8r.cn 女性后背疼挂什么科室zsyouku.com 仓鼠咬笼子是什么原因hcv9jop0ns0r.cn
宝妈男是什么意思hcv9jop0ns0r.cn 12月9日什么星座hcv7jop4ns8r.cn art是什么hcv8jop8ns5r.cn 药物流产后吃什么好hcv8jop6ns3r.cn 鸿运当头什么意思hcv7jop9ns3r.cn
夏天是什么hcv8jop3ns9r.cn 血友病是什么hcv7jop5ns6r.cn 孕妇早上吃什么早餐好hcv8jop9ns1r.cn 97年属什么的生肖xinjiangjialails.com 荣五行属什么hcv8jop7ns7r.cn
百度