mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-27 12:04:27 +01:00
strlen_overflow: cleanup after reddit rush
This commit is contained in:
@@ -1,18 +1,14 @@
|
|||||||
|
/*
|
||||||
|
https://www.reddit.com/r/hacking/comments/8h4qxk/what_a_buffer_overflow_in_the_linux_kernel_looks/
|
||||||
|
*/
|
||||||
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/string.h>
|
#include <linux/string.h>
|
||||||
|
|
||||||
static int myinit(void)
|
static int myinit(void)
|
||||||
{
|
{
|
||||||
enum { size = 256 };
|
char buf[] = {'p', 'w', 'n'};
|
||||||
int i = 1;
|
|
||||||
char buf[size];
|
|
||||||
char buf2[size];
|
|
||||||
for (i = 0; i < size; i++) {
|
|
||||||
buf[i] = 'a';
|
|
||||||
buf2[i] = 'b';
|
|
||||||
}
|
|
||||||
/*char buf[] = {'p', 'w', 'n'};*/
|
|
||||||
pr_info("%llu\n", (long long unsigned)strlen(buf));
|
pr_info("%llu\n", (long long unsigned)strlen(buf));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user