Commit Graph

13 Commits

Author SHA1 Message Date
AlexLiuDev233
30316047d6 refactor: kpm: memory management migrate to sukisu side (#539)
* refactor: kpm: memory management migrate to sukisu side

* fix: build warning in some gki2 device

fix stack frame size warning (maybe) in gki2 device, specialy in ShirkNeko's device

* chore: use pr_info instead of printk

* feat: check the validity of pointers sent from user space
Sometimes, ksud or other root processes might request a kpm ioctl,
but data incorrectly, such as invalid pointer,
which cause the kernel to crash.

If the request is made by ksud at boot time, the situation is even worse,
as it can cause the system to enter the boot loop.

Therefore, I believe we need to check pointer integrity in kernel space to fix this problem.

---------

Co-authored-by: Saksham <typeflu@gmail.com>
Co-authored-by: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com>
2025-11-08 18:10:26 +08:00
ShirkNeko
2075d2867e kernel: Migrating KPM to ioctl 2025-11-04 00:54:38 +08:00
Prslc
da89b00d06 kernel(kpm): Fix typo in printk logs (#311)
Signed-off-by: Prslc <prslc113@gmail.com>
2025-08-10 17:59:45 +08:00
ShirkNeko
f17e106464 移除 KPM 模块中函数的可见性修饰符,简化代码结构 2025-04-01 12:38:06 +08:00
ShirkNeko
78b662c360 更新 KPM 模块中的 copy_to_user 调用,增加对内核版本的条件编译支持,优化错误处理逻辑 2025-04-01 12:24:04 +08:00
ShirkNeko
f13de4f0d4 优化 KPM 模块中 copy_to_user 调用的错误处理,简化代码结构 2025-04-01 12:19:06 +08:00
ShirkNeko
88a84b71b7 修复 KPM 模块中 copy_to_user 调用的错误处理,确保在复制失败时记录错误信息 2025-04-01 12:04:40 +08:00
ShirkNeko
48227de1c8 更新 KPM 模块,调整函数节区标记以优化内存布局,并添加用户数据复制功能 2025-04-01 11:14:54 +08:00
ShirkNeko
f8e456dfcf 更新 KPM 模块,添加函数节区标记以优化内存布局,并在 Makefile 中调整编译选项以消除类型不匹配警告 2025-04-01 10:35:02 +08:00
ShirkNeko
9b9d72f200 更新 KPM 模块,添加错误处理以确保用户数据复制成功 2025-03-31 20:39:40 +08:00
ShirkNeko
6c4b73a38e 更新 KPM 模块,调整函数参数以支持额外的用户结果返回 2025-03-31 20:10:32 +08:00
ShirkNeko
cdf5e7b869 更新 KPM 模块,增加对 compact.o 的支持,并调整控制代码定义 2025-03-31 19:36:45 +08:00
ShirkNeko
743ddce9f7 添加 KPM 模块支持,包括 KPM 配置选项、核心功能实现及相关头文件 2025-03-30 02:54:23 +08:00