mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
memcpy_overflow failed fortify source attempt
This commit is contained in:
21
kernel_module/memcpy_overflow.c
Normal file
21
kernel_module/memcpy_overflow.c
Normal file
@@ -0,0 +1,21 @@
|
||||
/* https://github.com/cirosantilli/linux-kernel-module-cheat#config_fortify_source */
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
static int myinit(void)
|
||||
{
|
||||
void *dst, *src;
|
||||
dst = kmalloc(0x10, GFP_KERNEL);
|
||||
src = kmalloc(0x1000000, GFP_KERNEL);
|
||||
memcpy(dst, src, 0x1000000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void myexit(void) {}
|
||||
|
||||
module_init(myinit)
|
||||
module_exit(myexit)
|
||||
MODULE_LICENSE("GPL");
|
||||
Reference in New Issue
Block a user