当前位置:网站首页>cat /proc/kallsyms found that the kernel symbol table values are all 0
cat /proc/kallsyms found that the kernel symbol table values are all 0
2022-08-04 11:13:00 【android framework】
Recently debugging the kernel, after cat /proc/kallsyms found that the symbol table values are all 0.
Check the kernel configuration items, the configuration has been configured.
Finding a lot of online information, it is said that the kernel deliberately prevents non-root users from viewing the symbol table in order to prevent the occurrence of vulnerabilities.
But if I switch the shell to root, I can only see 0.
Therefore, only the kernel code can be modified.kernel/kernel/kallsyms.c
static int s_show(struct seq_file *m, void *p)
{
struct kallsym_iter *iter = m->private;
/* Some debugging symbols have no name. Ignore them. */if (!iter->name[0])return 0;if (iter->module_name[0]) {char type;/** Label it "global" if it is exported,* "local" if not exported.*/type = iter->exported ? toupper(iter->type) :tolower(iter->type);seq_printf(m, "%pK %c %s\t[%s]\n", (void *)iter->value,type, iter->name, iter->module_name);} elseseq_printf(m, "%pK %c %s\n", (void *)iter->value,iter->type, iter->name);return 0;}
Need to seq_printf(m, “%pK %c %s\t[%s]\n”, (void *)iter->value,
type, iter->name, iter->module_name); Remove the K in it and recompile and program the kernel.
seq_printf(m, “%p %c %s\t[%s]\n”, (void *)iter->value,
type, iter->name, iter->module_name);
边栏推荐
猜你喜欢
随机推荐
关于架构的思考
【LeetCode】700.二叉搜索树
萌宠来袭,如何让“吸猫撸狗”更有保障?
【LeetCode】653. 两数之和 IV - 输入 BST
命令模式(Command)
MySQL最大建议行数2000w, 靠谱吗?
tp5+微信小程序 分片上传
Leetcode刷题——路径总和
开源一夏|ArkUI如何自定义弹窗(eTS)
强烈推荐一款优秀且通用的后台管理系统
win8和win10下,visual studio 2008 调试出现无响应的卡死问题解决
临床研究方法学,到现场,到数据真实发生的地方 | 对话数智 x 张维拓
Heap Sort
学会使用set和map的基本接口
MATLAB程序设计与应用 3.2 矩阵变换
职责链模式(responsibilitychain)
helm安装
中介者模式(Mediator)
8月活动|51CTO十七周年庆,发博文得茶具/笔记本/T恤等礼品!
Camunda整体架构和相关概念









