You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there is no immediate solution. You need to troubleshoot it yourself or provide the device to me for further investigation.
代码时kpms里的demo
#include <compiler.h>
#include <kpmodule.h>
#include <linux/printk.h>
#include <common.h>
#include <kputils.h>
#include <linux/string.h>
#include <kpmalloc.h>
Currently, there is no immediate solution. You need to troubleshoot it yourself or provide the device to me for further investigation.
代码时kpms里的demo
#include <compiler.h>
#include <kpmodule.h>
#include <linux/printk.h>
#include <common.h>
#include <kputils.h>
#include <linux/string.h>
#include <kpmalloc.h>
KPM_NAME("kpm-hello-demo");
KPM_VERSION("1.0.0");
KPM_LICENSE("GPL v2");
KPM_AUTHOR("bmax121");
KPM_DESCRIPTION("KernelPatch Module Example");
static long hello_init(const char *args, const char *event, void *__user reserved)
{
pr_info("kpm hello init, event: %s, args: %s\n", event, args);
pr_info("kernelpatch version: %x\n", kpver);
return 0;
}
static long hello_control0(const char *args, char *__user out_msg, int outlen)
{
pr_info("kpm hello control0, args: %s\n", args);
char echo[64] = "echo: ";
strncat(echo, args, 48);
compat_copy_to_user(out_msg, echo, sizeof(echo));
return 0;
}
static long hello_control1(void a1, void a2, void a3)
{
/char str = (char)kp_malloc(sizeof(char) * 10);
kp_free(str);/
int arr = kp_malloc(sizeof(int) * 10);
kp_free(arr);
pr_info("kpm hello control1, a1: %llx, a2: %llx, a3: %llx\n", a1, a2, a3);
return 0;
}
static long hello_exit(void *__user reserved)
{
pr_info("kpm hello exit\n");
return 0;
}
KPM_INIT(hello_init);
KPM_CTL0(hello_control0);
KPM_CTL1(hello_control1);
KPM_EXIT(hello_exit);
只是加了这段,模块就无法加载了
/char str = (char*)kp_malloc(sizeof(char) * 10);
kp_free(str);/
int arr = kp_malloc(sizeof(int) * 10);
kp_free(arr);
请问这个是什么原因呢?
The text was updated successfully, but these errors were encountered: