Skip to content

Fix memory leaks in create_resource_pool functions#63

Open
Mrcopytuo wants to merge 1 commit intoNetBSD:trunkfrom
Mrcopytuo:fix-resouce-pool
Open

Fix memory leaks in create_resource_pool functions#63
Mrcopytuo wants to merge 1 commit intoNetBSD:trunkfrom
Mrcopytuo:fix-resouce-pool

Conversation

@Mrcopytuo
Copy link

Fix missing kfree(pool) in resource pool creation paths (CVE-2019-19082)

Several resource pool creation functions were missing a kfree(pool) call when their corresponding *_construct() routines failed. In some cases, the free was placed after BREAK_TO_DEBUGGER(). This results in memory leaks on construction failure.

These issues mirror the leak pattern described in CVE-2019-19082. This patch ensures the pool is always freed properly before returning NULL.

Changes made:

  • dcn20_resource.c:

    • Move kfree(pool) before BREAK_TO_DEBUGGER().
  • dcn21_resource.c:

    • Move kfree(pool) before BREAK_TO_DEBUGGER().
  • dce80_resource.c:

    • Add missing kfree(pool) before BREAK_TO_DEBUGGER() in:
      • dce80_create_resource_pool()
      • dce81_create_resource_pool()
      • dce83_create_resource_pool()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant