Results 1 to 1 of 1

Thread: A LSM(linux security modules) question,terribly need help...

  1. #1
    Just burned his ISO
    Join Date
    Jun 2010

    Default A LSM(linux security modules) question,terribly need help...

    Yes,i know ask this question here is a little unseasonable,but i think someone here might give me the answer.
    I wanna write a simple filesystem interception program baesd on the LSM,just have some function like could not add a file to a directory and so on.Somebody told me use the LSM,but as a fact that i actually can not find useful information on how to write a LSM module.
    So i consult the selinux code which is in the kernel.Then i write a very simple kernel module below:

    #include <linux/kernel.h>
    #include <linux/init.h>
    #include <linux/security.h>
    struct security_operations ops;
    int flag;
    static int my_not_rename(struct inode *old_inode, struct dentry *old_dentry,
                                    struct inode *new_inode, struct dentry *new_dentry)
        return 0;
    static int __init mylsm_init(void)
        int flag;
        ops.inode_rename = my_not_rename;
        flag = register_security(&ops);
        if(flag != 0)
        return 0;
    static void __exit mylsm_exit(void)
    Ok i actually do not know if the my module can be insmod to the kernel then what will happen,but in fact it could not insmod into because of a make Warning "WARNING: "register_security" [xxxxxxxxxxxxxx.ko] undefined!".

    I found a guy have a same problem:Compile and install modules without kernel recompile.

    It seems that the register_security() is not an exported kernel symbol...

    Well,the register_security() cant use,now how i can finish my module based on the LSM.
    I ask some other place but no people give me a answer.
    As backtrack still could not true running on my computer because of my network adapter don't like she,but i hope somebody here can help me on my problem,thanks a lot and a lot.
    Last edited by Archangel-Amael; 07-08-2010 at 07:28 PM. Reason: Added code tags for clarity.

Similar Threads

  1. Moral security Question
    By alias1 in forum OLD General IT Discussion
    Replies: 17
    Last Post: 01-04-2010, 03:04 PM
  2. vmware server modules patched for linux-2.6.32-rc4.
    By drgr33n in forum OLD BackTrack 4 Software Related Issues
    Replies: 3
    Last Post: 11-06-2009, 02:47 PM
  3. Help with security certifications? Hard Question
    By Rifts in forum OLD Newbie Area
    Replies: 3
    Last Post: 10-14-2008, 09:08 PM
  4. Replies: 8
    Last Post: 07-18-2008, 01:55 PM
  5. terribly nuby question
    By trigpin in forum OLD Newbie Area
    Replies: 4
    Last Post: 06-29-2008, 04:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts