mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-22 17:55:57 +01:00
Also:
* fix fops.c on both kernels:
* 5.9: the out of space error code was 1 not 8
* 6.6: for whatever reason we can't read the user buffer as before on the
diagnostic print, it leads to segfault and oops
* create memfile.c which is like fops.c but of unlimited size
10 lines
257 B
Bash
Executable File
10 lines
257 B
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
f=/sys/kernel/debug/lkmc_seq_file_single_open
|
|
mod="${1:-seq_file_single_open.ko}"
|
|
shift
|
|
insmod "$mod" "$@"
|
|
[ "$(cat "$f")" = "$(printf 'ab\ncd\n')" ]
|
|
[ "$(dd if="$f" bs=1 count=3 skip=1)" = "$(printf "b\nc\n")" ]
|
|
rmmod seq_file_single_open
|