22 Jan, 2018

1 commit

  • Pull x86 pti fixes from Thomas Gleixner:
    "A small set of fixes for the meltdown/spectre mitigations:

    - Make kprobes aware of retpolines to prevent probes in the retpoline
    thunks.

    - Make the machine check exception speculation protected. MCE used to
    issue an indirect call directly from the ASM entry code. Convert
    that to a direct call into a C-function and issue the indirect call
    from there so the compiler can add the retpoline protection,

    - Make the vmexit_fill_RSB() assembly less stupid

    - Fix a typo in the PTI documentation"

    * 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/retpoline: Optimize inline assembler for vmexit_fill_RSB
    x86/pti: Document fix wrong index
    kprobes/x86: Disable optimizing on the function jumps to indirect thunk
    kprobes/x86: Blacklist indirect thunk functions for kprobes
    retpoline: Introduce start/end markers of indirect thunk
    x86/mce: Make machine check speculation protected

    Linus Torvalds
     

19 Jan, 2018

2 commits

  • In section , fix wrong index.

    Signed-off-by: zhenwei.pi
    Signed-off-by: Thomas Gleixner
    Cc: dave.hansen@linux.intel.com
    Link: https://lkml.kernel.org/r/1516237492-27739-1-git-send-email-zhenwei.pi@youruncloud.com

    zhenwei.pi
     
  • This adds a new ioctl, KVM_PPC_GET_CPU_CHAR, that gives userspace
    information about the underlying machine's level of vulnerability
    to the recently announced vulnerabilities CVE-2017-5715,
    CVE-2017-5753 and CVE-2017-5754, and whether the machine provides
    instructions to assist software to work around the vulnerabilities.

    The ioctl returns two u64 words describing characteristics of the
    CPU and required software behaviour respectively, plus two mask
    words which indicate which bits have been filled in by the kernel,
    for extensibility. The bit definitions are the same as for the
    new H_GET_CPU_CHARACTERISTICS hypercall.

    There is also a new capability, KVM_CAP_PPC_GET_CPU_CHAR, which
    indicates whether the new ioctl is available.

    Signed-off-by: Paul Mackerras

    Paul Mackerras
     

15 Jan, 2018

1 commit

  • Pull x86 pti updates from Thomas Gleixner:
    "This contains:

    - a PTI bugfix to avoid setting reserved CR3 bits when PCID is
    disabled. This seems to cause issues on a virtual machine at least
    and is incorrect according to the AMD manual.

    - a PTI bugfix which disables the perf BTS facility if PTI is
    enabled. The BTS AUX buffer is not globally visible and causes the
    CPU to fault when the mapping disappears on switching CR3 to user
    space. A full fix which restores BTS on PTI is non trivial and will
    be worked on.

    - PTI bugfixes for EFI and trusted boot which make sure that the user
    space visible page table entries have the NX bit cleared

    - removal of dead code in the PTI pagetable setup functions

    - add PTI documentation

    - add a selftest for vsyscall to verify that the kernel actually
    implements what it advertises.

    - a sysfs interface to expose vulnerability and mitigation
    information so there is a coherent way for users to retrieve the
    status.

    - the initial spectre_v2 mitigations, aka retpoline:

    + The necessary ASM thunk and compiler support

    + The ASM variants of retpoline and the conversion of affected ASM
    code

    + Make LFENCE serializing on AMD so it can be used as speculation
    trap

    + The RSB fill after vmexit

    - initial objtool support for retpoline

    As I said in the status mail this is the most of the set of patches
    which should go into 4.15 except two straight forward patches still on
    hold:

    - the retpoline add on of LFENCE which waits for ACKs

    - the RSB fill after context switch

    Both should be ready to go early next week and with that we'll have
    covered the major holes of spectre_v2 and go back to normality"

    * 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (28 commits)
    x86,perf: Disable intel_bts when PTI
    security/Kconfig: Correct the Documentation reference for PTI
    x86/pti: Fix !PCID and sanitize defines
    selftests/x86: Add test_vsyscall
    x86/retpoline: Fill return stack buffer on vmexit
    x86/retpoline/irq32: Convert assembler indirect jumps
    x86/retpoline/checksum32: Convert assembler indirect jumps
    x86/retpoline/xen: Convert Xen hypercall indirect jumps
    x86/retpoline/hyperv: Convert assembler indirect jumps
    x86/retpoline/ftrace: Convert ftrace assembler indirect jumps
    x86/retpoline/entry: Convert entry assembler indirect jumps
    x86/retpoline/crypto: Convert crypto assembler indirect jumps
    x86/spectre: Add boot time option to select Spectre v2 mitigation
    x86/retpoline: Add initial retpoline support
    objtool: Allow alternatives to be ignored
    objtool: Detect jumps to retpoline thunks
    x86/pti: Make unpoison of pgd for trusted boot work for real
    x86/alternatives: Fix optimize_nops() checking
    sysfs/cpu: Fix typos in vulnerability documentation
    x86/cpu/AMD: Use LFENCE_RDTSC in preference to MFENCE_RDTSC
    ...

    Linus Torvalds
     

