LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-23-2012, 01:50 AM   #1
beanbag20
LQ Newbie
 
Registered: Sep 2012
Posts: 1

Rep: Reputation: Disabled
Android Kernel: Accessing mm_struct members in module leads to restart


Hello,

I have been working on a loadable kernel module for a rooted android device which requires me to access mm_struct members.

I was using the following code to access the data in the read function:

struct task_struct* task;
struct mm_struct* test_mm;
int len;

for_each_process{
task_lock(task);
test_mm = task->mm;
len = test_mm->arg_end - test_mm->arg_start;

/* some code*/

task_unlock(task);
}

Compiling and loading does not lead to an error. However, on doing a cat /dev/my_device, the device restarts and I lose root access. I tired this iteratively by accessing just mm->arg_start and a few other mm_struct members but it still led to a restart.

My kernel version is 3.1.10 on running on Jellybean

I was wondering if there are any restrictions on accessing certain sections of the mm_struct for each process.

Since this is my first post in this forum, moderators please let me know if I should post this query someplace else.

Thanks for your help in advance.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing ip address from kernel(ver 2.6.31.13) module danjogom Linux - Kernel 2 06-22-2010 10:01 AM
kernel module/program to print the different fields of task_struct and mm_struct muskvar Programming 1 02-17-2009 09:35 AM
Accessing Linux kernel code in RAM (from a module) bthorsten Linux - Kernel 1 03-25-2008 09:02 PM
[Kernel Module] Accessing the serial port Moepi Programming 1 09-23-2007 03:51 PM
Accessing page 0 from a kernel module mjfeeney Linux - General 1 08-04-2006 12:02 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration