Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make /proc/kcore acquisition better #114

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

paulkermann
Copy link

Fixes issue in PPC64 acquisition where file offset was invalid.
Ram segments are added sequentially after the first one in the program header.
So only after finding the first physical address append blocks.
Also, this way we don't "split" some ram segments in AMD64

...
00100000-c61ce017 : System RAM
c61ce018-c61ddc57 : System RAM
c61ddc58-c61de017 : System RAM
c61de018-c61ee057 : System RAM
c61ee058-c6612fff : System RAM
...

as in the kcore file it just apears as

  LOAD           0x0000177940103000 0xffff977940100000 0x0000000000100000
                 0x00000000c60ce000 0x00000000c60ce000  RWE    0x1000
  LOAD           0x0000177a061d2000 0xffff977a061cf000 0x00000000c61cf000
                 0x000000000000e000 0x000000000000e000  RWE    0x1000
  LOAD           0x0000177a061e2000 0xffff977a061df000 0x00000000c61df000
                 0x000000000000f000 0x000000000000f000  RWE    0x1000
  LOAD           0x0000177a061f2000 0xffff977a061ef000 0x00000000c61ef000
                 0x0000000000424000 0x0000000000424000  RWE    0x1000
  LOAD           0x0000177a0661d000 0xffff977a0661a000 0x00000000c661a000
                 0x0000000000445000 0x0000000000445000  RWE    0x1000
  LOAD           0x0000177a06e17000 0xffff977a06e14000 0x00000000c6e14000
                 0x000000000fd8f000 0x000000000fd8f000  RWE    0x1000

so they are physically aligned and easier to manage and more data is returned.
First time doing anything in rust, so correct me if I have done something incorrectly.

@ghost
Copy link

ghost commented Jun 28, 2022

CLA assistant check
All CLA requirements met.

@bmc-msft bmc-msft self-requested a review June 29, 2022 13:53
src/snapshot.rs Outdated Show resolved Hide resolved
remove whitespace from fmt
src/snapshot.rs Outdated Show resolved Hide resolved
@bmc-msft
Copy link
Contributor

The file offset issue is clearly a bug and should be addressed. With regards to relying on the program headers in the pseudo-elf file, I would like to do much more testing of this feature before we merge it.

@paulkermann
Copy link
Author

You can use arm_now to do tests for powerpc and other archs as well if needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants