)]}'
{
  "commit": "8f7b7e0bd3c6dd83c2795a25985bc60cfd3bdac1",
  "tree": "6dbe21061b0b677ee98e7fef9957c341e1daf66e",
  "parents": [
    "e8c3aced75bd8803f62ead25941fd68302f9efcb"
  ],
  "author": {
    "name": "Sean Christopherson",
    "email": "sean.j.christopherson@intel.com",
    "time": "Fri Aug 17 10:27:36 2018 -0700"
  },
  "committer": {
    "name": "Greg Kroah-Hartman",
    "email": "gregkh@linuxfoundation.org",
    "time": "Sat Aug 18 10:49:36 2018 +0200"
  },
  "message": "x86/speculation/l1tf: Exempt zeroed PTEs from inversion\n\ncommit f19f5c49bbc3ffcc9126cc245fc1b24cc29f4a37 upstream.\n\nIt turns out that we should *not* invert all not-present mappings,\nbecause the all zeroes case is obviously special.\n\nclear_page() does not undergo the XOR logic to invert the address bits,\ni.e. PTE, PMD and PUD entries that have not been individually written\nwill have val\u003d0 and so will trigger __pte_needs_invert(). As a result,\n{pte,pmd,pud}_pfn() will return the wrong PFN value, i.e. all ones\n(adjusted by the max PFN mask) instead of zero. A zeroed entry is ok\nbecause the page at physical address 0 is reserved early in boot\nspecifically to mitigate L1TF, so explicitly exempt them from the\ninversion when reading the PFN.\n\nManifested as an unexpected mprotect(..., PROT_NONE) failure when called\non a VMA that has VM_PFNMAP and was mmap\u0027d to as something other than\nPROT_NONE but never used. mprotect() sends the PROT_NONE request down\nprot_none_walk(), which walks the PTEs to check the PFNs.\nprot_none_pte_entry() gets the bogus PFN from pte_pfn() and returns\n-EACCES because it thinks mprotect() is trying to adjust a high MMIO\naddress.\n\n[ This is a very modified version of Sean\u0027s original patch, but all\n  credit goes to Sean for doing this and also pointing out that\n  sometimes the __pte_needs_invert() function only gets the protection\n  bits, not the full eventual pte.  But zero remains special even in\n  just protection bits, so that\u0027s ok.   - Linus ]\n\nFixes: f22cc87f6c1f (\"x86/speculation/l1tf: Invert all not present mappings\")\nSigned-off-by: Sean Christopherson \u003csean.j.christopherson@intel.com\u003e\nAcked-by: Andi Kleen \u003cak@linux.intel.com\u003e\nCc: Thomas Gleixner \u003ctglx@linutronix.de\u003e\nCc: Josh Poimboeuf \u003cjpoimboe@redhat.com\u003e\nCc: Michal Hocko \u003cmhocko@suse.com\u003e\nCc: Vlastimil Babka \u003cvbabka@suse.cz\u003e\nCc: Dave Hansen \u003cdave.hansen@intel.com\u003e\nCc: Greg Kroah-Hartman \u003cgregkh@linuxfoundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\nSigned-off-by: Greg Kroah-Hartman \u003cgregkh@linuxfoundation.org\u003e\n\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "44b1203ece12abb31f0b782b7219f61eb8045ae6",
      "old_mode": 33188,
      "old_path": "arch/x86/include/asm/pgtable-invert.h",
      "new_id": "a0c1525f1b6f417448bebb5898a48b71f5b86c0d",
      "new_mode": 33188,
      "new_path": "arch/x86/include/asm/pgtable-invert.h"
    }
  ]
}
