diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-06 12:38:07 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-06 12:38:07 -0400 |
| commit | 6f4c98e1c22c28e00b8f050cce895a6b74db15d1 (patch) | |
| tree | b00da8b3367c6f3d0f74f44b8c4092a7b7cbbe18 /scripts/mod | |
| parent | 18a1a7a1d862ae0794a0179473d08a414dd49234 (diff) | |
| parent | 22c9bcad859d5c969289b3b37084a96c621f8f2c (diff) | |
Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
Pull module updates from Rusty Russell:
"Nothing major: the stricter permissions checking for sysfs broke a
staging driver; fix included. Greg KH said he'd take the patch but
hadn't as the merge window opened, so it's included here to avoid
breaking build"
* tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
staging: fix up speakup kobject mode
Use 'E' instead of 'X' for unsigned module taint flag.
VERIFY_OCTAL_PERMISSIONS: stricter checking for sysfs perms.
kallsyms: fix percpu vars on x86-64 with relocation.
kallsyms: generalize address range checking
module: LLVMLinux: Remove unused function warning from __param_check macro
Fix: module signature vs tracepoints: add new TAINT_UNSIGNED_MODULE
module: remove MODULE_GENERIC_TABLE
module: allow multiple calls to MODULE_DEVICE_TABLE() per module
module: use pr_cont
Diffstat (limited to 'scripts/mod')
| -rw-r--r-- | scripts/mod/file2alias.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 25f6f5970552..1924990a737f 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
| @@ -42,7 +42,7 @@ typedef unsigned char __u8; | |||
| 42 | 42 | ||
| 43 | /* This array collects all instances that use the generic do_table */ | 43 | /* This array collects all instances that use the generic do_table */ |
| 44 | struct devtable { | 44 | struct devtable { |
| 45 | const char *device_id; /* name of table, __mod_<name>_device_table. */ | 45 | const char *device_id; /* name of table, __mod_<name>__*_device_table. */ |
| 46 | unsigned long id_size; | 46 | unsigned long id_size; |
| 47 | void *function; | 47 | void *function; |
| 48 | }; | 48 | }; |
| @@ -146,7 +146,8 @@ static void device_id_check(const char *modname, const char *device_id, | |||
| 146 | 146 | ||
| 147 | if (size % id_size || size < id_size) { | 147 | if (size % id_size || size < id_size) { |
| 148 | fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo " | 148 | fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo " |
| 149 | "of the size of section __mod_%s_device_table=%lu.\n" | 149 | "of the size of " |
| 150 | "section __mod_%s__<identifier>_device_table=%lu.\n" | ||
| 150 | "Fix definition of struct %s_device_id " | 151 | "Fix definition of struct %s_device_id " |
| 151 | "in mod_devicetable.h\n", | 152 | "in mod_devicetable.h\n", |
| 152 | modname, device_id, id_size, device_id, size, device_id); | 153 | modname, device_id, id_size, device_id, size, device_id); |
| @@ -1216,7 +1217,7 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, | |||
| 1216 | { | 1217 | { |
| 1217 | void *symval; | 1218 | void *symval; |
| 1218 | char *zeros = NULL; | 1219 | char *zeros = NULL; |
| 1219 | const char *name; | 1220 | const char *name, *identifier; |
| 1220 | unsigned int namelen; | 1221 | unsigned int namelen; |
| 1221 | 1222 | ||
| 1222 | /* We're looking for a section relative symbol */ | 1223 | /* We're looking for a section relative symbol */ |
| @@ -1227,7 +1228,7 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, | |||
| 1227 | if (ELF_ST_TYPE(sym->st_info) != STT_OBJECT) | 1228 | if (ELF_ST_TYPE(sym->st_info) != STT_OBJECT) |
| 1228 | return; | 1229 | return; |
| 1229 | 1230 | ||
| 1230 | /* All our symbols are of form <prefix>__mod_XXX_device_table. */ | 1231 | /* All our symbols are of form <prefix>__mod_<name>__<identifier>_device_table. */ |
| 1231 | name = strstr(symname, "__mod_"); | 1232 | name = strstr(symname, "__mod_"); |
| 1232 | if (!name) | 1233 | if (!name) |
| 1233 | return; | 1234 | return; |
| @@ -1237,7 +1238,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, | |||
| 1237 | return; | 1238 | return; |
| 1238 | if (strcmp(name + namelen - strlen("_device_table"), "_device_table")) | 1239 | if (strcmp(name + namelen - strlen("_device_table"), "_device_table")) |
| 1239 | return; | 1240 | return; |
| 1240 | namelen -= strlen("_device_table"); | 1241 | identifier = strstr(name, "__"); |
| 1242 | if (!identifier) | ||
| 1243 | return; | ||
| 1244 | namelen = identifier - name; | ||
| 1241 | 1245 | ||
| 1242 | /* Handle all-NULL symbols allocated into .bss */ | 1246 | /* Handle all-NULL symbols allocated into .bss */ |
| 1243 | if (info->sechdrs[get_secindex(info, sym)].sh_type & SHT_NOBITS) { | 1247 | if (info->sechdrs[get_secindex(info, sym)].sh_type & SHT_NOBITS) { |
