mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-25 11:11:35 +01:00
bak
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)"
|
||||
|
||||
Reference in New Issue
Block a user