I am trying to dump some kernel data structure (walk e.g. task or file data structure on x86_64 arch). Sometime accessing through a pointer, pointer may not be NULL, but pointing to invalid address due to garbage value. What I am looking for is range of address which are valid for kernel data structure. Is it correct to say following address are valid ? - Bit 0 - 47 are considered - Between FFFF8000'00000000 through FFFFFFFF'FFFFFFFF
On Sunday, February 24, 2013, Abu Rasheda wrote:
I am trying to dump some kernel data structure (walk e.g. task or file data structure on x86_64 arch). Sometime accessing through a pointer, pointer may not be NULL, but pointing to invalid address due to garbage value.
What I am looking for is range of address which are valid for kernel data structure. Is it correct to say following address are valid ?
- Bit 0 - 47 are considered - Between FFFF8000'00000000 through FFFFFFFF'FFFFFFFF
Will this cover all situations if (long_ptr > 0x1000) { tmp_long_ptr = ((long_ptr & 0x800000000000) ? (long_ptr | 0xffff800000000000) : (long_ptr & 0xFFFFFFFFFFFF)); printf("tmp_long_ptr :0x%llx\n", (long long int) tmp_long_ptr); if ((long_ptr == tmp_long_ptr) & (long_ptr >= 0x30000000)) printf("valid 64 addr\n"); }
On Sun, Feb 24, 2013 at 11:23 PM, <Valdis.Kletnieks@vt.edu> wrote:
On Sun, 24 Feb 2013 21:37:48 -0800, Abu Rasheda said:
tmp_long_ptr = ((long_ptr & 0x800000000000) ? (long_ptr | 0xffff800000000000) : (long_ptr & 0xFFFFFFFFFFFF));
This will not do what you think it does when compiled for a 32-bit system.
This code will never run on 32 bit system, but on 64 bit Intel. So does this cover all possible valid addresses where kernel data structure can reside ? here is the expression again: if (long_ptr > 0x1000) { tmp_long_ptr = ((long_ptr & 0x800000000000) ? (long_ptr | 0xffff800000000000) : (long_ptr & 0xFFFFFFFFFFFF)); printf("tmp_long_ptr :0x%llx\n", (long long int) tmp_long_ptr); if ((long_ptr == tmp_long_ptr) & (long_ptr >= 0x30000000)) printf("valid 64 addr\n"); }
participants (2)
-
Abu Rasheda -
Valdis.Kletnieks@vt.edu