gpt4 book ai didi

linux-kernel - Linux 中的 OE+ 是什么?

转载 作者:行者123 更新时间:2023-12-01 18:08:49 24 4
gpt4 key购买 nike

下面的(OE+)是什么意思?

$ sudo cat /proc/modules | grep hello //hello_world is a kernel module created by me.
hello_world 20480 1 - Loading 0xffffffffc0221000 (OE+)

这是我的情况。
我已经修补了 Linux 内核函数 load_module(),该函数是从 finit_module() 调用的,这是 insmod 用于插入内核模块的系统调用。该补丁会查找由我创建的正在安装的特定模块(称为 hello_world),当它出现时,它会阻止对 do_init_module() 的调用,并返回 0 。 do_init_call() 负责调用模块的 init 函数,并将模块状态设置为事件状态 (MODULE_STATE_LIVE)。

当我读取/proc/modules时,模块状态为Loading,这是预期的。但是我不明白输出末尾 (OE+) 的含义。正如以下命令所验证的那样,这不会针对任何其他模块显示。

$ sudo cat /proc/modules | grep OE
hello_world 20480 1 - Loading 0xffffffffc0221000 (OE+)

我使用的是 Linux 内核 v4.7.3

更新

这一切都发生在 Qemu 虚拟机中。在运行 Linux 4.4.0-36-generic (Ubuntu) 的主机上,我得到以下信息。

$ sudo cat /proc/modules | grep OE
vboxpci 24576 0 - Live 0xffffffffc082a000 (OE)
vboxnetadp 28672 0 - Live 0xffffffffc066e000 (OE)
vboxnetflt 28672 0 - Live 0xffffffffc0635000 (OE)
vboxdrv 454656 3 vboxpci,vboxnetadp,vboxnetflt, Live 0xffffffffc0783000 (OE)
sep4_0 671744 0 - Live 0xffffffffc06de000 (OE)
socperf2_0 36864 1 sep4_0, Live 0xffffffffc0660000 (OE)
pax 16384 0 - Live 0xffffffffc05f9000 (OE)

最佳答案

O 表示树外模块已加载。
E 表示未签名模块已加载。
+ 表示模块正在加载。
- 表示正在卸载模块。

print_modules()的源代码,然后 module_flags() ,然后 print_tainted()函数可能有助于弄清楚这些和其他一些标志的含义。看一下 print_tainted() 函数上面的注释。希望这会有所帮助。

关于linux-kernel - Linux 中的 OE+ 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39435927/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com