diff options
author | Timothy Arceri <[email protected]> | 2017-04-12 15:08:01 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-04-19 16:53:24 +1000 |
commit | a0ed0eb3424df32c6ef4cf01f665e24d8fc4a41b (patch) | |
tree | 2f9704479d1b0cad26db30968c43efd161a317c1 /src/mesa | |
parent | d42d150ad26e29d9e894ba9f9e28f8134e2e5393 (diff) |
mesa: add env var to force enable the KHR_no_error ctx flag
V2: typo know -> known
V3: add security check (Suggested by Nicolai)
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/context.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 8876ca2e246..984c9e00bbf 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1208,6 +1208,12 @@ _mesa_initialize_context(struct gl_context *ctx, if (!init_attrib_groups( ctx )) goto fail; + /* KHR_no_error is likely to crash, overflow memory, etc if an application + * has errors so don't enable it for setuid processes. + */ + if (getenv("MESA_NO_ERROR") && geteuid() == getuid()) + ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR; + /* setup the API dispatch tables with all nop functions */ ctx->OutsideBeginEnd = _mesa_alloc_dispatch_table(); if (!ctx->OutsideBeginEnd) |