defend against use after free with localmesh

This commit is contained in:
Beq
2026-04-01 17:38:53 +01:00
parent bfb58ecb14
commit d8ee5ef775
5 changed files with 18 additions and 14 deletions
+4 -5
View File
@@ -655,7 +655,7 @@ bool LLRenderPass::uploadMatrixPalette(LLDrawInfo& params)
}
//static
bool LLRenderPass::uploadMatrixPalette(LLVOAvatar* avatar, LLMeshSkinInfo* skinInfo)
bool LLRenderPass::uploadMatrixPalette(LLVOAvatar* avatar, const LLMeshSkinInfo* skinInfo) // <FS:Beq/> be defensive about UAF with skinInfo during LocalMesh
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
@@ -682,7 +682,7 @@ bool LLRenderPass::uploadMatrixPalette(LLVOAvatar* avatar, LLMeshSkinInfo* skinI
// Returns true if rendering should proceed
//static
bool LLRenderPass::uploadMatrixPalette(LLVOAvatar* avatar, LLMeshSkinInfo* skinInfo, const LLVOAvatar*& lastAvatar, U64& lastMeshId, bool& skipLastSkin)
bool LLRenderPass::uploadMatrixPalette(LLVOAvatar* avatar, const LLMeshSkinInfo* skinInfo, const LLVOAvatar*& lastAvatar, U64& lastMeshId, bool& skipLastSkin)// <FS:Beq/> be defensive about UAF with skinInfo during LocalMesh
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
@@ -719,7 +719,7 @@ bool LLRenderPass::uploadMatrixPalette(LLVOAvatar* avatar, LLMeshSkinInfo* skinI
// Returns true if rendering should proceed
//static
bool LLRenderPass::uploadMatrixPalette(LLVOAvatar* avatar, LLMeshSkinInfo* skinInfo, const LLVOAvatar*& lastAvatar, U64& lastMeshId, const LLGLSLShader*& lastAvatarShader, bool& skipLastSkin)
bool LLRenderPass::uploadMatrixPalette(LLVOAvatar* avatar, const LLMeshSkinInfo* skinInfo, const LLVOAvatar*& lastAvatar, U64& lastMeshId, const LLGLSLShader*& lastAvatarShader, bool& skipLastSkin)// <FS:Beq/> be defensive about UAF with skinInfo during LocalMesh
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
@@ -920,5 +920,4 @@ void LLRenderPass::pushUntexturedRiggedGLTFBatch(LLDrawInfo& params, const LLVOA
{
pushUntexturedGLTFBatch(params);
}
}
}
+8 -3
View File
@@ -387,9 +387,14 @@ public:
void pushUntexturedBatch(LLDrawInfo& params);
void pushBumpBatch(LLDrawInfo& params, bool texture, bool batch_textures = false);
static bool uploadMatrixPalette(LLDrawInfo& params);
static bool uploadMatrixPalette(LLVOAvatar* avatar, LLMeshSkinInfo* skinInfo);
static bool uploadMatrixPalette(LLVOAvatar* avatar, LLMeshSkinInfo* skinInfo, const LLVOAvatar*& lastAvatar, U64& lastMeshId, bool& skipLastSkin);
static bool uploadMatrixPalette(LLVOAvatar* avatar, LLMeshSkinInfo* skinInfo, const LLVOAvatar*& lastAvatar, U64& lastMeshId, const LLGLSLShader*& lastAvatarShader, bool& skipLastSkin);
// <FS:Beq> be defensive about UAF with skinInfo during LocalMesh
// static bool uploadMatrixPalette(LLVOAvatar* avatar, LLMeshSkinInfo* skinInfo);
// static bool uploadMatrixPalette(LLVOAvatar* avatar, LLMeshSkinInfo* skinInfo, const LLVOAvatar*& lastAvatar, U64& lastMeshId, bool& skipLastSkin);
// static bool uploadMatrixPalette(LLVOAvatar* avatar, LLMeshSkinInfo* skinInfo, const LLVOAvatar*& lastAvatar, U64& lastMeshId, const LLGLSLShader*& lastAvatarShader, bool& skipLastSkin);
// </FS:Beq>
static bool uploadMatrixPalette(LLVOAvatar* avatar, const LLMeshSkinInfo* skinInfo);
static bool uploadMatrixPalette(LLVOAvatar* avatar, const LLMeshSkinInfo* skinInfo, const LLVOAvatar*& lastAvatar, U64& lastMeshId, bool& skipLastSkin);
static bool uploadMatrixPalette(LLVOAvatar* avatar, const LLMeshSkinInfo* skinInfo, const LLVOAvatar*& lastAvatar, U64& lastMeshId, const LLGLSLShader*& lastAvatarShader, bool& skipLastSkin);
virtual void renderGroup(LLSpatialGroup* group, U32 type, bool texture = true);
virtual void renderRiggedGroup(LLSpatialGroup* group, U32 type, bool texture = true);
};
+3 -2
View File
@@ -40,6 +40,7 @@
#include "llviewertexture.h"
#include "lldrawable.h"
#include "lljoint.h"
#include "llmodel.h"// <FS:Beq/> be defensive about UAF with skinInfo during LocalMesh
class LLFacePool;
class LLVolume;
@@ -49,7 +50,7 @@ class LLVertexProgram;
class LLViewerTexture;
class LLGeometryManager;
class LLDrawInfo;
class LLMeshSkinInfo;
// class LLMeshSkinInfo;// <FS:Beq/> be defensive about UAF with skinInfo during LocalMesh
const F32 MIN_ALPHA_SIZE = 1024.f;
// <FS:minerjr>
@@ -270,7 +271,7 @@ public:
LLMatrix4* mNormalMapMatrix;
LLDrawInfo* mDrawInfo;
LLVOAvatar* mAvatar = nullptr;
LLMeshSkinInfo* mSkinInfo = nullptr;
LLConstPointer<LLMeshSkinInfo> mSkinInfo;// <FS:Beq/> be defensive about UAF with skinInfo during LocalMesh
// return mSkinInfo->mHash or 0 if mSkinInfo is null
U64 getSkinHash();
+2 -3
View File
@@ -116,7 +116,7 @@ public:
const LLMatrix4* mModelMatrix = nullptr;
LLPointer<LLVOAvatar> mAvatar = nullptr;
LLMeshSkinInfo* mSkinInfo = nullptr;
LLConstPointer<LLMeshSkinInfo> mSkinInfo;// <FS:Beq/> be defensive about UAF with skinInfo during LocalMesh
// Material pointer here is likely for debugging only and are immaterial (zing!)
LLPointer<LLMaterial> mMaterial;
@@ -772,5 +772,4 @@ extern const F32 SG_OBJ_SIDE;
extern const F32 SG_MAX_OBJ_RAD;
#endif //LL_LLSPATIALPARTITION_H
#endif //LL_LLSPATIALPARTITION_H
+1 -1
View File
@@ -6129,7 +6129,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
}
facep->setState(LLFace::RIGGED);
facep->mSkinInfo = (LLMeshSkinInfo*) skinInfo; // TODO -- fix ugly de-consting here
facep->mSkinInfo = skinInfo;// <FS:Beq/> be defensive about UAF with skinInfo during LocalMesh
facep->mAvatar = avatar;
any_rigged_face = true;
}