LinuxQuestions.org
Visit Jeremy's Blog.
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 03-09-2009, 01:17 AM   #1
tsonnet
LQ Newbie
 
Registered: Mar 2009
Posts: 1

Rep: Reputation: 0
A question about Linux LSM (Linux Security Module)


A question about Linux LSM (Linux Security Module)

Please let me ask you a question about Linux LSM.

I inserted a couple of functions into "security_inode_rmdir",
which is provided from Linux Security Plug,
and it seems like to have a problem with NFS filesystem (NFS server side),
although it doesn't have any issue with ext2 or ext3.

When I remove one or couple of directories in the mounted
NFS filesystem, the session I was using suddenly freezes.

Then, on the NFS server side, when I execute "ls" command on
the NFS shared directory, the session suddenly freezes.


<<Environment>>
NFS Server : RHEL5 Linux Kernel 2.6.18-92.el5PAE
NFS Client : Linux (It doesn't related to Linux versions.)


<<How to reproduce the trouble>>

(NFS Client)
1. After mounting NFS filesystem on a local directory(for example, /nfs_fs),
2. "cd /nfs_fs"
3. "rmdir dir" or "rmdir dir2" will lead me to a un-answering prompt.

(NFS Server)
1. When above "session hang-up" occurs on NFS client side,
go to the NFS shared directory (for example, "cd /nfs_shared"),
2. Execute "ls -al"
3. Then, suddenly, the session freezes.


Below stack lines are what I have got from the dump file which generated on the NFS server
(especially related to "nfsd" daemon).


#7 [f13cec64] path_lookup at c047dbae
#8 [f13cec6c] re_get_fname at f8a9d4fc
#9 [f13ceef4] secure_inode_rmdir at f8a9dc9c


Above 3 lines are the codes I inserted into "security_inode_rmdir".
It seems like the cause of this hang-up trouble is related to "path_lookup" function.

When a directory is removed via NFS client on NFS shared directory,
"path_lookup("/nfs_fs", LOOKUP_FOLLOW, &nd)" is called inside my code.
The timing of session hang-up deffers everytime I execute "rmdir" command.
Sometimes it would occur at once, and sometimes it would occur at twice or three times.

Is it OK to use "path_lookup" on the occation when the filesystem is used as a NFS shared directory?

Is there anything I can investigate more to locate the cause of the problem?


========= Dump analysis ===============

alicia> bt 4790

#0 [f13cead0] schedule at c0606ff4
#1 [f13ceb40] __mutex_lock_slowpath at c0607a6e
#2 [f13ceb5c] .text.lock.mutex (via mutex_lock) at c0607aac
#3 [f13ceb68] do_lookup at c047abc2
#4 [f13ceb8c] __link_path_walk at c047c43a
#5 [f13cebe0] link_path_walk at c047cea2
#6 [f13cec48] do_path_lookup at c047d26f
#7 [f13cec64] path_lookup at c047dbae
#8 [f13cec6c] re_get_fname at f8a9d4fc
#9 [f13ceef4] secure_inode_rmdir at f8a9dc9c
#10 [f13cef04] vfs_rmdir at c047bb13
#11 [f13cef14] nfsd_unlink at f8b65e03
#12 [f13cef38] nfsd3_proc_rmdir at f8b6c9ba
#13 [f13cef58] nfsd_dispatch at f8b631a2
#14 [f13cef74] svc_process at f8acb546
#15 [f13cefb4] nfsd at f8b63687
#16 [f13cefe4] kernel_thread_helper at c0405c39

==============================================
 
Old 03-11-2009, 01:32 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,361
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
Quote:
Originally Posted by tsonnet View Post
Is it OK to use "path_lookup" on the occation when the filesystem is used as a NFS shared directory?
Is there anything I can investigate more to locate the cause of the problem?
Are you the first one to use "path_lookup" that way?
Does the kernel source show the approach others used?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
trouble registering my linux security module with the kernel nikhil86 Programming 0 03-12-2008 01:09 PM
LXer: Linux Pluggable Authentication Module (PAM) Overview: Rock Solid Security LXer Syndicated Linux News 0 09-12-2006 03:54 PM
LXer: Preventing Buffer Overflow Exploits Using the Linux Distributed Security Module, Part 1 LXer Syndicated Linux News 0 12-17-2005 06:46 AM
linux security module sonawanebhushan Linux - Wireless Networking 0 08-17-2005 12:39 AM
Implementing Object Manager in LSM ( Linux Security Module ) sina_kish Linux - Security 0 04-10-2005 04:33 AM

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

All times are GMT -5. The time now is 11:59 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration