)]}'
{
  "commit": "435561c0338f13871e7fbb2703b611bd0f3b0568",
  "tree": "940cda7135d2139bf4167c1adeb39b91b4a90a4e",
  "parents": [
    "997f2a6f1c0d6500f01e0199ce38e77aa52eb928"
  ],
  "author": {
    "name": "Sue Miller",
    "email": "susan.miller@hpe.com",
    "time": "Mon Nov 16 10:18:32 2026 +0000"
  },
  "committer": {
    "name": "Sue Miller",
    "email": "susan.miller@hpe.com",
    "time": "Mon Nov 16 10:18:32 2026 +0000"
  },
  "message": "mlx5: Fix NULL pointer dereference in mlx5_free_db()\n\nQPs returned by ibv_open_qp() (XRC target QPs) are allocated in\nmlx5_open_qp() with calloc() and never get a userspace doorbell\nrecord, so qp-\u003edb is NULL. When such a QP is destroyed,\nmlx5_destroy_qp() calls mlx5_free_db() with db \u003d\u003d NULL.\n\nBefore the dbrec bookkeeping was converted from a linked list to a\ncl_qmap, the lookup loop simply failed to find a matching page and\nthe function returned without doing anything:\n\n\tfor (page \u003d context-\u003edb_list; page; page \u003d page-\u003enext)\n\t\tif (((uintptr_t) db \u0026 ~(ps - 1)) \u003d\u003d (uintptr_t) page-\u003ebuf.buf)\n\t\t\tbreak;\n\n\tif (!page)\n\t\tgoto out;\n\nThe cl_qmap conversion removed that \"not found\" path. cl_qmap_get()\nreturns the map end sentinel for a NULL db, which is only checked by\nan assert(). In release builds (NDEBUG) the assert is compiled out,\ncontainer_of() turns the sentinel into a bogus page pointer, and the\nsubsequent write to page-\u003efree[] faults:\n\n\titem \u003d cl_qmap_get(\u0026context-\u003edbr_map, (uintptr_t) db \u0026 ~(ps - 1));\n\tassert(item !\u003d cl_qmap_end(\u0026context-\u003edbr_map));\n\tpage \u003d (container_of(item, struct mlx5_db_page, cl_map));\n\ti \u003d ((void *) db - page-\u003ebuf.ibv_buf.addr) / context-\u003ecache_line_size;\n\tpage-\u003efree[i / (8 * sizeof(long))] |\u003d 1UL \u003c\u003c (i % (8 * sizeof(long)));\n\nThis crashes with SIGSEGV during connection teardown of libfabric\nverbs;ofi_rxm workloads using XRC (FI_VERBS_PREFER_XRC\u003d1,\nFI_OFI_RXM_USE_SRX\u003d1), where XRC target QPs opened with ibv_open_qp()\nare destroyed on the passive side.\n\nRestore the old behaviour by returning early when db is NULL, before\ntaking the map lock.\n\nFixes: eb01f4664bf2 (\"mlx5: Optimize dbrec data structure\")\nSigned-off-by: Sue Miller \u003csusan.miller@hpe.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "ae99cd94d2d3fefed17e0ccdc2d322c479663ac8",
      "old_mode": 33188,
      "old_path": "providers/mlx5/dbrec.c",
      "new_id": "bb7d8906bc4a4c72235aaf10cea566d60222a02a",
      "new_mode": 33188,
      "new_path": "providers/mlx5/dbrec.c"
    }
  ]
}
