[Mesa-stable] Request for update of commit proposed for stable branch

Carl Worth cworth at cworth.org
Mon Jul 29 15:44:02 PDT 2013


Carl Worth <cworth at cworth.org> writes:
> I'm reviewing commits on the mesa master branch that are marked as
> candidates for the stable branch, but have not been applied yet.
>
> The patch below (da33f9b919039442e9ab51f9b1d1c83a73607133) does not
> currently apply cleanly to the 9.1 branch.
>
> If a similar patch is still needed on the stable branch, could you
> please cook up an updated patch and send it to
> mesa-stable at lists.freedesktop.org ? Or otherwise explain what you
> believe needs to be done?
>
> If I don't hear back from you, I'll assume the patch is not needed.

Hi Marek,

I looked closer at the patch and it seems that it's fairly easy to
backport to the 9.1 branch as seen below.

Meanwhile, the conflict appears to occur because the original patch
depends on this patch (which has not previously been cherry-picked to
the stable branch):

	commit 7e04227f3967fd4c4dd7a088cb42197d916925a5
	Author: Vadim Girlin <vadimgirlin at gmail.com>
	Date:   Tue Apr 2 19:32:26 2013 +0400

	    r600g: fix range handling for tgsi input declarations v2
    
	    Signed-off-by: Vadim Girlin <vadimgirlin at gmail.com>

Is the above a candidate for the stable branch? If so I can just
cherry-pick it over as well, (and then the original commit should
cherry-pick cleanly).

Thanks,

-Carl

From cc98b3bd1d7fb93bc7d1e9b4b8141bee2062807f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= <maraeo at gmail.com>
Date: Thu, 2 May 2013 05:08:08 +0200
Subject: [PATCH] r600g: increase array size for shader inputs and outputs

and add assertions to prevent buffer overflow. This fixes corruption
of the r600_shader struct.

NOTE: This is a candidate for the stable branches.
(cherry picked from commit da33f9b919039442e9ab51f9b1d1c83a73607133)

Conflicts (resolved by Carl Worth <cworth at cworth.org>):
	src/gallium/drivers/r600/r600_shader.c
---
 src/gallium/drivers/r600/r600_shader.c | 2 ++
 src/gallium/drivers/r600/r600_shader.h | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index e0fb18b..9a37916 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -862,6 +862,7 @@ static int tgsi_declaration(struct r600_shader_ctx *ctx)
 	switch (d->Declaration.File) {
 	case TGSI_FILE_INPUT:
 		i = ctx->shader->ninput++;
+                assert(i < Elements(ctx->shader->input));
 		ctx->shader->input[i].name = d->Semantic.Name;
 		ctx->shader->input[i].sid = d->Semantic.Index;
 		ctx->shader->input[i].interpolate = d->Interp.Interpolate;
@@ -888,6 +889,7 @@ static int tgsi_declaration(struct r600_shader_ctx *ctx)
 		break;
 	case TGSI_FILE_OUTPUT:
 		i = ctx->shader->noutput++;
+                assert(i < Elements(ctx->shader->output));
 		ctx->shader->output[i].name = d->Semantic.Name;
 		ctx->shader->output[i].sid = d->Semantic.Index;
 		ctx->shader->output[i].gpr = ctx->file_offset[TGSI_FILE_OUTPUT] + d->Range.First;
diff --git a/src/gallium/drivers/r600/r600_shader.h b/src/gallium/drivers/r600/r600_shader.h
index f55e002..3b918f9 100644
--- a/src/gallium/drivers/r600/r600_shader.h
+++ b/src/gallium/drivers/r600/r600_shader.h
@@ -45,8 +45,8 @@ struct r600_shader {
 	unsigned		ninput;
 	unsigned		noutput;
 	unsigned		nlds;
-	struct r600_shader_io	input[32];
-	struct r600_shader_io	output[32];
+	struct r600_shader_io	input[40];
+	struct r600_shader_io	output[40];
 	boolean			uses_kill;
 	boolean			fs_write_all;
 	boolean			two_side;
-- 
1.8.3.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-stable/attachments/20130729/3acde061/attachment.pgp>


More information about the mesa-stable mailing list