Skip to content

Commit 6390456

Browse files
committed
LKM, scripts: fix usage when kernel is on cfi
sometimes another symbol comes up ext4_unregister_sysfs.cfi_jt Signed-off-by: backslashxx <[email protected]>
1 parent a91d4e3 commit 6390456

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

module/post-fs-data.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ if [ $enable_lkm_nuke = 1 ] && [ -f "$MODDIR/lkm/$lkm_filename" ] &&
332332
mnt="$(realpath "$MNT_FOLDER/$FAKE_MOUNT_NAME")"
333333
kptr_set=$(cat /proc/sys/kernel/kptr_restrict)
334334
echo 1 > /proc/sys/kernel/kptr_restrict
335-
ptr_address=$(grep ext4_unregister_sysfs /proc/kallsyms | awk {'print "0x"$1'})
335+
ptr_address=$(grep " ext4_unregister_sysfs$" /proc/kallsyms | awk {'print "0x"$1'})
336336
echo "mountify/post-fs-data: loading LKM with mount_point=$mnt symaddr=$ptr_address" >> /dev/kmsg
337337
insmod "$MODDIR/lkm/$lkm_filename" mount_point="$mnt" symaddr="$ptr_address" > /dev/null 2>&1
338338
echo $kptr_set > /proc/sys/kernel/kptr_restrict

nuke_ext4_lkm/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Usage:
99

1010
kptr_set=$(cat /proc/sys/kernel/kptr_restrict)
1111
echo 1 > /proc/sys/kernel/kptr_restrict
12-
ptr_address=$(grep ext4_unregister_sysfs /proc/kallsyms | awk {'print "0x"$1'})
12+
ptr_address=$(grep " ext4_unregister_sysfs$" /proc/kallsyms | awk {'print "0x"$1'})
1313
insmod nuke.ko mount_point="/data/adb/modules" symaddr="$ptr_address"
1414
echo $kptr_set > /proc/sys/kernel/kptr_restrict
1515
```

0 commit comments

Comments
 (0)