14 Jan, 2018

5 commits

  • Pull USB fixes from Greg KH:
    "Here are some small USB fixes and device ids for 4.15-rc8

    Nothing major, small fixes for various devices, some resolutions for
    bugs found by fuzzers, and the usual handful of new device ids.

    All of these have been in linux-next with no reported issues"

    * tag 'usb-4.15-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
    Documentation: usb: fix typo in UVC gadgetfs config command
    usb: misc: usb3503: make sure reset is low for at least 100us
    uas: ignore UAS for Norelsys NS1068(X) chips
    USB: UDC core: fix double-free in usb_add_gadget_udc_release
    USB: fix usbmon BUG trigger
    usbip: vudc_tx: fix v_send_ret_submit() vulnerability to null xfer buffer
    usbip: remove kernel addresses from usb device and urb debug msgs
    usbip: fix vudc_rx: harden CMD_SUBMIT path to handle malicious input
    USB: serial: cp210x: add new device ID ELV ALC 8xxx
    USB: serial: cp210x: add IDs for LifeScan OneTouch Verio IQ

    Linus Torvalds
     
  • …masahiroy/linux-kbuild

    Pull Kbuild fixes from Masahiro Yamada:

    - fix cross-compilation for architectures that setup CROSS_COMPILE in
    their arch Makefile

    - fix Kconfig rational operators for bool / tristate

    - drop a gperf-generated file from .gitignore

    * tag 'kbuild-fixes-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
    genksyms: drop *.hash.c from .gitignore
    kconfig: fix relational operators for bool and tristate symbols
    kbuild: move cc-option and cc-disable-warning after incl. arch Makefile

    Linus Torvalds
     
  • Pull PCI fixes from Bjorn Helgaas:
    "Fix AMD boot regression due to 64-bit window conflicting with system
    memory (Christian König)"

    * tag 'pci-v4.15-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
    x86/PCI: Move and shrink AMD 64-bit window to avoid conflict
    x86/PCI: Add "pci=big_root_window" option for AMD 64-bit windows

    Linus Torvalds
     
  • Merge misc fixlets from Andrew Morton:
    "4 fixes"

    * emailed patches from Andrew Morton :
    tools/objtool/Makefile: don't assume sync-check.sh is executable
    kdump: write correct address of mem_section into vmcoreinfo
    kmemleak: allow to coexist with fault injection
    MAINTAINERS, nilfs2: change project home URLs

    Linus Torvalds
     
  • The domain of NILFS project home was changed to "nilfs.sourceforge.io"
    to enable https access (the previous domain "nilfs.sourceforge.net" is
    redirected to the new one). Modify URLs of the project home to reflect
    this change and to replace their protocol from http to https.

    Link: http://lkml.kernel.org/r/1515416141-5614-1-git-send-email-konishi.ryusuke@lab.ntt.co.jp
    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     

13 Jan, 2018

1 commit


12 Jan, 2018

3 commits

  • Add a spectre_v2= option to select the mitigation used for the indirect
    branch speculation vulnerability.

    Currently, the only option available is retpoline, in its various forms.
    This will be expanded to cover the new IBRS/IBPB microcode features.

    The RETPOLINE_AMD feature relies on a serializing LFENCE for speculation
    control. For AMD hardware, only set RETPOLINE_AMD if LFENCE is a
    serializing instruction, which is indicated by the LFENCE_RDTSC feature.

    [ tglx: Folded back the LFENCE/AMD fixes and reworked it so IBRS
    integration becomes simple ]

    Signed-off-by: David Woodhouse
    Signed-off-by: Thomas Gleixner
    Cc: gnomes@lxorguk.ukuu.org.uk
    Cc: Rik van Riel
    Cc: Andi Kleen
    Cc: Josh Poimboeuf
    Cc: thomas.lendacky@amd.com
    Cc: Peter Zijlstra
    Cc: Linus Torvalds
    Cc: Jiri Kosina
    Cc: Andy Lutomirski
    Cc: Dave Hansen
    Cc: Kees Cook
    Cc: Tim Chen
    Cc: Greg Kroah-Hartman
    Cc: Paul Turner
    Link: https://lkml.kernel.org/r/1515707194-20531-5-git-send-email-dwmw@amazon.co.uk

    David Woodhouse
     
  • This seems to be a copy&paste error. With the fix the uvc gadget now can
    be created by following the instrucitons.

    Signed-off-by: Bin Liu
    Signed-off-by: Greg Kroah-Hartman

    Bin Liu
     
  • Only try to enable a 64-bit window on AMD CPUs when "pci=big_root_window"
    is specified.

    This taints the kernel because the new 64-bit window uses address space we
    don't know anything about, and it may contain unreported devices or memory
    that would conflict with the window.

    The pci_amd_enable_64bit_bar() quirk that enables the window is specific to
    AMD CPUs. The generic solution would be to have the firmware enable the
    window and describe it in the host bridge's _CRS method, or at least
    describe it in the _PRS method so the OS would have the option of enabling
    it.

    Signed-off-by: Christian König
    [bhelgaas: changelog, extend doc, mention taint in dmesg]
    Signed-off-by: Bjorn Helgaas

    =?UTF-8?q?Christian=20K=C3=B6nig?=
     

