hope this works

This commit is contained in:
twoneis 2025-04-04 00:36:58 +02:00
parent f686c61ad3
commit e02bc887ca
4 changed files with 11 additions and 5 deletions

View file

@ -1,13 +1,23 @@
obj-m += lkm.o obj-m += lkm.o
CC := gcc
SOURCES := $(wildcard *.c) SOURCES := $(wildcard *.c)
TARGETS := $(SOURCES:.c=.o) TARGETS := $(SOURCES:.c=.o)
CFLAGS += -g
CFLAGS += -O0
CFLAGS += -Wall
CFLAGS += -Wextra
all: $(TARGETS) all: $(TARGETS)
run: leak run: leak
./leak.o ./leak.o
%.o: %.c
$(CC) $< $(CFLAGS) -o $@
lkm: lkm:
make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) modules make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) modules

View file

@ -7,7 +7,7 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "pipe_utils.h" #include "pipe_utils.c"
// where does this come from? // where does this come from?
#define OBJS_PER_SLAB 42 #define OBJS_PER_SLAB 42

View file

@ -1,11 +1,8 @@
#define _GNU_SOURCE #define _GNU_SOURCE
#include <sys/socket.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include "pipe_utils.h"
void void
allocation_primitive(int fd[2]) allocation_primitive(int fd[2])
{ {

View file

@ -1 +0,0 @@
void allocation_primitive(int fd[2]);