Find the answer to your Linux question:
Results 1 to 2 of 2
Hi I'm trying to write a loadable kernel module that performs integrity checking on ELF files as part of a college project. I wrote a user-mode program for this, i.e. ...
  1. #1
    Just Joined!
    Join Date
    Mar 2008
    Location
    Mumbai
    Posts
    3

    database access thru a kernel module?

    Hi
    I'm trying to write a loadable kernel module that performs integrity checking on ELF files as part of a college project.
    I wrote a user-mode program for this, i.e. a command-line program that accepts the inode and filename of a file and performs a SHA1 on it and checks that hash against an existing ndbm database.
    I tried putting that code into a kernel module, but it won't compile.

    The basic architecture of my module is this:
    Register the LSM hook like file_mmap.
    Compute a SHA1 on that file when the hook is called
    Check it against a known database.
    Make a syslog entry if a mismatch is found.

    Can anyone tell me how i should go about the database lookup?
    Can a dbm database be accessed from the kernel? If so, how do i compile the file?
    If not a dbm database, can another simpler databse be used which is compatible with the kernel?

    I have compiled a hello-world kernel module.
    I'm stuck at the point where a dbm lookup must be made, as the #includes like ndbm.h are rejected by the compiler gcc.

  2. #2
    Just Joined!
    Join Date
    Mar 2008
    Posts
    34
    Couldn't you use Sqlite (SQLite Home Page) in embedded mode from a kernel module?

Posting Permissions

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