diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2003-09-03 00:42:58 +0000 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2003-09-03 00:42:58 +0000 |
commit | 759d7ececd56e5b25bbfcc54a04bf939d80c7ee9 (patch) | |
tree | 90d9424d63ee5b3b9696b1f099e3bf5b43d1b2fa | |
parent | 530ea42abc7512bcd9738a4fcef7d97c2039f82a (diff) | |
download | busybox-w32-759d7ececd56e5b25bbfcc54a04bf939d80c7ee9.tar.gz busybox-w32-759d7ececd56e5b25bbfcc54a04bf939d80c7ee9.tar.bz2 busybox-w32-759d7ececd56e5b25bbfcc54a04bf939d80c7ee9.zip |
To load GPLONLY symbols its is required that CHECK_TAINTED_MODULES be
enabled, if not GPLONLY symbols are ignored.
-rw-r--r-- | modutils/Config.in | 1 | ||||
-rw-r--r-- | modutils/insmod.c | 11 |
2 files changed, 8 insertions, 4 deletions
diff --git a/modutils/Config.in b/modutils/Config.in index 71298bbff..96040cd69 100644 --- a/modutils/Config.in +++ b/modutils/Config.in | |||
@@ -119,6 +119,7 @@ config CONFIG_FEATURE_CHECK_TAINTED_MODULE | |||
119 | Support checking for tainted modules. These are usually binary | 119 | Support checking for tainted modules. These are usually binary |
120 | only modules that will make the linux-kernel list ignore your | 120 | only modules that will make the linux-kernel list ignore your |
121 | support request. | 121 | support request. |
122 | This option is required to support GPLONLY modules. | ||
122 | 123 | ||
123 | 124 | ||
124 | endmenu | 125 | endmenu |
diff --git a/modutils/insmod.c b/modutils/insmod.c index 54463a9d0..a6afcecea 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c | |||
@@ -253,7 +253,7 @@ | |||
253 | #ifndef MODUTILS_MODULE_H | 253 | #ifndef MODUTILS_MODULE_H |
254 | static const int MODUTILS_MODULE_H = 1; | 254 | static const int MODUTILS_MODULE_H = 1; |
255 | 255 | ||
256 | #ident "$Id: insmod.c,v 1.102 2003/08/31 01:58:18 bug1 Exp $" | 256 | #ident "$Id: insmod.c,v 1.103 2003/09/03 00:42:58 bug1 Exp $" |
257 | 257 | ||
258 | /* This file contains the structures used by the 2.0 and 2.1 kernels. | 258 | /* This file contains the structures used by the 2.0 and 2.1 kernels. |
259 | We do not use the kernel headers directly because we do not wish | 259 | We do not use the kernel headers directly because we do not wish |
@@ -474,7 +474,7 @@ int delete_module(const char *); | |||
474 | #ifndef MODUTILS_OBJ_H | 474 | #ifndef MODUTILS_OBJ_H |
475 | static const int MODUTILS_OBJ_H = 1; | 475 | static const int MODUTILS_OBJ_H = 1; |
476 | 476 | ||
477 | #ident "$Id: insmod.c,v 1.102 2003/08/31 01:58:18 bug1 Exp $" | 477 | #ident "$Id: insmod.c,v 1.103 2003/09/03 00:42:58 bug1 Exp $" |
478 | 478 | ||
479 | /* The relocatable object is manipulated using elfin types. */ | 479 | /* The relocatable object is manipulated using elfin types. */ |
480 | 480 | ||
@@ -1928,14 +1928,15 @@ add_symbols_from( | |||
1928 | struct new_module_symbol *s; | 1928 | struct new_module_symbol *s; |
1929 | size_t i; | 1929 | size_t i; |
1930 | int used = 0; | 1930 | int used = 0; |
1931 | int gpl; | ||
1932 | #ifdef SYMBOL_PREFIX | 1931 | #ifdef SYMBOL_PREFIX |
1933 | char *name_buf = 0; | 1932 | char *name_buf = 0; |
1934 | size_t name_alloced_size = 0; | 1933 | size_t name_alloced_size = 0; |
1935 | #endif | 1934 | #endif |
1935 | #ifdef CONFIG_FEATURE_CHECK_TAINTED_MODULE | ||
1936 | int gpl; | ||
1936 | 1937 | ||
1937 | gpl = obj_gpl_license(f, NULL) == 0; | 1938 | gpl = obj_gpl_license(f, NULL) == 0; |
1938 | 1939 | #endif | |
1939 | for (i = 0, s = syms; i < nsyms; ++i, ++s) { | 1940 | for (i = 0, s = syms; i < nsyms; ++i, ++s) { |
1940 | /* Only add symbols that are already marked external. | 1941 | /* Only add symbols that are already marked external. |
1941 | If we override locals we may cause problems for | 1942 | If we override locals we may cause problems for |
@@ -1951,9 +1952,11 @@ add_symbols_from( | |||
1951 | * their references. | 1952 | * their references. |
1952 | */ | 1953 | */ |
1953 | if (strncmp((char *)s->name, "GPLONLY_", 8) == 0) { | 1954 | if (strncmp((char *)s->name, "GPLONLY_", 8) == 0) { |
1955 | #ifdef CONFIG_FEATURE_CHECK_TAINTED_MODULE | ||
1954 | if (gpl) | 1956 | if (gpl) |
1955 | ((char *)s->name) += 8; | 1957 | ((char *)s->name) += 8; |
1956 | else | 1958 | else |
1959 | #endif | ||
1957 | continue; | 1960 | continue; |
1958 | } | 1961 | } |
1959 | name = (char *)s->name; | 1962 | name = (char *)s->name; |