From 5826ffcc25306efa9baae0796bac44a57e243667 Mon Sep 17 00:00:00 2001 From: zrj Date: Sun, 16 Aug 2015 17:03:48 +0300 Subject: [PATCH] mkregtable: Sync script to Linux v3.14 This fixes sscanf handling vulnerability Taken-from: Linux drm/radeon/mkregtable.c --- tools/tools/drm/radeon/mkregtable/mkregtable.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/tools/tools/drm/radeon/mkregtable/mkregtable.c b/tools/tools/drm/radeon/mkregtable/mkregtable.c index ba5b1a7b78..4a85bb644e 100644 --- a/tools/tools/drm/radeon/mkregtable/mkregtable.c +++ b/tools/tools/drm/radeon/mkregtable/mkregtable.c @@ -7,8 +7,6 @@ * Authors: * Jerome Glisse * Dave Airlie - * - * $FreeBSD: head/tools/tools/drm/radeon/mkregtable/mkregtable.c 254885 2013-08-25 19:37:15Z dumbbell $ */ #include @@ -375,19 +373,6 @@ static inline void list_splice_tail_init(struct list_head *list, pos = pos->next) /** - * __list_for_each - iterate over a list - * @pos: the &struct list_head to use as a loop cursor. - * @head: the head for your list. - * - * This variant differs from list_for_each() in that it's the - * simplest possible list iteration code, no prefetching is done. - * Use this for code that knows the list to be very short (empty - * or 1 entry) most of the time. - */ -#define __list_for_each(pos, head) \ - for (pos = (head)->next; pos != (head); pos = pos->next) - -/** * list_for_each_prev - iterate over a list backwards * @pos: the &struct list_head to use as a loop cursor. * @head: the head for your list. @@ -670,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); -- 2.11.4.GIT