)]}'
{
  "commit": "0458882c1f57dd1f08d10e2c6edc7accad6e17f6",
  "tree": "7498f535f8ca8016080f7a1fbae354196049df0e",
  "parents": [
    "bd3282a1cf1025c7869a8664c2d54266a4dded44"
  ],
  "author": {
    "name": "Li Bingzhuo",
    "email": "lbz2770828522@gmail.com",
    "time": "Mon Oct 05 02:34:06 2026 +0800"
  },
  "committer": {
    "name": "Li Bingzhuo",
    "email": "lbz2770828522@gmail.com",
    "time": "Wed Oct 07 23:17:10 2026 +0800"
  },
  "message": "mlx5: Fix inline SGE length wrap in set_data_inl_seg()\n\nset_data_inl_seg() accumulates the inline payload size in a 32 bit signed\nint and derives the copy length from a u32 by way of that same signed type:\n\n  int len;\n  int inl \u003d 0;\n  ...\n  len  \u003d wr-\u003esg_list[i].length - offset;\n  inl +\u003d len;\n\n  if (unlikely(inl \u003e qp-\u003emax_inline_data))\n          return ENOMEM;\n\n  ...\n  memcpy(wqe, addr, len);\n\nsg_list[].length is a u32, so a length of 0xFFFFFFFF is stored into the\nsigned \u0027len\u0027 as -1.  The bound check is written as an upper bound on the\nrunning total, so the negative value walks \u0027inl\u0027 back down instead of\ntripping it: a first SGE of length 1 sets inl to 1, and a second SGE of\nlength 0xFFFFFFFF sets inl to 0, which is below qp-\u003emax_inline_data.  A\nsingle SGE with a length above INT_MAX bypasses the check the same way,\nsince inl starts at 0.  The same wrap can be produced by a start offset\nlarger than the next SGE length, which makes \u0027len\u0027 large without any\nunusual input.\n\nThe check therefore never fires and control reaches memcpy() with \u0027len\u0027\nconverted to size_t as 0xFFFFFFFFFFFFFFFF, copying from the application\nbuffer into the send queue ring with an effectively unbounded length.\nThe ring is shared with neighbouring WQEs, so the overrun corrupts them.\n\nNeither conversion can represent a length the check would reject if the\ntypes could hold it, so give both of them the width of the value they\ncarry.  \u0027len\u0027 becomes uint32_t, matching sg_list[].length, and \u0027inl\u0027 is\nwidened to uint64_t so the accumulated total cannot wrap before it is\ncompared:\n\n  uint32_t len;\n  uint64_t inl \u003d 0;\n\nThe comparison and the accumulation keep their existing order and form.\nqp-\u003emax_inline_data is an int and is never negative, so a total above it\nis still rejected, and legitimate SGE lists that sum to exactly\nqp-\u003emax_inline_data are still accepted.\n\nFixes: 8c4791ae2395 (\"libmlx5: First version of libmlx5\")\nSigned-off-by: Li Bingzhuo \u003clbz2770828522@gmail.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b28273c83284aacf5660d5648e06095530bd5d2d",
      "old_mode": 33188,
      "old_path": "providers/mlx5/qp.c",
      "new_id": "5e32589853e02dad95c51fc2b57c6d0a1dfd4109",
      "new_mode": 33188,
      "new_path": "providers/mlx5/qp.c"
    }
  ]
}