11 Jan, 2018

1 commit


10 Jan, 2018

1 commit


09 Jan, 2018

2 commits


08 Jan, 2018

1 commit

  • As the meltdown/spectre problem affects several CPU architectures, it makes
    sense to have common way to express whether a system is affected by a
    particular vulnerability or not. If affected the way to express the
    mitigation should be common as well.

    Create /sys/devices/system/cpu/vulnerabilities folder and files for
    meltdown, spectre_v1 and spectre_v2.

    Allow architectures to override the show function.

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Greg Kroah-Hartman
    Reviewed-by: Konrad Rzeszutek Wilk
    Cc: Peter Zijlstra
    Cc: Will Deacon
    Cc: Dave Hansen
    Cc: Linus Torvalds
    Cc: Borislav Petkov
    Cc: David Woodhouse
    Link: https://lkml.kernel.org/r/20180107214913.096657732@linutronix.de

    Thomas Gleixner
     

07 Jan, 2018

1 commit

  • Add some details about how PTI works, what some of the downsides
    are, and how to debug it when things go wrong.

    Also document the kernel parameter: 'pti/nopti'.

    Signed-off-by: Dave Hansen
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Randy Dunlap
    Reviewed-by: Kees Cook
    Cc: Moritz Lipp
    Cc: Daniel Gruss
    Cc: Michael Schwarz
    Cc: Richard Fellner
    Cc: Andy Lutomirski
    Cc: Linus Torvalds
    Cc: Hugh Dickins
    Cc: Andi Lutomirsky
    Cc: stable@vger.kernel.org
    Link: https://lkml.kernel.org/r/20180105174436.1BC6FA2B@viggo.jf.intel.com

    Dave Hansen
     

06 Jan, 2018

