misc0110/PTEditor

Error Installing with linux kernel 6.2

Closed this issue · 5 comments

Hi misc0110,

I am trying to install PTEditor on Ubuntu 22.04, with linux kernel 6.2, in both PPA and Source. However, I come across the following error:

When I try the PPA and do

curl -s "https://misc0110.github.io/ppa/KEY.gpg" | sudo apt-key add -

I got a warning

Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK

When I do update, I got this warning:

W: https://misc0110.github.io/ppa/./InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.

Finally, when I install pteditor-dkms, the error comes

Building initial module for 6.2.0-26-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/pteditor-dkms.0.crash'
Error! Bad return status for module build on kernel: 6.2.0-26-generic (x86_64)
Consult /var/lib/dkms/pteditor/0.5/build/make.log for more information.
dpkg: error processing package pteditor-dkms (--configure):
 installed pteditor-dkms package post-installation script subprocess returned error exit status 10
Errors were encountered while processing:
 pteditor-dkms
E: Sub-process /usr/bin/dpkg returned an error code (1)

It seems I cannot fully install the pteditor-dkms, maybe the package is encountering some error.

I also tried the Install Kernel Part From Source. It is good when make. However, when I do the test. I receive:

[ RUN      ] memtype.uncachable_access_time
AddressSanitizer:DEADLYSIGNAL
=================================================================
==35227==ERROR: AddressSanitizer: SEGV on unknown address 0x55ff4d7ea176 (pc 0x55ff4d7ea176 bp 0x000000000027 sp 0x7fff37c47858 T0)
==35227==The signal is caused by a READ memory access.
    #0 0x55ff4d7ea176 in utest_memtype_uncachable_access_time (/home/yyilong/Study/downfall/POC/third_party/PTEditor/test/tests+0xb176)
    #1 0x55ff4d7e9778 in utest_main (/home/yyilong/Study/downfall/POC/third_party/PTEditor/test/tests+0xa778)
    #2 0x55ff4d7e3df3 in main (/home/yyilong/Study/downfall/POC/third_party/PTEditor/test/tests+0x4df3)
    #3 0x7fb94e029d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #4 0x7fb94e029e3f in __libc_start_main_impl ../csu/libc-start.c:392
    #5 0x55ff4d7e3e64 in _start (/home/yyilong/Study/downfall/POC/third_party/PTEditor/test/tests+0x4e64)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/home/yyilong/Study/downfall/POC/third_party/PTEditor/test/tests+0xb176) in utest_memtype_uncachable_access_time
==35227==ABORTING

I found the test case and commented the ASSERTs to see other test cases, and I still receive error from the same test case memtype.uncachable_access_time, and the error is always the AddressSanitizer during a read. This error may also appear in some pte test cases.

I am not sure if the reason is the kernel version. I know PTEditor is supported in kernel 5.15, but my version is 6.2. Could you please inform me what should be down to successfully run it?

Thank you so much.

Best regards,
Yilong

Thanks for noticing the deprecation warning of apt-keys, I'll update that. However, this has nothing to do with the errors you encounter.

As for the error in the tests itself, I'm not sure what exactly causes that. I just tried myself on kernel 6.2.0-26, and all the tests ran without a problem. Which compiler (+version) and OS are you using?

Thank you for getting back so swiftly. I am using gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0. In the test folder, the command is gcc -Os tests.c -std=gnu99 -o tests -fsanitize=address. The error above may be largely related to the fsanitize=address.

Hi misc0110,

I updated the newest version and it once passes all the cases. However, when I ran the second time, there seems to be a minor failure:

[ RUN      ] tlb.access_time_custom_tlb_flush
tests.c:457: Failure
  Expected : undef
    Actual : undef
[  FAILED  ] tlb.access_time_custom_tlb_flush (31148930ns)
[==========] 37 test cases ran.
[  PASSED  ] 36 tests.
[  FAILED  ] 1 tests, listed below:
[  FAILED  ] tlb.access_time_custom_tlb_flush

I ran it multiple times. Sometimes the failure happens, sometimes not. But the Address Sanitize problem is not happening. Instead there is a note Could not allocate huge page.

Thank you.

Great to hear. The problem with the huge pages should be resolvable using sudo sysctl -w vm.nr_hugepages=2.

Thank you for telling me the command. Now the hugepages problem is fixed!

Still, I sometimes find the tlb flush problem. Seems like the Expected is also undef, as well as the Actual. I don't know if that could be a problem.

[ RUN      ] tlb.access_time_kernel_tlb_flush
tests.c:450: Failure
  Expected : undef
    Actual : undef
[  FAILED  ] tlb.access_time_kernel_tlb_flush (153395ns)
[ RUN      ] tlb.access_time_custom_tlb_flush
tests.c:457: Failure
  Expected : undef
    Actual : undef
[  FAILED  ] tlb.access_time_custom_tlb_flush (31430197ns)
[==========] 37 test cases ran.
[  PASSED  ] 35 tests.
[  FAILED  ] 2 tests, listed below:
[  FAILED  ] tlb.access_time_kernel_tlb_flush
[  FAILED  ] tlb.access_time_custom_tlb_flush