To load GPLONLY symbols its is required that CHECK_TAINTED_MODULES be

enabled, if not GPLONLY symbols are ignored.
This commit is contained in:
Glenn L McGrath 2003-09-03 00:42:58 +00:00
parent 530ea42abc
commit 759d7ececd
2 changed files with 8 additions and 4 deletions

View File

@ -119,6 +119,7 @@ config CONFIG_FEATURE_CHECK_TAINTED_MODULE
Support checking for tainted modules. These are usually binary Support checking for tainted modules. These are usually binary
only modules that will make the linux-kernel list ignore your only modules that will make the linux-kernel list ignore your
support request. support request.
This option is required to support GPLONLY modules.
endmenu endmenu

View File

@ -253,7 +253,7 @@
#ifndef MODUTILS_MODULE_H #ifndef MODUTILS_MODULE_H
static const int MODUTILS_MODULE_H = 1; static const int MODUTILS_MODULE_H = 1;
#ident "$Id: insmod.c,v 1.102 2003/08/31 01:58:18 bug1 Exp $" #ident "$Id: insmod.c,v 1.103 2003/09/03 00:42:58 bug1 Exp $"
/* This file contains the structures used by the 2.0 and 2.1 kernels. /* This file contains the structures used by the 2.0 and 2.1 kernels.
We do not use the kernel headers directly because we do not wish We do not use the kernel headers directly because we do not wish
@ -474,7 +474,7 @@ int delete_module(const char *);
#ifndef MODUTILS_OBJ_H #ifndef MODUTILS_OBJ_H
static const int MODUTILS_OBJ_H = 1; static const int MODUTILS_OBJ_H = 1;
#ident "$Id: insmod.c,v 1.102 2003/08/31 01:58:18 bug1 Exp $" #ident "$Id: insmod.c,v 1.103 2003/09/03 00:42:58 bug1 Exp $"
/* The relocatable object is manipulated using elfin types. */ /* The relocatable object is manipulated using elfin types. */
@ -1928,14 +1928,15 @@ add_symbols_from(
struct new_module_symbol *s; struct new_module_symbol *s;
size_t i; size_t i;
int used = 0; int used = 0;
int gpl;
#ifdef SYMBOL_PREFIX #ifdef SYMBOL_PREFIX
char *name_buf = 0; char *name_buf = 0;
size_t name_alloced_size = 0; size_t name_alloced_size = 0;
#endif #endif
#ifdef CONFIG_FEATURE_CHECK_TAINTED_MODULE
int gpl;
gpl = obj_gpl_license(f, NULL) == 0; gpl = obj_gpl_license(f, NULL) == 0;
#endif
for (i = 0, s = syms; i < nsyms; ++i, ++s) { for (i = 0, s = syms; i < nsyms; ++i, ++s) {
/* Only add symbols that are already marked external. /* Only add symbols that are already marked external.
If we override locals we may cause problems for If we override locals we may cause problems for
@ -1951,9 +1952,11 @@ add_symbols_from(
* their references. * their references.
*/ */
if (strncmp((char *)s->name, "GPLONLY_", 8) == 0) { if (strncmp((char *)s->name, "GPLONLY_", 8) == 0) {
#ifdef CONFIG_FEATURE_CHECK_TAINTED_MODULE
if (gpl) if (gpl)
((char *)s->name) += 8; ((char *)s->name) += 8;
else else
#endif
continue; continue;
} }
name = (char *)s->name; name = (char *)s->name;