2 commits

  • Pull more x86 pti fixes from Thomas Gleixner:
    "Another small stash of fixes for fallout from the PTI work:

    - Fix the modules vs. KASAN breakage which was caused by making
    MODULES_END depend of the fixmap size. That was done when the cpu
    entry area moved into the fixmap, but now that we have a separate
    map space for that this is causing more issues than it solves.

    - Use the proper cache flush methods for the debugstore buffers as
    they are mapped/unmapped during runtime and not statically mapped
    at boot time like the rest of the cpu entry area.

    - Make the map layout of the cpu_entry_area consistent for 4 and 5
    level paging and fix the KASLR vaddr_end wreckage.

    - Use PER_CPU_EXPORT for per cpu variable and while at it unbreak
    nvidia gfx drivers by dropping the GPL export. The subject line of
    the commit tells it the other way around, but I noticed that too
    late.

    - Fix the ASM alternative macros so they can be used in the middle of
    an inline asm block.

    - Rename the BUG_CPU_INSECURE flag to BUG_CPU_MELTDOWN so the attack
    vector is properly identified. The Spectre mitigations will come
    with their own bug bits later"

    * 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/pti: Rename BUG_CPU_INSECURE to BUG_CPU_MELTDOWN
    x86/alternatives: Add missing '\n' at end of ALTERNATIVE inline asm
    x86/tlb: Drop the _GPL from the cpu_tlbstate export
    x86/events/intel/ds: Use the proper cache flush method for mapping ds buffers
    x86/kaslr: Fix the vaddr_end mess
    x86/mm: Map cpu_entry_area at the same place on 4/5 level
    x86/mm: Set MODULES_END to 0xffffffffff000000

    Linus Torvalds
     
  • Since commit 31847b67bec0 ("kconfig: allow use of relations other than
    (in)equality") it is possible to use relational operators in Kconfig
    statements. However, those operators give unexpected results when
    applied to bool/tristate values:

    (n < y) = y (correct)
    (m < y) = y (correct)
    (n < m) = n (wrong)

    This happens because relational operators process bool and tristate
    symbols as strings and m sorts before n. It makes little sense to do a
    lexicographical compare on bool and tristate values though.

    Documentation/kbuild/kconfig-language.txt states that expression can have
    a value of 'n', 'm' or 'y' (or 0, 1, 2 respectively for calculations).
    Let's make it so for relational comparisons with bool/tristate
    expressions as well and document them. If at least one symbol is an
    actual string then the lexicographical compare works just as before.

    Signed-off-by: Nicolas Pitre
    Acked-by: Randy Dunlap
    Tested-by: Randy Dunlap
    Signed-off-by: Masahiro Yamada

    Nicolas Pitre
     

05 Jan, 2018

3 commits

  • vaddr_end for KASLR is only documented in the KASLR code itself and is
    adjusted depending on config options. So it's not surprising that a change
    of the memory layout causes KASLR to have the wrong vaddr_end. This can map
    arbitrary stuff into other areas causing hard to understand problems.

    Remove the whole ifdef magic and define the start of the cpu_entry_area to
    be the end of the KASLR vaddr range.

    Add documentation to that effect.

    Fixes: 92a0f81d8957 ("x86/cpu_entry_area: Move it out of the fixmap")
    Reported-by: Benjamin Gilbert
    Signed-off-by: Thomas Gleixner
    Tested-by: Benjamin Gilbert
    Cc: Andy Lutomirski
    Cc: Greg Kroah-Hartman
    Cc: stable
    Cc: Dave Hansen
    Cc: Peter Zijlstra
    Cc: Thomas Garnier ,
    Cc: Alexander Kuleshov
    Link: https://lkml.kernel.org/r/alpine.DEB.2.20.1801041320360.1771@nanos

    Thomas Gleixner
     
  • There is no reason for 4 and 5 level pagetables to have a different
    layout. It just makes determining vaddr_end for KASLR harder than
    necessary.

    Fixes: 92a0f81d8957 ("x86/cpu_entry_area: Move it out of the fixmap")
    Signed-off-by: Thomas Gleixner
    Cc: Andy Lutomirski
    Cc: Benjamin Gilbert
    Cc: Greg Kroah-Hartman
    Cc: stable
    Cc: Dave Hansen
    Cc: Peter Zijlstra
    Cc: Thomas Garnier ,
    Cc: Alexander Kuleshov
    Link: https://lkml.kernel.org/r/alpine.DEB.2.20.1801041320360.1771@nanos

    Thomas Gleixner
     
  • Since f06bdd4001c2 ("x86/mm: Adapt MODULES_END based on fixmap section size")
    kasan_mem_to_shadow(MODULES_END) could be not aligned to a page boundary.

    So passing page unaligned address to kasan_populate_zero_shadow() have two
    possible effects:

    1) It may leave one page hole in supposed to be populated area. After commit
    21506525fb8d ("x86/kasan/64: Teach KASAN about the cpu_entry_area") that
    hole happens to be in the shadow covering fixmap area and leads to crash:

    BUG: unable to handle kernel paging request at fffffbffffe8ee04
    RIP: 0010:check_memory_region+0x5c/0x190

    Call Trace:

    memcpy+0x1f/0x50
    ghes_copy_tofrom_phys+0xab/0x180
    ghes_read_estatus+0xfb/0x280
    ghes_notify_nmi+0x2b2/0x410
    nmi_handle+0x115/0x2c0
    default_do_nmi+0x57/0x110
    do_nmi+0xf8/0x150
    end_repeat_nmi+0x1a/0x1e

    Note, the crash likely disappeared after commit 92a0f81d8957, which
    changed kasan_populate_zero_shadow() call the way it was before
    commit 21506525fb8d.

    2) Attempt to load module near MODULES_END will fail, because
    __vmalloc_node_range() called from kasan_module_alloc() will hit the
    WARN_ON(!pte_none(*pte)) in the vmap_pte_range() and bail out with error.

    To fix this we need to make kasan_mem_to_shadow(MODULES_END) page aligned
    which means that MODULES_END should be 8*PAGE_SIZE aligned.

    The whole point of commit f06bdd4001c2 was to move MODULES_END down if
    NR_CPUS is big, so the cpu_entry_area takes a lot of space.
    But since 92a0f81d8957 ("x86/cpu_entry_area: Move it out of the fixmap")
    the cpu_entry_area is no longer in fixmap, so we could just set
    MODULES_END to a fixed 8*PAGE_SIZE aligned address.

    Fixes: f06bdd4001c2 ("x86/mm: Adapt MODULES_END based on fixmap section size")
    Reported-by: Jakub Kicinski
    Signed-off-by: Andrey Ryabinin
    Signed-off-by: Thomas Gleixner
    Cc: stable@vger.kernel.org
    Cc: Andy Lutomirski
    Cc: Thomas Garnier
    Link: https://lkml.kernel.org/r/20171228160620.23818-1-aryabinin@virtuozzo.com

    Andrey Ryabinin
     

