#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/livepatch.h>
static int disable_posix_cpu_timer_create(void)
{
dump_stack();
return -ENOSYS;
}
static struct klp_func funcs[] = {
{
.old_name = "posix_cpu_timer_create",
.new_func = disable_posix_cpu_timer_create,
}, { }
};
static struct klp_object objs[] = {
{
.funcs = funcs,
}, { }
};
static struct klp_patch patch = {
.mod = THIS_MODULE,
.objs = objs,
};
static int livepatch_init(void)
{
return klp_enable_patch(&patch);