Exploit databaseDownload repository ZIP
GH-557a35ec88cecc5153df8ffeda95d1c2
bob11vrdp/cve-2022-39425
Sources for CVE-2022-39425
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files64
bob11vrdp/cve-2022-39425Revision 1d03f54cf1ec
- ↑..Parent directory
- Makefile.am
- Makefile.in
- Makefile.sources
- nouveau_array.c
- nouveau_array.h
- nouveau_bufferobj.c
- nouveau_bufferobj.h
- nouveau_context.c
- nouveau_context.h
- nouveau_driver.c
- nouveau_driver.h
- nouveau_fbo.c
- nouveau_fbo.h
- nouveau_gldefs.h
- nouveau_local.h
- nouveau_render.h
- nouveau_render_t.c
- nouveau_scratch.c
- nouveau_scratch.h
- nouveau_screen.c
- nouveau_screen.h
- nouveau_span.c
- nouveau_state.c
- nouveau_state.h
- nouveau_surface.c
- nouveau_surface.h
- nouveau_swtnl_t.c
- nouveau_texture.c
- nouveau_texture.h
- nouveau_util.h
- nouveau_vbo_t.c
- nv01_2d.xml.h
- nv04_3d.xml.h
- nv04_context.c
- nv04_context.h
- nv04_driver.h
- nv04_render.c
- nv04_state_fb.c
- nv04_state_frag.c
- nv04_state_raster.c
- nv04_state_tex.c
- nv04_surface.c
- nv10_3d.xml.h
- nv10_context.c
- nv10_driver.h
- nv10_render.c
- nv10_state_fb.c
- nv10_state_frag.c
- nv10_state_polygon.c
- nv10_state_raster.c
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
VirtualBox-6.1.38/src/VBox/Additions/3D/mesa/mesa-17.3.9/src/mesa/drivers/dri/nouveau/nouveau_scratch.c
C · 2,952 bytes/*
* Copyright (C) 2009-2010 Francisco Jerez.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#include "nouveau_driver.h"
#include "nouveau_context.h"
/*
* Returns a pointer to a chunk of 'size' bytes long GART memory. 'bo'
* and 'offset' will point to the returned memory.
*/
void *
nouveau_get_scratch(struct gl_context *ctx, unsigned size,
struct nouveau_bo **bo, unsigned *offset)
{
struct nouveau_client *client = context_client(ctx);
struct nouveau_scratch_state *scratch =
&to_nouveau_context(ctx)->scratch;
void *buf;
if (scratch->buf && size <= NOUVEAU_SCRATCH_SIZE - scratch->offset) {
nouveau_bo_ref(scratch->bo[scratch->index], bo);
buf = scratch->buf + scratch->offset;
*offset = scratch->offset;
scratch->offset += size;
} else if (size <= NOUVEAU_SCRATCH_SIZE) {
scratch->index = (scratch->index + 1) % NOUVEAU_SCRATCH_COUNT;
nouveau_bo_ref(scratch->bo[scratch->index], bo);
nouveau_bo_map(*bo, NOUVEAU_BO_WR, client);
buf = scratch->buf = (*bo)->map;
*offset = 0;
scratch->offset = size;
} else {
nouveau_bo_new(context_dev(ctx), NOUVEAU_BO_GART |
NOUVEAU_BO_MAP, 0, size, NULL, bo);
nouveau_bo_map(*bo, NOUVEAU_BO_WR, client);
buf = (*bo)->map;
*offset = 0;
}
return buf;
}
void
nouveau_scratch_init(struct gl_context *ctx)
{
struct nouveau_scratch_state *scratch =
&to_nouveau_context(ctx)->scratch;
int ret, i;
for (i = 0; i < NOUVEAU_SCRATCH_COUNT; i++) {
ret = nouveau_bo_new(context_dev(ctx), NOUVEAU_BO_GART |
NOUVEAU_BO_MAP, 0, NOUVEAU_SCRATCH_SIZE,
NULL, &scratch->bo[i]);
assert(!ret);
}
}
void
nouveau_scratch_destroy(struct gl_context *ctx)
{
struct nouveau_scratch_state *scratch =
&to_nouveau_context(ctx)->scratch;
int i;
for (i = 0; i < NOUVEAU_SCRATCH_COUNT; i++)
nouveau_bo_ref(NULL, &scratch->bo[i]);
}