02 Jan, 2018

2 commits

  • With commit d9e2e0143c the 'GuC-specific firmware loader' doc
    section was removed from intel_guc_loader.c without a
    replacement. So lets remove it from the Kernel-doc::

    .. kernel-doc:: drivers/gpu/drm/i915/intel_guc_loader.c
    :doc: GuC-specific firmware loader

    With commit e8668bbcb0 intel_guc_loader.c was renamed to to
    intel_guc_fw.c and to name just one, intel_guc_init_hw() was
    renamed to intel_guc_fw_upload(). Since we get errors in the
    Sphinx build like:

    - Error: Cannot open file ./drivers/gpu/drm/i915/intel_guc_loader.c

    Change the kernel-doc directive from intel_guc_loader.c to
    intel_guc_fw.c

    Signed-off-by: Markus Heiser
    [danvet: Rebase onto the partial fix 006c23327f8d
    ("documentation/gpu/i915: fix docs build error after file rename")]
    Signed-off-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/1513078717-12373-1-git-send-email-markus.heiser@darmarit.de
    (cherry picked from commit 0132a1a5d44d2cd32a249dbe999a88c2134a6bd1)
    Signed-off-by: Jani Nikula

    Markus Heiser
     
  • Fix documentation build errors after intel_guc_loader.c was
    renamed to intel_guc_fw.c.

    Error: Cannot open file ../drivers/gpu/drm/i915/intel_guc_loader.c
    WARNING: kernel-doc '../scripts/kernel-doc -rst -enable-lineno -function GuC-specific firmware loader ../drivers/gpu/drm/i915/intel_guc_loader.c' failed with return code 1
    Error: Cannot open file ../drivers/gpu/drm/i915/intel_guc_loader.c
    Error: Cannot open file ../drivers/gpu/drm/i915/intel_guc_loader.c
    WARNING: kernel-doc '../scripts/kernel-doc -rst -enable-lineno -internal ../drivers/gpu/drm/i915/intel_guc_loader.c' failed with return code 2

    Fixes: e8668bbcb0f9 ("drm/i915/guc: Rename intel_guc_loader.c to intel_guc_fw.c")
    Signed-off-by: Randy Dunlap
    Cc: Michal Wajdeczko
    Signed-off-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/1b214f53-47f5-bef3-f58e-8136de5678ed@infradead.org
    (cherry picked from commit 006c23327f8de8575508c458131b304188d426f7)
    Signed-off-by: Jani Nikula

    Randy Dunlap
     

01 Jan, 2018

3 commits

  • Pull x86 fixes from Thomas Gleixner:
    "A couple of fixlets for x86:

    - Fix the ESPFIX double fault handling for 5-level pagetables

    - Fix the commandline parsing for 'apic=' on 32bit systems and update
    documentation

    - Make zombie stack traces reliable

    - Fix kexec with stack canary

    - Fix the delivery mode for APICs which was missed when the x86
    vector management was converted to single target delivery. Caused a
    regression due to the broken hardware which ignores affinity
    settings in lowest prio delivery mode.

    - Unbreak modules when AMD memory encryption is enabled

    - Remove an unused parameter of prepare_switch_to"

    * 'x86/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/apic: Switch all APICs to Fixed delivery mode
    x86/apic: Update the 'apic=' description of setting APIC driver
    x86/apic: Avoid wrong warning when parsing 'apic=' in X86-32 case
    x86-32: Fix kexec with stack canary (CONFIG_CC_STACKPROTECTOR)
    x86: Remove unused parameter of prepare_switch_to
    x86/stacktrace: Make zombie stack traces reliable
    x86/mm: Unbreak modules that use the DMA API
    x86/build: Make isoimage work on Debian
    x86/espfix/64: Fix espfix double-fault handling on 5-level systems

    Linus Torvalds
     
  • Pull scheduler fixes from Thomas Gleixner:
    "Three patches addressing the fallout of the CPU_ISOLATION changes
    especially with NO_HZ_FULL plus documentation of boot parameter
    dependency"

    * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    sched/isolation: Document boot parameters dependency on CONFIG_CPU_ISOLATION=y
    sched/isolation: Enable CONFIG_CPU_ISOLATION=y by default
    sched/isolation: Make CONFIG_NO_HZ_FULL select CONFIG_CPU_ISOLATION

    Linus Torvalds
     
  • Pull char/misc fixes from Greg KH:
    "Here are six small fixes of some of the char/misc drivers that have
    been sent in to resolve reported issues.

    Nothing major, a binder use-after-free fix, some thunderbolt bugfixes,
    a hyper-v bugfix, and an nvmem driver fix. All of these have been in
    linux-next with no reported issues for a while"

    * tag 'char-misc-4.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
    nvmem: meson-mx-efuse: fix reading from an offset other than 0
    binder: fix proc->files use-after-free
    vmbus: unregister device_obj->channels_kset
    thunderbolt: Mask ring interrupt properly when polling starts
    MAINTAINERS: Add thunderbolt.rst to the Thunderbolt driver entry
    thunderbolt: Make pathname to force_power shorter

    Linus Torvalds
     

