From d60fb716a49635076c27dc8018baa588a6c6a22f Mon Sep 17 00:00:00 2001 From: Greg Buchholz Date: Sat, 28 Aug 2021 11:31:46 -0700 Subject: [PATCH 1/3] The "lkm" script used in chapter 4 for loading kernel modules uses dmesg which fails on permissions. Changing to "sudo dmesg" fixes it. --- lkm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lkm b/lkm index c1a32cb..fd17e00 100755 --- a/lkm +++ b/lkm @@ -49,5 +49,5 @@ runcmd "make || exit 1" } runcmd "sudo insmod ./$1.ko && lsmod|grep $1" -runcmd dmesg +runcmd "sudo dmesg" exit 0 From 5710228a8b02f785a733189e6aa04de55ccc99aa Mon Sep 17 00:00:00 2001 From: Kaiwan N Billimoria Date: Tue, 31 Aug 2021 08:00:03 +0530 Subject: [PATCH 2/3] Update lkm Ubuntu 20.10 onward has enabled CONFIG_SECURITY_DMESG_RESTRICT ! That's good for security So we need to 'sudo' dmesg; thanks to @gregbuchholz for pointing this out --- lkm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lkm b/lkm index fd17e00..bc2673f 100755 --- a/lkm +++ b/lkm @@ -49,5 +49,7 @@ runcmd "make || exit 1" } runcmd "sudo insmod ./$1.ko && lsmod|grep $1" +# Ubuntu 20.10 onward has enabled CONFIG_SECURITY_DMESG_RESTRICT ! That's good for security +# So we need to 'sudo' dmesg; thanks to @gregbuchholz for pointing this out runcmd "sudo dmesg" exit 0 From fe3d8d80d1971fa0842e0b280f2b84bb0c37a464 Mon Sep 17 00:00:00 2001 From: Kaiwan N Billimoria Date: Tue, 31 Aug 2021 08:00:47 +0530 Subject: [PATCH 3/3] Create lkm Ubuntu 20.10 onward has enabled CONFIG_SECURITY_DMESG_RESTRICT ! That's good for security So we need to 'sudo' dmesg; thanks to @gregbuchholz for pointing this out