Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Commit

Permalink
add kernel debug env instructions to README
Browse files Browse the repository at this point in the history
  • Loading branch information
bonifaido committed May 3, 2024
1 parent 8093d65 commit 956a815
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ Between two applications - both of them intercepted by this module - the traffic

## Debugging

### Logging

Most of the logs of this module are on debug level and can be shown using [dynamic debug](https://www.kernel.org/doc/html/latest/admin-guide/dynamic-debug-howto.html) feature of the Linux kernel.

Use the following command to turn on debug level logging for the module:
Expand All @@ -140,6 +142,26 @@ Use the following command to turn on debug level logging for the module:
echo -n '-p; module camblet file opa.c +pftl' | sudo tee /proc/dynamic_debug/control > /dev/null
```

### Kernel debugging environment

The kernel module can be traced for memory leaks and other issues with the help of fine tools, like [KASAN](https://www.kernel.org/doc/html/latest/dev-tools/kasan.html) and [Kmemleak](https://www.kernel.org/doc/html/latest/dev-tools/kmemleak.html).

To create a kernel debugging environment on Fedora, follow these steps:

```bash
sudo dnf update
sudo dnf install kernel-debug-devel

# Check the current debug kernel version, and set it as default (ls /boot/)
CURRENT_DEBUG_KERNEL=vmlinuz-6.8.7-200.fc39.aarch64+debug

sudo grubby --set-default /boot/${CURRENT_DEBUG_KERNEL}
sudo grubby --update-kernel=/boot/${CURRENT_DEBUG_KERNEL} --args kmemleak=on
grubby --update-kernel=ALL --args="kasan=on"

sudo reboot
```

### Test mTLS

The kernel module offers TLS termination on certain ports selected by an [OPA](https://www.openpolicyagent.org) rule-set:
Expand Down

0 comments on commit 956a815

Please sign in to comment.