30 Dec, 2017

1 commit

  • Pull x86 page table isolation updates from Thomas Gleixner:
    "This is the final set of enabling page table isolation on x86:

    - Infrastructure patches for handling the extra page tables.

    - Patches which map the various bits and pieces which are required to
    get in and out of user space into the user space visible page
    tables.

    - The required changes to have CR3 switching in the entry/exit code.

    - Optimizations for the CR3 switching along with documentation how
    the ASID/PCID mechanism works.

    - Updates to dump pagetables to cover the user space page tables for
    W+X scans and extra debugfs files to analyze both the kernel and
    the user space visible page tables

    The whole functionality is compile time controlled via a config switch
    and can be turned on/off on the command line as well"

    * 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (32 commits)
    x86/ldt: Make the LDT mapping RO
    x86/mm/dump_pagetables: Allow dumping current pagetables
    x86/mm/dump_pagetables: Check user space page table for WX pages
    x86/mm/dump_pagetables: Add page table directory to the debugfs VFS hierarchy
    x86/mm/pti: Add Kconfig
    x86/dumpstack: Indicate in Oops whether PTI is configured and enabled
    x86/mm: Clarify the whole ASID/kernel PCID/user PCID naming
    x86/mm: Use INVPCID for __native_flush_tlb_single()
    x86/mm: Optimize RESTORE_CR3
    x86/mm: Use/Fix PCID to optimize user/kernel switches
    x86/mm: Abstract switching CR3
    x86/mm: Allow flushing for future ASID switches
    x86/pti: Map the vsyscall page if needed
    x86/pti: Put the LDT in its own PGD if PTI is on
    x86/mm/64: Make a full PGD-entry size hole in the memory map
    x86/events/intel/ds: Map debug buffers in cpu_entry_area
    x86/cpu_entry_area: Add debugstore entries to cpu_entry_area
    x86/mm/pti: Map ESPFIX into user space
    x86/mm/pti: Share entry text PMD
    x86/entry: Align entry text section to PMD boundary
    ...

    Linus Torvalds
     

28 Dec, 2017

2 commits

  • There are two consumers of apic=: the APIC debug level and the low
    level generic architecture code, but Linux just documented the first
    one.

    Append the second description.

    Signed-off-by: Dou Liyang
    Signed-off-by: Thomas Gleixner
    Cc: peterz@infradead.org
    Cc: rdunlap@infradead.org
    Cc: corbet@lwn.net
    Link: https://lkml.kernel.org/r/20171204040313.24824-2-douly.fnst@cn.fujitsu.com

    Dou Liyang
     
  • Pull sound fixes from Takashi Iwai:
    "It seems that Santa overslept with a bunch of gifts; the majority of
    changes here are various device-specific ASoC fixes, most notably the
    revert of rcar IOMMU support and fsl_ssi AC97 fixes, but also lots of
    small fixes for codecs. Besides that, the usual HD-audio quirks and
    fixes are included, too"

    * tag 'sound-4.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (31 commits)
    ALSA: hda - Fix missing COEF init for ALC225/295/299
    ALSA: hda: Drop useless WARN_ON()
    ALSA: hda - change the location for one mic on a Lenovo machine
    ALSA: hda - fix headset mic detection issue on a Dell machine
    ALSA: hda - Add MIC_NO_PRESENCE fixup for 2 HP machines
    ASoC: rsnd: fixup ADG register mask
    ASoC: rt5514-spi: only enable wakeup when fully initialized
    ASoC: nau8825: fix issue that pop noise when start capture
    ASoC: rt5663: Fix the wrong result of the first jack detection
    ASoC: rsnd: ssi: fix race condition in rsnd_ssi_pointer_update
    ASoC: Intel: Change kern log level to avoid unwanted messages
    ASoC: atmel-classd: select correct Kconfig symbol
    ASoC: wm_adsp: Fix validation of firmware and coeff lengths
    ASoC: Intel: Skylake: Do not check dev_type for dmic link type
    ASoC: rockchip: disable clock on error
    ASoC: tlv320aic31xx: Fix GPIO1 register definition
    ASoC: codecs: msm8916-wcd: Fix supported formats
    ASoC: fsl_asrc: Fix typo in a field define
    ASoC: rsnd: ssiu: clear SSI_MODE for non TDM Extended modes
    ASoC: da7218: Correct IRQ level in DT binding example
    ...

    Linus Torvalds
     

