LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 06-15-2009, 01:06 AM   #1
RepSTOSW
LQ Newbie
 
Registered: May 2009
Posts: 5

Rep: Reputation: 0
Memory paging questions.


Hi!

I have a couple of questions about the memory paging in the Linux kernel.

1) For security reasons I would like to be able to see the file name of a file being paged. In mpage_readpage(s) the page is assembled. I thought maybe I could use the address_space->inode->i_dentry somehow. It seems that the dentry-struct contains the information I'm interested in. However, the i_dentry variable in the inode is only linked list without any actual data, as far as I can see. This i_dentry variable has type struct list_head, and this only contains next- and prev-pointers and no data
Any suggestions on how to proceed? Am I on the right track here, or can I get a hold of the file name information in some other way while paging?

2) From mpage_readpage(s) (again) I get the pages assembled. I would like to be able to see if a page that is assembled is the last page of the file. Is there any way of doing this, and how in that case?

Any help much appreciated!

Best Regards
/Rita
 
Old 06-15-2009, 02:43 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,121

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Once the file is open, the name is effectively meaningless - that's what the file handle is for. The kernel devs seem quite miserly re wasting kernel storage for meaningless data.
My understanding is that (only) the last element of the filename (think basename) is in the dcache.

Reverse lookup would require knowledge of the particular filesystem structure - that's not VFS job. And would be a huge overhead.
 
  


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
Swapping vs Paging vs Virtual Memory SBN Linux - General 4 04-05-2008 09:06 AM
RH9, memory paging problems? Not physical NssOne Red Hat 3 04-23-2004 12:34 PM
virtual memory paging problem on install j_hart Linux - Software 0 10-13-2003 01:52 AM
Memory Allocation/Paging/Process Identification Kiada Linux - General 2 09-29-2003 03:57 PM
System crashing under load due to glibc memory paging error?? system Linux - General 10 02-27-2002 11:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 08:41 AM.

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