diff --git a/pwndbg/aglib/kernel/paging.py b/pwndbg/aglib/kernel/paging.py index 932ffc44a..07d049db8 100644 --- a/pwndbg/aglib/kernel/paging.py +++ b/pwndbg/aglib/kernel/paging.py @@ -68,13 +68,13 @@ class ArchPagingInfo: # true with the most common set of configurations # this struct should always present if a vmlinux is added return 0x40 - return a.sizeof + # needs to be rounded up to a power of 2 (consider the layout of vmemmap) + return 1 << math.ceil(math.log2(a.sizeof)) @property @pwndbg.lib.cache.cache_until("objfile") def STRUCT_PAGE_SHIFT(self): - # needs to be rounded up (consider the layout of vmemmap) - return math.ceil(math.log2(self.STRUCT_PAGE_SIZE)) + return int(math.log2(self.STRUCT_PAGE_SIZE)) @property def page_shift(self) -> int: diff --git a/pwndbg/aglib/kernel/vmmap.py b/pwndbg/aglib/kernel/vmmap.py index b5af3caa0..6bd342924 100644 --- a/pwndbg/aglib/kernel/vmmap.py +++ b/pwndbg/aglib/kernel/vmmap.py @@ -32,7 +32,7 @@ class KernelVmmap: self.pages = pages self.sections = None self.pi = pwndbg.aglib.kernel.arch_paginginfo() - if self.pi and pwndbg.aglib.kernel.has_debug_symbols(): + if self.pi: self.sections = self.pi.markers() def get_name(self, addr: int) -> str: diff --git a/tests/library/qemu_system/tests/test_commands_kernel.py b/tests/library/qemu_system/tests/test_commands_kernel.py index 48b559528..f70bd6f97 100644 --- a/tests/library/qemu_system/tests/test_commands_kernel.py +++ b/tests/library/qemu_system/tests/test_commands_kernel.py @@ -181,9 +181,6 @@ def get_slab_object_address(): # gdb.execute(f"msr MSR_LSTAR -w {prev_msr_lstar}") -@pytest.mark.skipif( - not pwndbg.aglib.kernel.has_debug_symbols(), reason="test requires debug symbols" -) def test_command_kernel_vmmap(): res = gdb.execute("vmmap", to_string=True) assert all(