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

Help please. #36

Closed
Zibri opened this issue Oct 23, 2022 · 1 comment
Closed

Help please. #36

Zibri opened this issue Oct 23, 2022 · 1 comment

Comments

@Zibri
Copy link

Zibri commented Oct 23, 2022

Hello!
I am writing a kernel module that patches a kernel function on ARM64 (android).
The problem is that as I write the 8 bytes I need to write, kernel crashes and reboots.
I have seen you are using update_mapping_prot but I don't understand how to use it to make RW the function code.

For example, let's say I want to change 8 bytes in function ip_forward.
I get the address to modify in a variable like this:

unsigned long *ff;
..........
ff=findcode();
printk("Found code at: %lx\n",ff);

to write it I do:
ff[0]=0xd503201fd503201f; // two nops
or
*ff = 0xd503201fd503201f; // two nops

how can I make the kernel code section where ip_forward is RW before the write?

@m0nad
Copy link
Owner

m0nad commented Sep 29, 2023

This part was written by @awerv, which can help you better.

@m0nad m0nad closed this as completed Sep 29, 2023
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

No branches or pull requests

2 participants