Skip to content

Commit

Permalink
mkregtable: Fix sscanf handling
Browse files Browse the repository at this point in the history
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: Alan Cox <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
  • Loading branch information
Alan authored and Jiri Kosina committed Jan 10, 2014
1 parent bfb18d8 commit 6b64190
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/radeon/mkregtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ static int parser_auth(struct table *t, const char *filename)

/* first line will contain the last register
* 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;
last_reg = strtol(last_reg_s, NULL, 16);

Expand Down

0 comments on commit 6b64190

Please sign in to comment.