)]}'
{
  "commit": "4805211684efad5dff777b1e1846bc6e0aff6da4",
  "tree": "e6522e52d87f54c2c6fe8ba2ac7e5fe06bfaa576",
  "parents": [
    "35cf32831384d6088201321eadbd0e18b5350954"
  ],
  "author": {
    "name": "Dave Hansen",
    "email": "dave.hansen@linux.intel.com",
    "time": "Thu Aug 02 15:58:25 2018 -0700"
  },
  "committer": {
    "name": "Greg Kroah-Hartman",
    "email": "gregkh@linuxfoundation.org",
    "time": "Fri Aug 17 21:03:47 2018 +0200"
  },
  "message": "x86/mm/pti: Clear Global bit more aggressively\n\ncommit eac7073aa69aa1cac819aa712146284f53f642b1 upstream.\n\nThe kernel image starts out with the Global bit set across the entire\nkernel image.  The bit is cleared with set_memory_nonglobal() in the\nconfigurations with PCIDs where the performance benefits of the Global bit\nare not needed.\n\nHowever, this is fragile.  It means that we are stuck opting *out* of the\nless-secure (Global bit set) configuration, which seems backwards.  Let\u0027s\nstart more secure (Global bit clear) and then let things opt back in if\nthey want performance, or are truly mapping common data between kernel and\nuserspace.\n\nThis fixes a bug.  Before this patch, there are areas that are unmapped\nfrom the user page tables (like like everything above 0xffffffff82600000 in\nthe example below).  These have the hallmark of being a wrong Global area:\nthey are not identical in the \u0027current_kernel\u0027 and \u0027current_user\u0027 page\ntable dumps.  They are also read-write, which means they\u0027re much more\nlikely to contain secrets.\n\nBefore this patch:\n\ncurrent_kernel:---[ High Kernel Mapping ]---\ncurrent_kernel-0xffffffff80000000-0xffffffff81000000          16M                               pmd\ncurrent_kernel-0xffffffff81000000-0xffffffff81e00000          14M     ro         PSE     GLB x  pmd\ncurrent_kernel-0xffffffff81e00000-0xffffffff81e11000          68K     ro                 GLB x  pte\ncurrent_kernel-0xffffffff81e11000-0xffffffff82000000        1980K     RW                 GLB NX pte\ncurrent_kernel-0xffffffff82000000-0xffffffff82600000           6M     ro         PSE     GLB NX pmd\ncurrent_kernel-0xffffffff82600000-0xffffffff82c00000           6M     RW         PSE     GLB NX pmd\ncurrent_kernel-0xffffffff82c00000-0xffffffff82e00000           2M     RW                 GLB NX pte\ncurrent_kernel-0xffffffff82e00000-0xffffffff83200000           4M     RW         PSE     GLB NX pmd\ncurrent_kernel-0xffffffff83200000-0xffffffffa0000000         462M                               pmd\n\n current_user:---[ High Kernel Mapping ]---\n current_user-0xffffffff80000000-0xffffffff81000000          16M                               pmd\n current_user-0xffffffff81000000-0xffffffff81e00000          14M     ro         PSE     GLB x  pmd\n current_user-0xffffffff81e00000-0xffffffff81e11000          68K     ro                 GLB x  pte\n current_user-0xffffffff81e11000-0xffffffff82000000        1980K     RW                 GLB NX pte\n current_user-0xffffffff82000000-0xffffffff82600000           6M     ro         PSE     GLB NX pmd\n current_user-0xffffffff82600000-0xffffffffa0000000         474M                               pmd\n\nAfter this patch:\n\ncurrent_kernel:---[ High Kernel Mapping ]---\ncurrent_kernel-0xffffffff80000000-0xffffffff81000000          16M                               pmd\ncurrent_kernel-0xffffffff81000000-0xffffffff81e00000          14M     ro         PSE     GLB x  pmd\ncurrent_kernel-0xffffffff81e00000-0xffffffff81e11000          68K     ro                 GLB x  pte\ncurrent_kernel-0xffffffff81e11000-0xffffffff82000000        1980K     RW                     NX pte\ncurrent_kernel-0xffffffff82000000-0xffffffff82600000           6M     ro         PSE     GLB NX pmd\ncurrent_kernel-0xffffffff82600000-0xffffffff82c00000           6M     RW         PSE         NX pmd\ncurrent_kernel-0xffffffff82c00000-0xffffffff82e00000           2M     RW                     NX pte\ncurrent_kernel-0xffffffff82e00000-0xffffffff83200000           4M     RW         PSE         NX pmd\ncurrent_kernel-0xffffffff83200000-0xffffffffa0000000         462M                               pmd\n\n  current_user:---[ High Kernel Mapping ]---\n  current_user-0xffffffff80000000-0xffffffff81000000          16M                               pmd\n  current_user-0xffffffff81000000-0xffffffff81e00000          14M     ro         PSE     GLB x  pmd\n  current_user-0xffffffff81e00000-0xffffffff81e11000          68K     ro                 GLB x  pte\n  current_user-0xffffffff81e11000-0xffffffff82000000        1980K     RW                     NX pte\n  current_user-0xffffffff82000000-0xffffffff82600000           6M     ro         PSE     GLB NX pmd\n  current_user-0xffffffff82600000-0xffffffffa0000000         474M                               pmd\n\nFixes: 0f561fce4d69 (\"x86/pti: Enable global pages for shared areas\")\nReported-by: Hugh Dickins \u003chughd@google.com\u003e\nSigned-off-by: Dave Hansen \u003cdave.hansen@linux.intel.com\u003e\nSigned-off-by: Thomas Gleixner \u003ctglx@linutronix.de\u003e\nCc: keescook@google.com\nCc: aarcange@redhat.com\nCc: jgross@suse.com\nCc: jpoimboe@redhat.com\nCc: gregkh@linuxfoundation.org\nCc: peterz@infradead.org\nCc: torvalds@linux-foundation.org\nCc: bp@alien8.de\nCc: luto@kernel.org\nCc: ak@linux.intel.com\nCc: Kees Cook \u003ckeescook@google.com\u003e\nCc: Andrea Arcangeli \u003caarcange@redhat.com\u003e\nCc: Juergen Gross \u003cjgross@suse.com\u003e\nCc: Josh Poimboeuf \u003cjpoimboe@redhat.com\u003e\nCc: Greg Kroah-Hartman \u003cgregkh@linuxfoundation.org\u003e\nCc: Peter Zijlstra \u003cpeterz@infradead.org\u003e\nCc: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\nCc: Borislav Petkov \u003cbp@alien8.de\u003e\nCc: Andy Lutomirski \u003cluto@kernel.org\u003e\nCc: Andi Kleen \u003cak@linux.intel.com\u003e\nLink: https://lkml.kernel.org/r/20180802225825.A100C071@viggo.jf.intel.com\nSigned-off-by: Greg Kroah-Hartman \u003cgregkh@linuxfoundation.org\u003e\n\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7bb6f65c79de73f16165ae0d2723b77f911ba69d",
      "old_mode": 33188,
      "old_path": "arch/x86/mm/pageattr.c",
      "new_id": "29505724202acaa40de73d4c680b45cdaa225f5d",
      "new_mode": 33188,
      "new_path": "arch/x86/mm/pageattr.c"
    },
    {
      "type": "modify",
      "old_id": "fb752d9a3ce969b916df16b98019c6aac0cfe3ef",
      "old_mode": 33188,
      "old_path": "arch/x86/mm/pti.c",
      "new_id": "946455e9cfefa69f19f3c5c800c11779ed24279b",
      "new_mode": 33188,
      "new_path": "arch/x86/mm/pti.c"
    }
  ]
}