24 Dec, 2017

5 commits

  • With PTI enabled, the LDT must be mapped in the usermode tables somewhere.
    The LDT is per process, i.e. per mm.

    An earlier approach mapped the LDT on context switch into a fixmap area,
    but that's a big overhead and exhausted the fixmap space when NR_CPUS got
    big.

    Take advantage of the fact that there is an address space hole which
    provides a completely unused pgd. Use this pgd to manage per-mm LDT
    mappings.

    This has a down side: the LDT isn't (currently) randomized, and an attack
    that can write the LDT is instant root due to call gates (thanks, AMD, for
    leaving call gates in AMD64 but designing them wrong so they're only useful
    for exploits). This can be mitigated by making the LDT read-only or
    randomizing the mapping, either of which is strightforward on top of this
    patch.

    This will significantly slow down LDT users, but that shouldn't matter for
    important workloads -- the LDT is only used by DOSEMU(2), Wine, and very
    old libc implementations.

    [ tglx: Cleaned it up. ]

    Signed-off-by: Andy Lutomirski
    Signed-off-by: Thomas Gleixner
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Dave Hansen
    Cc: Dave Hansen
    Cc: David Laight
    Cc: H. Peter Anvin
    Cc: Josh Poimboeuf
    Cc: Juergen Gross
    Cc: Kees Cook
    Cc: Kirill A. Shutemov
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Andy Lutomirski
     
  • Shrink vmalloc space from 16384TiB to 12800TiB to enlarge the hole starting
    at 0xff90000000000000 to be a full PGD entry.

    A subsequent patch will use this hole for the pagetable isolation LDT
    alias.

    Signed-off-by: Andy Lutomirski
    Signed-off-by: Thomas Gleixner
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Dave Hansen
    Cc: Dave Hansen
    Cc: David Laight
    Cc: H. Peter Anvin
    Cc: Josh Poimboeuf
    Cc: Juergen Gross
    Cc: Kees Cook
    Cc: Kirill A. Shutemov
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Andy Lutomirski
     
  • Keep the "nopti" optional for traditional reasons.

    [ tglx: Don't allow force on when running on XEN PV and made 'on'
    printout conditional ]

    Requested-by: Linus Torvalds
    Signed-off-by: Borislav Petkov
    Signed-off-by: Thomas Gleixner
    Cc: Andy Lutomirski
    Cc: Andy Lutomirsky
    Cc: Boris Ostrovsky
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Dave Hansen
    Cc: Dave Hansen
    Cc: David Laight
    Cc: Denys Vlasenko
    Cc: Eduardo Valentin
    Cc: Greg KH
    Cc: H. Peter Anvin
    Cc: Josh Poimboeuf
    Cc: Juergen Gross
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Will Deacon
    Cc: aliguori@amazon.com
    Cc: daniel.gruss@iaik.tugraz.at
    Cc: hughd@google.com
    Cc: keescook@google.com
    Link: https://lkml.kernel.org/r/20171212133952.10177-1-bp@alien8.de
    Signed-off-by: Ingo Molnar

    Borislav Petkov
     
  • Add the initial files for kernel page table isolation, with a minimal init
    function and the boot time detection for this misfeature.

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Borislav Petkov
    Cc: Andy Lutomirski
    Cc: Boris Ostrovsky
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Dave Hansen
    Cc: David Laight
    Cc: Denys Vlasenko
    Cc: Eduardo Valentin
    Cc: Greg KH
    Cc: H. Peter Anvin
    Cc: Josh Poimboeuf
    Cc: Juergen Gross
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Will Deacon
    Cc: aliguori@amazon.com
    Cc: daniel.gruss@iaik.tugraz.at
    Cc: hughd@google.com
    Cc: keescook@google.com
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     
  • Pull x86 PTI preparatory patches from Thomas Gleixner:
    "Todays Advent calendar window contains twentyfour easy to digest
    patches. The original plan was to have twenty three matching the date,
    but a late fixup made that moot.

    - Move the cpu_entry_area mapping out of the fixmap into a separate
    address space. That's necessary because the fixmap becomes too big
    with NRCPUS=8192 and this caused already subtle and hard to
    diagnose failures.

    The top most patch is fresh from today and cures a brain slip of
    that tall grumpy german greybeard, who ignored the intricacies of
    32bit wraparounds.

    - Limit the number of CPUs on 32bit to 64. That's insane big already,
    but at least it's small enough to prevent address space issues with
    the cpu_entry_area map, which have been observed and debugged with
    the fixmap code

    - A few TLB flush fixes in various places plus documentation which of
    the TLB functions should be used for what.

    - Rename the SYSENTER stack to CPU_ENTRY_AREA stack as it is used for
    more than sysenter now and keeping the name makes backtraces
    confusing.

    - Prevent LDT inheritance on exec() by moving it to arch_dup_mmap(),
    which is only invoked on fork().

    - Make vysycall more robust.

    - A few fixes and cleanups of the debug_pagetables code. Check
    PAGE_PRESENT instead of checking the PTE for 0 and a cleanup of the
    C89 initialization of the address hint array which already was out
    of sync with the index enums.

    - Move the ESPFIX init to a different place to prepare for PTI.

    - Several code moves with no functional change to make PTI
    integration simpler and header files less convoluted.

    - Documentation fixes and clarifications"

    * 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (24 commits)
    x86/cpu_entry_area: Prevent wraparound in setup_cpu_entry_area_ptes() on 32bit
    init: Invoke init_espfix_bsp() from mm_init()
    x86/cpu_entry_area: Move it out of the fixmap
    x86/cpu_entry_area: Move it to a separate unit
    x86/mm: Create asm/invpcid.h
    x86/mm: Put MMU to hardware ASID translation in one place
    x86/mm: Remove hard-coded ASID limit checks
    x86/mm: Move the CR3 construction functions to tlbflush.h
    x86/mm: Add comments to clarify which TLB-flush functions are supposed to flush what
    x86/mm: Remove superfluous barriers
    x86/mm: Use __flush_tlb_one() for kernel memory
    x86/microcode: Dont abuse the TLB-flush interface
    x86/uv: Use the right TLB-flush API
    x86/entry: Rename SYSENTER_stack to CPU_ENTRY_AREA_entry_stack
    x86/doc: Remove obvious weirdnesses from the x86 MM layout documentation
    x86/mm/64: Improve the memory map documentation
    x86/ldt: Prevent LDT inheritance on exec
    x86/ldt: Rework locking
    arch, mm: Allow arch_dup_mmap() to fail
    x86/vsyscall/64: Warn and fail vsyscall emulation in NATIVE mode
    ...

    Linus Torvalds
     

