)]}'
{
  "commit": "ebb1db417cd16a617a8bd6198e750a47ce2fe93b",
  "tree": "f70e1b989f043d4668dbd96f41daf4cfddefabbd",
  "parents": [
    "38ad19e83a0418147afa6ac901b34c7e128df934"
  ],
  "author": {
    "name": "Yu Kuai",
    "email": "yukuai3@huawei.com",
    "time": "Tue Jun 11 21:22:51 2024 +0800"
  },
  "committer": {
    "name": "Michael Kochera",
    "email": "kochera@google.com",
    "time": "Wed Sep 11 03:25:19 2024 +0000"
  },
  "message": "md/raid5: avoid BUG_ON() while continue reshape after reassembling\n\n[ Upstream commit 305a5170dc5cf3d395bb4c4e9239bca6d0b54b49 ]\n\nCurrently, mdadm support --revert-reshape to abort the reshape while\nreassembling, as the test 07revert-grow. However, following BUG_ON()\ncan be triggerred by the test:\n\nkernel BUG at drivers/md/raid5.c:6278!\ninvalid opcode: 0000 [#1] PREEMPT SMP PTI\nirq event stamp: 158985\nCPU: 6 PID: 891 Comm: md0_reshape Not tainted 6.9.0-03335-g7592a0b0049a #94\nRIP: 0010:reshape_request+0x3f1/0xe60\nCall Trace:\n \u003cTASK\u003e\n raid5_sync_request+0x43d/0x550\n md_do_sync+0xb7a/0x2110\n md_thread+0x294/0x2b0\n kthread+0x147/0x1c0\n ret_from_fork+0x59/0x70\n ret_from_fork_asm+0x1a/0x30\n \u003c/TASK\u003e\n\nRoot cause is that --revert-reshape update the raid_disks from 5 to 4,\nwhile reshape position is still set, and after reassembling the array,\nreshape position will be read from super block, then during reshape the\nchecking of \u0027writepos\u0027 that is caculated by old reshape position will\nfail.\n\nFix this panic the easy way first, by converting the BUG_ON() to\nWARN_ON(), and stop the reshape if checkings fail.\n\nNoted that mdadm must fix --revert-shape as well, and probably md/raid\nshould enhance metadata validation as well, however this means\nreassemble will fail and there must be user tools to fix the wrong\nmetadata.\n\nBUG\u003db/365057127\nTEST\u003dpresubmit\nRELEASE_NOTE\u003dFixes CVE-2024-43914 in the Linux kernel\n\ncos-patch: security-moderate\nChange-Id: Ieac1680d44490f1625cbffd88366bcaeab3a278b\nSigned-off-by: Yu Kuai \u003cyukuai3@huawei.com\u003e\nSigned-off-by: Song Liu \u003csong@kernel.org\u003e\nLink: https://lore.kernel.org/r/20240611132251.1967786-13-yukuai1@huaweicloud.com\nSigned-off-by: Sasha Levin \u003csashal@kernel.org\u003e\nSigned-off-by: Kernel CVE Triage Automation \u003ccloud-image-kernel-cve-triage-automation@prod.google.com\u003e\nReviewed-on: https://cos-review.googlesource.com/c/third_party/kernel/+/80109\nReviewed-by: Oleksandr Tymoshenko \u003covt@google.com\u003e\nReviewed-by: Michael Kochera \u003ckochera@google.com\u003e\nTested-by: Cusky Presubmit Bot \u003cpresubmit@cos-infra-prod.iam.gserviceaccount.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "bcd43cca94f9f2dfcf44e8537271f0578b07ab32",
      "old_mode": 33188,
      "old_path": "drivers/md/raid5.c",
      "new_id": "87b713142e15de4b51294653d4da09f8ddd80873",
      "new_mode": 33188,
      "new_path": "drivers/md/raid5.c"
    }
  ]
}
