[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [BusyBox] GPLONLY symbols and BusyBox
From:       "Kevin P. Dankwardt" <k () kcomputing ! com>
Date:       2002-09-24 13:43:03
[Download RAW message or body]

GPLONLY symbols -

I just built busybox 0.60.4 and it appears that insmod works just like the insmod from
modutils.2.4.19 with respect to setting the tainted flag with non-GPL modules. It also
appears that the BusyBox insmod adds the GPLONLY prefix to EXPORT_SYMBOL_GPL exported names.
However, it appears that the BusyBox insmod does not resolve GPLONLY exported functions,
like modutils.insmod does, for GPL licensed modules.

That is, if a GPL licensed module attempts to use a GPLONLY symbol it should be resolved, if
a non-GPL module attempts to use a GPLONLY symbol it should not be resolved. The insmod from
BusyBox seems to fail to find the GPLONLY name and reports that it cannot resolve the name.

I have attached a typescript that shows the example code, compiling it, and running it.

-kevin
--
Kevin P. Dankwardt, Ph.D.
President, K Computing, Inc.  "Delivering Computing Knowledge Worldwide"
(voice) 650-961-9226
k AT kcomputing.com   http://www.kcomputing.com


["script" (text/plain)]

Script started on Tue Sep 24 13:09:01 2002
[root@kooshball gpl_drivers]# cat m_export.c
#define EXPORT_SYMTAB
#include <linux/config.h>
#if defined(CONFIG_MODVERSIONS) &&!defined(MODVERSIONS)
#define MODVERSIONS
#endif
#ifdef MODVERSIONS
#include <linux/modversions.h>
#endif
#include <linux/module.h>
#include <linux/kernel.h>
int init_module()
{
return 0;
}
void module_exit()
{}
void testmodule_print_message()
{
printk("Hello, in testmodule_print_message\n");
}
EXPORT_SYMBOL_GPL(testmodule_print_message);
MODULE_LICENSE("GPL");


[root@kooshball gpl_drivers]# cat call_gpl.c
#define EXPORT_SYMTAB
#include <linux/config.h>
#if defined(CONFIG_MODVERSIONS) &&!defined(MODVERSIONS)
#define MODVERSIONS
#endif
#ifdef MODVERSIONS
#include <linux/modversions.h>
#endif
#include <linux/module.h>
#include <linux/kernel.h>
MODULE_LICENSE("GPL");
extern void testmodule_print_message(void);
int init_module()
{
testmodule_print_message();
return 0;
}
void module_exit()
{}


[root@kooshball gpl_drivers]# cat call_non_gpl.c
#define EXPORT_SYMTAB
#include <linux/config.h>
#if defined(CONFIG_MODVERSIONS) &&!defined(MODVERSIONS)
#define MODVERSIONS
#endif
#ifdef MODVERSIONS
#include <linux/modversions.h>
#endif
#include <linux/module.h>
#include <linux/kernel.h>
extern void testmodule_print_message(void);
int init_module()
{
testmodule_print_message();
return 0;
}
void module_exit()
{}


[root@kooshball gpl_drivers]# make m_export.o
gcc -D__KERNEL__ -DMODULE -O -c m_export.c -I/usr/src/linux-2.4.18/include
[root@kooshball gpl_drivers]# make call_non_gpl.o
gcc -D__KERNEL__ -DMODULE -O -c call_non_gpl.c -I/usr/src/linux-2.4.18/include
[root@kooshballggpl_drivers]#/tmp/mu/modutils-2.4.19/insmod/insmod ./m_export.o
[root@kooshball gpl_drivers]# make call_gpl.o
gcc -D__KERNEL__ -DMODULE -O -c call_gpl.c -I/usr/src/linux-2.4.18/include
[root@kooshballggpl_drivers]#/tmp/mu/modutils-2.4.19/insmod/insmod ./call_gpl.o
[root@kooshball gpl_drivers]# lsmod
Module			Size  Used by
call_gpl		 288   0  (unused)
m_export		 432   0  [call_gpl]
[root@kooshball gpl_drivers]# uname -a
Linux kooshball 2.4.18 #6 Tue Sep 24 11:17:45 CDT 2002 i586 unknown
[root@kooshball gpl_drivers]# grep GPL /proc/ksyms
c685f074 GPLONLY_testmodule_print_message	[m_export]
A[root@kooshballggpl_drivers]#/tmp/mu/modutils-2.4.19/insmod/insmod ./call_gpl.o
pl.ooot@kooshball gpl_drivers]# /tmp/mu/modutils-2.4.19/insmod/insmod ./call_non_gl.o
./call_non_gpl.o: unresolved symbol testmodule_print_message
./call_non_gpl.o:
Hint: You are trying to load a module without a GPL compatible license
      and it has unresolved symbols.  The module may be trying to access
      GPLONLY symbols but the problem is more likely to be a coding or
      user error.  Contact the module supplier for assistance, only they
      can help you.

[root@kooshball gpl_drivers]# lsmod
Module			Size  Used by
call_gpl		 288   0  (unused)
m_export		 432   0  [call_gpl]
[root@kooshball gpl_drivers]# rmmod call_gpl
[root@kooshball gpl_drivers]# rmmod m_export
[root@kooshball gpl_drivers]# /tmp/busybox-0.60.4/busybox insmod ./call_gpl.o
Using ./call_gpl.o
insmod: unresolved symbol testmodule_print_message
[root@kooshball gpl_drivers]# /tmp/busybox-0.60.4/busybox insmod ./call_non_gpl.o
Using ./call_non_gpl.o
insmod: unresolved symbol testmodule_print_message
[root@kooshball gpl_drivers]# grep GPL /proc/ksyms
c685f074 GPLONLY_testmodule_print_message	[m_export]
[root@kooshball gpl_drivers]# rmmod m_export
[root@kooshball gpl_drivers]# grep GPL /proc/ksyms

Script done on Tue Sep 24 13:19:18 2002


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic