Re: cannot insmod owlsm.o ?

From: Seth Arnold (sarnoldat_private)
Date: Sun Apr 06 2003 - 21:01:43 PDT

  • Next message: Jonathan Heusser: "LSM kernel/user communication"

    On Mon, Apr 07, 2003 at 10:06:18AM -0400, Yale Wu wrote:
    > I'v compiled kernel 2.4.20 with LSM patched and selected LSM support.
    > After reboot with new kernel, I compiled owlsm.c "gcc -D__KERNEL__ -DMODULE -c owlsm.c".
    > It outputs owlsm.o successfully. But when I use "insmod owlsm.o", it tells me 
    > owlsm.o: unresolved symbol unregister_security
    > owlsm.o: unresolved symbol mod_reg_security
    > owlsm.o: unresolved symbol mod_unreg_security
    > owlsm.o: unresolved symbol register_security
    
    Chances are very good that if you run:
    $ grep register_security /proc/ksyms
    c016ccc0 register_security_R7df42fa6
    c016cd70 unregister_security_R1f060df4
    
    You'll see some "modversions" symbol mangling appended to the name of
    the symbols your kernel actually exports. modversions was an unfortunate
    attempt to provide a way binary modules wouldn't need to be recompiled
    as frequently. Sadly, it is completely insufficient for this purpose
    and winds up just causing problems.
    
    The easy way to solve this problem is to re-run the kernel configure
    scripts (make config, make menuconfig, make xconfig, whatever) and
    select the olwsm module for building as a module. Then, the Makefiles
    will properly handle the modversions and include paths and the like.
    Just run "make modules; sudo make modules_install" after turning on
    owlsm support, and the owlsm module should be placed in /lib/modules/
    somewhere.
    
    The hard way to solve the problem is to look at the Makefiles and
    re-create how they call GCC, so you can call GCC by hand the same way
    they do.
    
    And, if you would like to understand how modversions works, I suggest
    reading chapter 11 of the book Linux Device Drivers, 2nd edition. It is
    available for free on http://www.ora.com/, thanks to the good people at
    O'Reilly. (Buy the printed version. It is well worth the cost. :)
    
    I hope this helps.
    
    -- 
    Outlook users: please do not put my email address in your address book.
    This way, when you get infected with a virus, my address won't appear in
    the From: header. Thanks.
    
    
    

    _______________________________________________ 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 : Sun Apr 06 2003 - 21:02:03 PDT