Re: (no subject)

From: Chris Wright (chrisat_private)
Date: Mon Jan 20 2003 - 14:36:18 PST

  • Next message: Stephen D. Smalley: "Re: [RFC][PATCH] Add LSM sysctl hook to 2.5.59"

    *   (phanixat_private) wrote:
    >   
    >   In the module init function, when some error happens, for example,
    >   kmalloc failed, what shall I return ? I found that when insmod a kernel
    >   module, if the module init function returns -EINVAL, the kernel collapse.
    
    If the module init function fails and returns -EINVAL, the kernel should
    not fail.  You likely have another problem.  Do you completely unwind
    the initialzation on the failure return path?  For example, if you've
    already registered the security_ops then fail and return, you will have
    bogus data left behind in the security_ops table.  In this case, any
    subsequent call to security_ops would cause trouble.
    
    In general, you need to give more debugging information to get useful
    help in debugging your problem.  Russell mentioned using UML and gdb,
    there are a couple of kernel level debuggers, and there is always printk
    (a _very_ useful tool).
    
    thanks,
    -chris
    -- 
    Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net
    _______________________________________________
    linux-security-module mailing list
    linux-security-moduleat_private
    http://mail.wirex.com/mailman/listinfo/linux-security-module
    



    This archive was generated by hypermail 2b30 : Mon Jan 20 2003 - 14:43:19 PST