dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] mkregtable: Fix sscanf handling
@ 2013-12-17 15:05 Alan
  0 siblings, 0 replies; only message in thread
From: Alan @ 2013-12-17 15:05 UTC (permalink / raw)
  To: trivial, dri-devel

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 <alan@linux.intel.com>
---
 drivers/gpu/drm/radeon/mkregtable.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/mkregtable.c b/drivers/gpu/drm/radeon/mkregtable.c
index af85299..4a85bb6 100644
--- a/drivers/gpu/drm/radeon/mkregtable.c
+++ b/drivers/gpu/drm/radeon/mkregtable.c
@@ -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);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-12-17 15:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-17 15:05 [PATCH RESEND] mkregtable: Fix sscanf handling Alan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).