23 Dec, 2017

3 commits

  • Put the cpu_entry_area into a separate P4D entry. The fixmap gets too big
    and 0-day already hit a case where the fixmap PTEs were cleared by
    cleanup_highmap().

    Aside of that the fixmap API is a pain as it's all backwards.

    Signed-off-by: Thomas Gleixner
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Dave Hansen
    Cc: H. Peter Anvin
    Cc: Josh Poimboeuf
    Cc: Juergen Gross
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     
  • Signed-off-by: Peter Zijlstra (Intel)
    Signed-off-by: Thomas Gleixner
    Cc: Andy Lutomirski
    Cc: Boris Ostrovsky
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Dave Hansen
    Cc: David Laight
    Cc: Denys Vlasenko
    Cc: Eduardo Valentin
    Cc: Greg KH
    Cc: H. Peter Anvin
    Cc: Josh Poimboeuf
    Cc: Juergen Gross
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Will Deacon
    Cc: aliguori@amazon.com
    Cc: daniel.gruss@iaik.tugraz.at
    Cc: hughd@google.com
    Cc: keescook@google.com
    Cc: linux-mm@kvack.org
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • The old docs had the vsyscall range wrong and were missing the fixmap.
    Fix both.

    There used to be 8 MB reserved for future vsyscalls, but that's long gone.

    Signed-off-by: Andy Lutomirski
    Signed-off-by: Thomas Gleixner
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Dave Hansen
    Cc: Dave Hansen
    Cc: David Laight
    Cc: H. Peter Anvin
    Cc: Josh Poimboeuf
    Cc: Juergen Gross
    Cc: Kees Cook
    Cc: Kirill A. Shutemov
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Andy Lutomirski