当前位置:网站首页>cat /proc/kallsyms 发现内核符号表值都为0
cat /proc/kallsyms 发现内核符号表值都为0
2022-08-04 11:06:00 【android framework】
最近调试内核,cat /proc/kallsyms 后发现符号表值都为0。
检查内核配置项,该配的都已经配置。
查找很多网上资料,说是内核为了防止漏洞出现,特意不让非root用户查看符号表。
但是我将shell切换为root,还是只能查看到0.
因此只能修改内核代码。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);
} else
seq_printf(m, "%pK %c %s\n", (void *)iter->value,
iter->type, iter->name);
return 0;
}
需要将seq_printf(m, “%pK %c %s\t[%s]\n”, (void *)iter->value,
type, iter->name, iter->module_name); 中的K去掉,重新编译烧写内核即可。
seq_printf(m, “%p %c %s\t[%s]\n”, (void *)iter->value,
type, iter->name, iter->module_name);
边栏推荐
猜你喜欢
【黄啊码】MySQL入门—1、SQL 的执行流程
深度学习100例 —— 卷积神经网络(CNN)天气识别
学会使用set和map的基本接口
萌宠来袭,如何让“吸猫撸狗”更有保障?
Small program containers accelerate the construction of an integrated online government service platform
Jina 实例秀|基于神经搜索的网络安全威胁检测(一)
技术干货 | 用零信任保护代码安全
化繁为简!阿里新产亿级流量系统设计核心原理高级笔记(终极版)
北京大学,新迎3位副校长!其中一人为中科院院士!
热成像测温的原理是什么呢?你知道吗?
随机推荐
【机器学习】:如何对你的数据进行分类?
Mysql数据类型
ArrayList和LinkedList的区别
*iframe*
Camunda整体架构和相关概念
helm安装
Digital management insight into retail and e-commerce operations - retail password
章节小测一
音频编辑 合唱
datax oracle to oracle incremental synchronization
小程序容器加快一体化在线政务服务平台建设
【LeetCode】653. 两数之和 IV - 输入 BST
What is the principle of thermal imaging temperature measurement?Do you know?
*SEO*
Business collocations
Zikko上市同时搭载HDMI2.1和2.5GbE新款雷电4扩展坞
中介者模式(Mediator)
Use pytest hook function to realize automatic test result push enterprise WeChat
WPF 截图控件之画笔(八)「仿微信」
【LeetCode】701.二叉搜索树中的插入操作