)]}'
{
  "commit": "1772dc0f4ae79115c905f907f27e80efbb9da19d",
  "tree": "fd82546dd5272408efe7c8e548865a80b35090b1",
  "parents": [
    "eeb7594b250df3b70bfa17058337bff482aa1301"
  ],
  "author": {
    "name": "Ming-Hung Tsai",
    "email": "mtsai@redhat.com",
    "time": "Tue Oct 22 15:13:16 2024 +0800"
  },
  "committer": {
    "name": "Michael Kochera",
    "email": "kochera@google.com",
    "time": "Mon Dec 02 01:27:57 2024 +0000"
  },
  "message": "dm cache: fix out-of-bounds access to the dirty bitset when resizing\n\ncommit 792227719725497ce10a8039803bec13f89f8910 upstream.\n\ndm-cache checks the dirty bits of the cache blocks to be dropped when\nshrinking the fast device, but an index bug in bitset iteration causes\nout-of-bounds access.\n\nReproduce steps:\n\n1. create a cache device of 1024 cache blocks (128 bytes dirty bitset)\n\ndmsetup create cmeta --table \"0 8192 linear /dev/sdc 0\"\ndmsetup create cdata --table \"0 131072 linear /dev/sdc 8192\"\ndmsetup create corig --table \"0 524288 linear /dev/sdc 262144\"\ndd if\u003d/dev/zero of\u003d/dev/mapper/cmeta bs\u003d4k count\u003d1 oflag\u003ddirect\ndmsetup create cache --table \"0 524288 cache /dev/mapper/cmeta \\\n/dev/mapper/cdata /dev/mapper/corig 128 2 metadata2 writethrough smq 0\"\n\n2. shrink the fast device to 512 cache blocks, triggering out-of-bounds\n   access to the dirty bitset (offset 0x80)\n\ndmsetup suspend cache\ndmsetup reload cdata --table \"0 65536 linear /dev/sdc 8192\"\ndmsetup resume cdata\ndmsetup resume cache\n\nKASAN reports:\n\n  BUG: KASAN: vmalloc-out-of-bounds in cache_preresume+0x269/0x7b0\n  Read of size 8 at addr ffffc900000f3080 by task dmsetup/131\n\n  (...snip...)\n  The buggy address belongs to the virtual mapping at\n   [ffffc900000f3000, ffffc900000f5000) created by:\n   cache_ctr+0x176a/0x35f0\n\n  (...snip...)\n  Memory state around the buggy address:\n   ffffc900000f2f80: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8\n   ffffc900000f3000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n  \u003effffc900000f3080: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8\n                     ^\n   ffffc900000f3100: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8\n   ffffc900000f3180: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8\n\nFix by making the index post-incremented.\n\nBUG\u003db/381394140\nTEST\u003dpresubmit\nRELEASE_NOTE\u003dFixed CVE-2024-50279 in the Linux kernel.\n\ncos-patch: security-high\nChange-Id: I528f4701a32849251badc95eac651f3b6349dcf7\nSigned-off-by: Ming-Hung Tsai \u003cmtsai@redhat.com\u003e\nFixes: f494a9c6b1b6 (\"dm cache: cache shrinking support\")\nCc: stable@vger.kernel.org\nSigned-off-by: Mikulas Patocka \u003cmpatocka@redhat.com\u003e\nAcked-by: Joe Thornber \u003cthornber@redhat.com\u003e\nSigned-off-by: Greg Kroah-Hartman \u003cgregkh@linuxfoundation.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/+/87640\nTested-by: Cusky Presubmit Bot \u003cpresubmit@cos-infra-prod.iam.gserviceaccount.com\u003e\nReviewed-by: Arnav Kansal \u003crnv@google.com\u003e\nReviewed-by: Michael Kochera \u003ckochera@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "24cd28ea2c5957a463455f870027fd0092c44b5d",
      "old_mode": 33188,
      "old_path": "drivers/md/dm-cache-target.c",
      "new_id": "b5769ea119988ded7402a1080a6d8236b2d52e44",
      "new_mode": 33188,
      "new_path": "drivers/md/dm-cache-target.c"
    }
  ]
}
