)]}'
{
  "commit": "17e2e7d7e1b83fa324b3f099bfe426659aa3c2a4",
  "tree": "4a6718b949ac5c2e306578b02376a09d2f9542e1",
  "parents": [
    "5eed6f1dff87bfb5e545935def3843edf42800f2"
  ],
  "author": {
    "name": "Oscar Salvador",
    "email": "osalvador@suse.de",
    "time": "Fri Dec 21 14:31:00 2018 -0800"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Fri Dec 21 14:51:18 2018 -0800"
  },
  "message": "mm, page_alloc: fix has_unmovable_pages for HugePages\n\nWhile playing with gigantic hugepages and memory_hotplug, I triggered\nthe following #PF when \"cat memoryX/removable\":\n\n  BUG: unable to handle kernel NULL pointer dereference at 0000000000000008\n  #PF error: [normal kernel read fault]\n  PGD 0 P4D 0\n  Oops: 0000 [#1] SMP PTI\n  CPU: 1 PID: 1481 Comm: cat Tainted: G            E     4.20.0-rc6-mm1-1-default+ #18\n  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.0.0-prebuilt.qemu-project.org 04/01/2014\n  RIP: 0010:has_unmovable_pages+0x154/0x210\n  Call Trace:\n   is_mem_section_removable+0x7d/0x100\n   removable_show+0x90/0xb0\n   dev_attr_show+0x1c/0x50\n   sysfs_kf_seq_show+0xca/0x1b0\n   seq_read+0x133/0x380\n   __vfs_read+0x26/0x180\n   vfs_read+0x89/0x140\n   ksys_read+0x42/0x90\n   do_syscall_64+0x5b/0x180\n   entry_SYSCALL_64_after_hwframe+0x44/0xa9\n\nThe reason is we do not pass the Head to page_hstate(), and so, the call\nto compound_order() in page_hstate() returns 0, so we end up checking\nall hstates\u0027s size to match PAGE_SIZE.\n\nObviously, we do not find any hstate matching that size, and we return\nNULL.  Then, we dereference that NULL pointer in\nhugepage_migration_supported() and we got the #PF from above.\n\nFix that by getting the head page before calling page_hstate().\n\nAlso, since gigantic pages span several pageblocks, re-adjust the logic\nfor skipping pages.  While are it, we can also get rid of the\nround_up().\n\n[osalvador@suse.de: remove round_up(), adjust skip pages logic per Michal]\n  Link: http://lkml.kernel.org/r/20181221062809.31771-1-osalvador@suse.de\nLink: http://lkml.kernel.org/r/20181217225113.17864-1-osalvador@suse.de\nSigned-off-by: Oscar Salvador \u003cosalvador@suse.de\u003e\nAcked-by: Michal Hocko \u003cmhocko@suse.com\u003e\nReviewed-by: David Hildenbrand \u003cdavid@redhat.com\u003e\nCc: Vlastimil Babka \u003cvbabka@suse.cz\u003e\nCc: Pavel Tatashin \u003cpavel.tatashin@microsoft.com\u003e\nCc: Mike Rapoport \u003crppt@linux.vnet.ibm.com\u003e\nCc: \u003cstable@vger.kernel.org\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "e2afdb2dc2c548ad618f0ba634fd0e37b2e320b1",
      "old_mode": 33188,
      "old_path": "mm/page_alloc.c",
      "new_id": "e95b5b7c9c3d637efe29d07d86c75975acbfc500",
      "new_mode": 33188,
      "new_path": "mm/page_alloc.c"
    }
  ]
}
