This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-05 00:00:00 +00:00
parent 0ef494b681
commit aea97698c3
48 changed files with 840 additions and 798 deletions

View File

@@ -1,5 +1,6 @@
#!/bin/sh
# https://github.com/cirosantilli/linux-kernel-module-cheat#anonymous-inode
set -e
insmod anonymous_inode.ko
[ "$(/anonymous_inode.out /sys/kernel/debug/lkmc_anonymous_inode 3)" = "$(printf '1\n10\n100')" ]
[ "$(./kernel_modules/anonymous_inode.out /sys/kernel/debug/lkmc_anonymous_inode 3)" = "$(printf '1\n10\n100')" ]
rmmod anonymous_inode

View File

@@ -1,7 +1,8 @@
#!/bin/sh
# https://github.com/cirosantilli/linux-kernel-module-cheat#ioctl
set -e
f=/sys/kernel/debug/lkmc_ioctl
insmod ioctl.ko
[ "$(/ioctl.out "$f" 0 1)" = 2 ]
[ "$(/ioctl.out "$f" 1 1 1)" = '2 0' ]
[ "$(./kernel_modules/ioctl.out "$f" 0 1)" = 2 ]
[ "$(./kernel_modules/ioctl.out "$f" 1 1 1)" = '2 0' ]
rmmod ioctl

View File

@@ -1,7 +1,8 @@
#!/bin/sh
# https://github.com/cirosantilli/linux-kernel-module-cheat#netlink-sockets
set -e
insmod netlink.ko
[ "$(/netlink.out)" = 0 ]
[ "$(/netlink.out)" = 1 ]
[ "$(/netlink.out)" = 2 ]
[ "$(./linux/netlink.out)" = 0 ]
[ "$(./linux/netlink.out)" = 1 ]
[ "$(./linux/netlink.out)" = 2 ]
rmmod netlink

View File

@@ -1,5 +1,6 @@
#!/bin/sh
# https://github.com/cirosantilli/linux-kernel-module-cheat#poll
set -e
insmod poll.ko
./poll.out /sys/kernel/debug/lkmc_poll
./kernel_modules/poll.out /sys/kernel/debug/lkmc_poll
#rmmod poll

View File

@@ -4,7 +4,7 @@ set -e
modprobe uio_pci_generic
# pci_min device
echo '1234 11e9' > /sys/bus/pci/drivers/uio_pci_generic/new_id
./uio_read.out &
./kernel_modules/uio_read.out &
# Helper to observe interrupts.
insmod irq.ko
base="$(setpci -d 1234:11e9 BASE_ADDRESS_0)"