summaryrefslogtreecommitdiffstats
path: root/scripts/mod/file2alias.c
diff options
context:
space:
mode:
authorMattias Jacobsson <2pi@mok.nu>2019-02-07 07:30:22 -0500
committerDarren Hart (VMware) <dvhart@infradead.org>2019-03-07 02:12:34 -0500
commit841f1b8fb4ca5e296e0ecb2b13f2a679d912ec4d (patch)
tree4536ed1e2389b5074dc9fb866a339a60184428de /scripts/mod/file2alias.c
parentb98dc493e7e17dbc63f4c3f37040e0175a49bb18 (diff)
modpost: file2alias: define size of alias
The size of the variable alias provided to do_entry functions are currently not readily available. Thus hindering do_entry functions to perform bounds checking. Define the macro ALIAS_SIZE containing the size of the variable alias. Signed-off-by: Mattias Jacobsson <2pi@mok.nu> Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
Diffstat (limited to 'scripts/mod/file2alias.c')
-rw-r--r--scripts/mod/file2alias.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index a37af7d71973..afe22af20d7d 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -50,6 +50,9 @@ struct devtable {
50 int (*do_entry)(const char *filename, void *symval, char *alias); 50 int (*do_entry)(const char *filename, void *symval, char *alias);
51}; 51};
52 52
53/* Size of alias provided to do_entry functions */
54#define ALIAS_SIZE 500
55
53/* Define a variable f that holds the value of field f of struct devid 56/* Define a variable f that holds the value of field f of struct devid
54 * based at address m. 57 * based at address m.
55 */ 58 */
@@ -1303,7 +1306,7 @@ static void do_table(void *symval, unsigned long size,
1303 struct module *mod) 1306 struct module *mod)
1304{ 1307{
1305 unsigned int i; 1308 unsigned int i;
1306 char alias[500]; 1309 char alias[ALIAS_SIZE];
1307 1310
1308 device_id_check(mod->name, device_id, size, id_size, symval); 1311 device_id_check(mod->name, device_id, size, id_size, symval);
1309 /* Leave last one: it's the terminator. */ 1312 /* Leave last one: it's the terminator. */