Skip to content
Snippets Groups Projects
Commit 6b641900 authored by Alan's avatar Alan Committed by Jiri Kosina
Browse files

mkregtable: Fix sscanf handling


If you feed the tool a suitable bogus register map you can break it
in arbitary (code executing) ways. While this isn't a particularly
exciting or probable attack vector we still ought to fix it.

One of a set of sscanf issues reported by Jackie Chang

Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent bfb18d82
No related branches found
No related tags found
No related merge requests found
...@@ -655,7 +655,7 @@ static int parser_auth(struct table *t, const char *filename) ...@@ -655,7 +655,7 @@ static int parser_auth(struct table *t, const char *filename)
/* first line will contain the last register /* first line will contain the last register
* and gpu name */ * and gpu name */
sscanf(buf, "%s %s", gpu_name, last_reg_s); sscanf(buf, "%9s %9s", gpu_name, last_reg_s);
t->gpu_prefix = gpu_name; t->gpu_prefix = gpu_name;
last_reg = strtol(last_reg_s, NULL, 16); last_reg = strtol(last_reg_s, NULL, 16);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment