[Click] Trouble linking MD5 hash functions against Linux kernel module

Beyers Cronje bcronje at gmail.com
Thu Dec 6 05:51:47 EST 2007


Daniel,

You can not use userland libraries in the kernel module. The kernel includes
is own crypto api, see http://www.linuxjournal.com/article/6451

Also see include/linux/crypto.h<http://lxr.oss.org.cn/source/include/linux/crypto.h#L208>

Beyers

On Dec 6, 2007 7:19 AM, Daniel Pall <dpall at princeton.edu> wrote:

> I'm trying to compile the Linux kernel module with an additional
> element included.  That element uses MD5 hashing, so it uses function
> calls like MD5_Init, MD5_Update, and MD5_Final as defined in
> openssl/md5.h.  I'm #include'ing this file in my code, and I'm also
> trying to link with the -lssl flag in the Makefile, but it does not
> appear to be working.  Check out this failed compilation:
>
> [root at sw0.dan11.chang.emulab.net:/proj/Chang/tmp/click-1.6.0/linuxmodule
> 107 ]make
> make -C /lib/modules/2.6.19.2-1.2944.fc6.emulab-1/build
> M=/proj/Chang/tmp/click-1.6.0/linuxmodule modules
> make[1]: Entering directory `/usr/src/linux-2.6.19.2'
>  Building modules, stage 2.
>  MODPOST 2 modules
> WARNING: "MD5_Update"
> [/proj/Chang/tmp/click-1.6.0/linuxmodule/click.ko] undefined!
> WARNING: "MD5_Final"
> [/proj/Chang/tmp/click-1.6.0/linuxmodule/click.ko] undefined!
> WARNING: "MD5_Init" [/proj/Chang/tmp/click-1.6.0/linuxmodule/click.ko]
> undefined!
> make[1]: Leaving directory `/usr/src/linux-2.6.19.2'
> [root at sw0.dan11.chang.emulab.net:/proj/Chang/tmp/click-1.6.0/linuxmodule
> 108 ]
>
> So, this does make a click.ko kernel module, but it's incomplete and I
> can't insert it into the kernel, because it can't resolve these MD5
> functions (it complains about the MD5* functions as unknown symbols).
>
> Some details: I'm running Linux kernel 2.6.19.2, and on my machine,
> libssl.a is contained in /usr/lib.  I noticed in the FAQ there was a
> question that seems close to what I want to know:
> One of my elements must be linked against another library. How can I
> make userlevel Click link with that library?
>
> Basically, I want to know the answer to that question, but for the
> Linux kernel module instead of userlevel Click.  Any suggestions?
>
> Thanks for your time,
> Dan
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>


More information about the click mailing list