Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • mesa mesa
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 2,694
    • Issues 2,694
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 911
    • Merge requests 911
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Mesa
  • mesamesa
  • Issues
  • #3024
Closed
Open
Created May 21, 2020 by Rafał Mikrut@qarmin

Double lock in fbobject.c

_mesa_HashInsertLocked also set lock on ctx->Shared->FrameBuffers, maybe _mesa_HashInsertUnlocked should be used?

   else if (!fb) {
      _mesa_HashLockMutex(ctx->Shared->FrameBuffers);
      fb = ctx->Driver.NewFramebuffer(ctx, id);
      if (!fb) {
         _mesa_HashUnlockMutex(ctx->Shared->FrameBuffers);
         _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", func);
         return NULL;
      }
      _mesa_HashInsertLocked(ctx->Shared->BufferObjects, id, fb);
      _mesa_HashUnlockMutex(ctx->Shared->BufferObjects);

https://gitlab.freedesktop.org/mesa/mesa/-/blob/master/src/mesa/main/fbobject.c#L182-191

also here is Coverity Scan shows double lock

      if (fb == &DummyFramebuffer) {
         fb = ctx->Driver.NewFramebuffer(ctx, framebuffer);
         _mesa_HashLockMutex(ctx->Shared->FrameBuffers);
         _mesa_HashInsert(ctx->Shared->FrameBuffers, framebuffer, fb);
         _mesa_HashUnlockMutex(ctx->Shared->BufferObjects);
      }
   }

https://gitlab.freedesktop.org/mesa/mesa/-/blob/master/src/mesa/main/fbobject.c#L4765-4770

https://cwe.mitre.org/data/definitions/764.html

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking