Skip to content

eliotsolomon18/wasm3-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wasm3 Kernel Module

This repository contains a kernel module that runs a small WASM program in kernel space. It illustrates how to expose functions from the kernel module to the WASM program as well as how to pass a variable-length data structure from the module to the program. It also hooks into netfilter to invoke the WASM program in response to every IPv4 packet.

Structure

  • main.c
    • This is the kernel module itself.
  • Makefile
    • This is a Makefile that can be used to build the kernel module.
  • wasm3-kernel/
    • This is a submodule that points to a fork of the wasm3 repository that has been modified to run in kernel space.
    • All the heavy lifting was done by this fork, but I merged in the latest changes from the upstream repository.
  • wasm/
    • This directory contains the WASM program as well as a program that can be used to load it into the kernel. A Makefile is provided to automate the process of building and loading the program.

Build

$ make

Install

$ sudo make install

Load WASM program

$ sudo make load

Uninstall

$ sudo make remove

Check Output

$ sudo journalctl --since "1 hour ago" | grep kernel

Clean up

$ make clean

Resources

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •