2010-02-20 18:49:47

by Chris Nicholson

[permalink] [raw]
Subject: [PATCH] Gpu: drm: fix buffer overflow in nouveau_bios.c

From: Chris Nicholson <[email protected]>

This is a patch to the nouveau_bios.c file that fixes up a
buffer overflow

Signed-off-by: Chris Nicholson <[email protected]>
---
drivers/gpu/drm/nouveau/nouveau_bios.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
index 0e9cd1d..c1cee91 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
@@ -762,7 +762,7 @@ static uint32_t get_tmds_index_reg(struct drm_device *dev, uint8_t mlv)
dacoffset ^= 8;
return 0x6808b0 + dacoffset;
} else {
- if (mlv > ARRAY_SIZE(pramdac_table)) {
+ if (mlv >= ARRAY_SIZE(pramdac_table)) {
NV_ERROR(dev, "Magic Lookup Value too big (%02X)\n",
mlv);
return 0;
--
1.6.6


2010-02-20 19:52:28

by Francisco Jerez

[permalink] [raw]
Subject: Re: [PATCH] Gpu: drm: fix buffer overflow in nouveau_bios.c

[email protected] writes:

> From: Chris Nicholson <[email protected]>
>
> This is a patch to the nouveau_bios.c file that fixes up a
> buffer overflow
>
This bug was already fixed upstream (774baeb0ba92bcb082f9868726a27a015c9a0897).
In any case, thank you.

> Signed-off-by: Chris Nicholson <[email protected]>
> ---
> drivers/gpu/drm/nouveau/nouveau_bios.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
> index 0e9cd1d..c1cee91 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_bios.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
> @@ -762,7 +762,7 @@ static uint32_t get_tmds_index_reg(struct drm_device *dev, uint8_t mlv)
> dacoffset ^= 8;
> return 0x6808b0 + dacoffset;
> } else {
> - if (mlv > ARRAY_SIZE(pramdac_table)) {
> + if (mlv >= ARRAY_SIZE(pramdac_table)) {
> NV_ERROR(dev, "Magic Lookup Value too big (%02X)\n",
> mlv);
> return 0;


Attachments:
(No filename) (0.99 kB)
(No filename) (197.00 B)
Download all attachments