Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

How to use the kernel directly modify the data in a memory block address

I want to modify(read and write) the data in a user process virtual address space in kernel space, now i have convert the process virtual address converted to physical address, but how can i modify the data in kernel space. linux-3.14 arm64

in the old version(x86_64) i have used mmap to map / dev / mem, but it's doesn't work in arm64

#ifdef MMAP_INVALID_ARGUMENT /*    invalid argument    when mmap   */
    mapStart = (void volatile *)mmap(0, PAGE_SIZE, PROT_READ | PROT_WRITE,     MAP_SHARED | MAP_LOCKED, memfd, 0xF000);

#else
    mapStart = (void volatile *)mmap(0, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_LOCKED, memfd, pa_base);

#endif

I find that if the pa_bae is large than 1M, i get invalid argument

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.