1. 24 2月, 2016 2 次提交
    • M
      arm/arm64: KVM: Feed initialized memory to MMIO accesses · 1d6a8212
      Marc Zyngier 提交于
      On an MMIO access, we always copy the on-stack buffer info
      the shared "run" structure, even if this is a read access.
      This ends up leaking up to 8 bytes of uninitialized memory
      into userspace, depending on the size of the access.
      
      An obvious fix for this one is to only perform the copy if
      this is an actual write.
      Reviewed-by: NChristoffer Dall <christoffer.dall@linaro.org>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      1d6a8212
    • M
      KVM: arm/arm64: vgic: Ensure bitmaps are long enough · 236cf17c
      Mark Rutland 提交于
      When we allocate bitmaps in vgic_vcpu_init_maps, we divide the number of
      bits we need by 8 to figure out how many bytes to allocate. However,
      bitmap elements are always accessed as unsigned longs, and if we didn't
      happen to allocate a size such that size % sizeof(unsigned long) == 0,
      bitmap accesses may go past the end of the allocation.
      
      When using KASAN (which does byte-granular access checks), this results
      in a continuous stream of BUGs whenever these bitmaps are accessed:
      
      =============================================================================
      BUG kmalloc-128 (Tainted: G    B          ): kasan: bad access detected
      -----------------------------------------------------------------------------
      
      INFO: Allocated in vgic_init.part.25+0x55c/0x990 age=7493 cpu=3 pid=1730
      INFO: Slab 0xffffffbde6d5da40 objects=16 used=15 fp=0xffffffc935769700 flags=0x4000000000000080
      INFO: Object 0xffffffc935769500 @offset=1280 fp=0x          (null)
      
      Bytes b4 ffffffc9357694f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      Object ffffffc935769500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      Object ffffffc935769510: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      Object ffffffc935769520: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      Object ffffffc935769530: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      Object ffffffc935769540: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      Object ffffffc935769550: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      Object ffffffc935769560: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      Object ffffffc935769570: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      Padding ffffffc9357695b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      Padding ffffffc9357695c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      Padding ffffffc9357695d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      Padding ffffffc9357695e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      Padding ffffffc9357695f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      CPU: 3 PID: 1740 Comm: kvm-vcpu-0 Tainted: G    B           4.4.0+ #17
      Hardware name: ARM Juno development board (r1) (DT)
      Call trace:
      [<ffffffc00008e770>] dump_backtrace+0x0/0x280
      [<ffffffc00008ea04>] show_stack+0x14/0x20
      [<ffffffc000726360>] dump_stack+0x100/0x188
      [<ffffffc00030d324>] print_trailer+0xfc/0x168
      [<ffffffc000312294>] object_err+0x3c/0x50
      [<ffffffc0003140fc>] kasan_report_error+0x244/0x558
      [<ffffffc000314548>] __asan_report_load8_noabort+0x48/0x50
      [<ffffffc000745688>] __bitmap_or+0xc0/0xc8
      [<ffffffc0000d9e44>] kvm_vgic_flush_hwstate+0x1bc/0x650
      [<ffffffc0000c514c>] kvm_arch_vcpu_ioctl_run+0x2ec/0xa60
      [<ffffffc0000b9a6c>] kvm_vcpu_ioctl+0x474/0xa68
      [<ffffffc00036b7b0>] do_vfs_ioctl+0x5b8/0xcb0
      [<ffffffc00036bf34>] SyS_ioctl+0x8c/0xa0
      [<ffffffc000086cb0>] el0_svc_naked+0x24/0x28
      Memory state around the buggy address:
       ffffffc935769400: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc
       ffffffc935769480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
      >ffffffc935769500: 04 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                         ^
       ffffffc935769580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
       ffffffc935769600: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc
      ==================================================================
      
      Fix the issue by always allocating a multiple of sizeof(unsigned long),
      as we do elsewhere in the vgic code.
      
      Fixes: c1bfb577 ("arm/arm64: KVM: vgic: switch to dynamic allocation")
      Cc: stable@vger.kernel.org
      Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
      Acked-by: NChristoffer Dall <christoffer.dall@linaro.org>
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      236cf17c
  2. 11 2月, 2016 1 次提交
  3. 08 2月, 2016 1 次提交
    • A
      KVM: arm/arm64: Fix reference to uninitialised VGIC · b3aff6cc
      Andre Przywara 提交于
      Commit 4b4b4512 ("arm/arm64: KVM: Rework the arch timer to use
      level-triggered semantics") brought the virtual architected timer
      closer to the VGIC. There is one occasion were we don't properly
      check for the VGIC actually having been initialized before, but
      instead go on to check the active state of some IRQ number.
      If userland hasn't instantiated a virtual GIC, we end up with a
      kernel NULL pointer dereference:
      =========
      Unable to handle kernel NULL pointer dereference at virtual address 00000000
      pgd = ffffffc9745c5000
      [00000000] *pgd=00000009f631e003, *pud=00000009f631e003, *pmd=0000000000000000
      Internal error: Oops: 96000006 [#2] PREEMPT SMP
      Modules linked in:
      CPU: 0 PID: 2144 Comm: kvm_simplest-ar Tainted: G      D 4.5.0-rc2+ #1300
      Hardware name: ARM Juno development board (r1) (DT)
      task: ffffffc976da8000 ti: ffffffc976e28000 task.ti: ffffffc976e28000
      PC is at vgic_bitmap_get_irq_val+0x78/0x90
      LR is at kvm_vgic_map_is_active+0xac/0xc8
      pc : [<ffffffc0000b7e28>] lr : [<ffffffc0000b972c>] pstate: 20000145
      ....
      =========
      
      Fix this by bailing out early of kvm_timer_flush_hwstate() if we don't
      have a VGIC at all.
      Reported-by: NCosmin Gorgovan <cosmin@linux-geek.org>
      Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NAndre Przywara <andre.przywara@arm.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Cc: <stable@vger.kernel.org> # 4.4.x
      b3aff6cc
  4. 25 1月, 2016 16 次提交
    • S
      arm64: KVM: Fix guest dead loop when register accessor returns false · 6327f35a
      Shannon Zhao 提交于
      Currently emulate_cp will return 0 (Handled) no matter what the accessor
      returns. If register accessor returns false, it will not skip current PC
      while emulate_cp return handled. Then guest will stuck in a dead loop.
      Reviewed-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NShannon Zhao <shannon.zhao@linaro.org>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      6327f35a
    • S
      arm64: KVM: Fix comments of the CP handler · 7769db90
      Shannon Zhao 提交于
      Make sure the documentation reflects the actual name of the functions.
      Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NShannon Zhao <shannon.zhao@linaro.org>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      7769db90
    • S
      arm64: KVM: Fix wrong use of the CPSR MODE mask for 32bit guests · 9586a2ea
      Shannon Zhao 提交于
      The values of CPSR MODE mask are different between aarch32 and aarch64.
      It should use the right one according to the execution state.
      Reviewed-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NShannon Zhao <shannon.zhao@linaro.org>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      9586a2ea
    • D
      arm64: KVM: Obey RES0/1 reserved bits when setting CPTR_EL2 · a7e0ac29
      Dave Martin 提交于
      Some bits in CPTR are defined as RES1 in the architecture.  Setting
      these bits to zero may unintentionally enable future architecture
      extensions, allowing guests to use them without supervision by the host.
      
      This would be bad: for forwards compatibility, this patch makes
      sure the affected bits are always written with 1, not 0.
      
      This patch only addresses CPTR_EL2.  Initialisation of other system
      registers may still need review.
      Reviewed-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NDave Martin <Dave.Martin@arm.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      a7e0ac29
    • M
      arm64: KVM: Fix AArch64 guest userspace exception injection · 8fc153cd
      Marc Zyngier 提交于
      At the moment, our fault injection is pretty limited. We always
      generate a SYNC exception into EL1, as if the fault was actually
      from EL1h, no matter how it was generated.
      
      This is obviously wrong, as EL0 can generate faults of its own
      (not to mention the pretty-much unused EL1t mode).
      
      This patch fixes it by implementing section D1.10.2 of the ARMv8 ARM,
      and in particular table D1-7 ("Vector offsets from vector table base
      address"), which describes which vector to use depending on the source
      exception level and type (synchronous, IRQ, FIQ or SError).
      Reviewed-by: NChristoffer Dall <christoffer.dall@linaro.org>
      Tested-by: NShannon Zhao <shannon.zhao@linaro.org>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      8fc153cd
    • L
      Linux 4.5-rc1 · 92e963f5
      Linus Torvalds 提交于
      92e963f5
    • L
      Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus · e2464688
      Linus Torvalds 提交于
      Pull MIPS updates from Ralf Baechle:
       "This is the main pull request for MIPS for 4.5 plus some 4.4 fixes.
      
        The executive summary:
      
         - ATH79 platform improvments, use DT bindings for the ATH79 USB PHY.
         - Avoid useless rebuilds for zboot.
         - jz4780: Add NEMC, BCH and NAND device tree nodes
         - Initial support for the MicroChip's DT platform.  As all the device
           drivers are missing this is still of limited use.
         - Some Loongson3 cleanups.
         - The unavoidable whitespace polishing.
         - Reduce clock skew when synchronizing the CPU cycle counters on CPU
           startup.
         - Add MIPS R6 fixes.
         - Lots of cleanups across arch/mips as fallout from KVM.
         - Lots of minor fixes and changes for IEEE 754-2008 support to the
           FPU emulator / fp-assist software.
         - Minor Ralink, BCM47xx and bcm963xx platform support improvments.
         - Support SMP on BCM63168"
      
      * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (84 commits)
        MIPS: zboot: Add support for serial debug using the PROM
        MIPS: zboot: Avoid useless rebuilds
        MIPS: BMIPS: Enable ARCH_WANT_OPTIONAL_GPIOLIB
        MIPS: bcm63xx: nvram: Remove unused bcm63xx_nvram_get_psi_size() function
        MIPS: bcm963xx: Update bcm_tag field image_sequence
        MIPS: bcm963xx: Move extended flash address to bcm_tag header file
        MIPS: bcm963xx: Move Broadcom BCM963xx image tag data structure
        MIPS: bcm63xx: nvram: Use nvram structure definition from header file
        MIPS: bcm963xx: Add Broadcom BCM963xx board nvram data structure
        MAINTAINERS: Add KVM for MIPS entry
        MIPS: KVM: Add missing newline to kvm_err()
        MIPS: Move KVM specific opcodes into asm/inst.h
        MIPS: KVM: Use cacheops.h definitions
        MIPS: Break down cacheops.h definitions
        MIPS: Use EXCCODE_ constants with set_except_vector()
        MIPS: Update trap codes
        MIPS: Move Cause.ExcCode trap codes to mipsregs.h
        MIPS: KVM: Make kvm_mips_{init,exit}() static
        MIPS: KVM: Refactor added offsetof()s
        MIPS: KVM: Convert EXPORT_SYMBOL to _GPL
        ...
      e2464688
    • L
      Merge tag 'platform-drivers-x86-v4.5-2' of... · e1c10879
      Linus Torvalds 提交于
      Merge tag 'platform-drivers-x86-v4.5-2' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86
      
      Pull x86 platform driver updates from Darren Hart:
       "Emergency travel prevented me from completing my final testing on this
        until today.  Nothing here that couldn't wait until RC1 fixes, but I
        thought it best to get it out sooner rather than later as it does
        contain a build warning fix.
      
        Summary:
      
        A build warning fix, MAINTAINERS cleanup, and a new DMI quirk:
      
        ideapad-laptop:
         - Add Lenovo Yoga 700 to no_hw_rfkill dmi list
      
        MAINTAINERS:
         - Combine multiple telemetry entries
      
        intel_telemetry_debugfs:
         - Fix unused warnings in telemetry debugfs"
      
      * tag 'platform-drivers-x86-v4.5-2' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86:
        ideapad-laptop: Add Lenovo Yoga 700 to no_hw_rfkill dmi list
        MAINTAINERS: Combine multiple telemetry entries
        intel_telemetry_debugfs: Fix unused warnings in telemetry debugfs
      e1c10879
    • L
      Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux · 81f05fee
      Linus Torvalds 提交于
      Pull thermal management updates from Zhang Rui:
       "The top merge commit was re-generated yesterday because two topic
        branches were dropped from this pull request in the last minute due to
        some unaddressed comments.  All the other material has been in
        linux-next for quite a while.
      
        Specifics:
      
         - Enhance thermal core to handle unexpected device cooling states
           after fresh boot and system resume.  From Zhang Rui and Chen Yu.
      
         - Several fixes and cleanups on Rockchip and RCAR thermal drivers.
           From Caesar Wang and Kuninori Morimoto.
      
         - Add Broxton support for Intel processor thermal reporting device
           driver.  From Amy Wiles"
      
      * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
        thermal: trip_point_temp_store() calls thermal_zone_device_update()
        thermal: rcar: rcar_thermal_get_temp() return error if strange temp
        thermal: rcar: check irq possibility in rcar_thermal_irq_xxx()
        thermal: rcar: check every rcar_thermal_update_temp() return value
        thermal: rcar: move rcar_thermal_dt_ids to upside
        thermal: rockchip: Support the RK3399 SoCs in thermal driver
        thermal: rockchip: Support the RK3228 SoCs in thermal driver
        dt-bindings: rockchip-thermal: Support the RK3228/RK3399 SoCs compatible
        thermal: rockchip: fix a trivial typo
        Thermal: Enable Broxton SoC thermal reporting device
        thermal: constify pch_dev_ops structure
        Thermal: do thermal zone update after a cooling device registered
        Thermal: handle thermal zone device properly during system sleep
        Thermal: initialize thermal zone device correctly
      81f05fee
    • L
      Merge tag 'for-linus-4.5-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs · c52cb431
      Linus Torvalds 提交于
      Pull 9p updates from Eric Van Hensbergen:
       "Sorry for the last minute pull request, there's was a change that
        didn't get pulled into for-next until two weeks ago and I wanted to
        give it some bake time.
      
        Summary:
      
        Rework and error handling fixes, primarily in the fscatch and fd
        transports"
      
      * tag 'for-linus-4.5-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
        fs/9p: use fscache mutex rather than spinlock
        9p: trans_fd, bail out if recv fcall if missing
        9p: trans_fd, read rework to use p9_parse_header
        net/9p: Add device name details on error
      c52cb431
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client · 00e3f5cc
      Linus Torvalds 提交于
      Pull Ceph updates from Sage Weil:
       "The two main changes are aio support in CephFS, and a series that
        fixes several issues in the authentication key timeout/renewal code.
      
        On top of that are a variety of cleanups and minor bug fixes"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
        libceph: remove outdated comment
        libceph: kill off ceph_x_ticket_handler::validity
        libceph: invalidate AUTH in addition to a service ticket
        libceph: fix authorizer invalidation, take 2
        libceph: clear messenger auth_retry flag if we fault
        libceph: fix ceph_msg_revoke()
        libceph: use list_for_each_entry_safe
        ceph: use i_size_{read,write} to get/set i_size
        ceph: re-send AIO write request when getting -EOLDSNAP error
        ceph: Asynchronous IO support
        ceph: Avoid to propagate the invalid page point
        ceph: fix double page_unlock() in page_mkwrite()
        rbd: delete an unnecessary check before rbd_dev_destroy()
        libceph: use list_next_entry instead of list_entry_next
        ceph: ceph_frag_contains_value can be boolean
        ceph: remove unused functions in ceph_frag.h
      00e3f5cc
    • L
      Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6 · 772950ed
      Linus Torvalds 提交于
      Pull SMB3 fixes from Steve French:
       "A collection of CIFS/SMB3 fixes.
      
        It includes a couple bug fixes, a few for improved debugging of
        cifs.ko and some improvements to the way cifs does key generation.
      
        I do have some additional bug fixes I expect in the next week or two
        (to address a problem found by xfstest, and some fixes for SMB3.11
        dialect, and a couple patches that just came in yesterday that I am
        reviewing)"
      
      * 'for-next' of git://git.samba.org/sfrench/cifs-2.6:
        cifs_dbg() outputs an uninitialized buffer in cifs_readdir()
        cifs: fix race between call_async() and reconnect()
        Prepare for encryption support (first part). Add decryption and encryption key generation. Thanks to Metze for helping with this.
        cifs: Allow using O_DIRECT with cache=loose
        cifs: Make echo interval tunable
        cifs: Check uniqueid for SMB2+ and return -ESTALE if necessary
        Print IP address of unresponsive server
        cifs: Ratelimit kernel log messages
      772950ed
    • J
      ideapad-laptop: Add Lenovo Yoga 700 to no_hw_rfkill dmi list · 6b31de3e
      Josh Boyer 提交于
      Like the Yoga 900 models the Lenovo Yoga 700 does not have a
      hw rfkill switch, and trying to read the hw rfkill switch through the
      ideapad module causes it to always reported blocking breaking wifi.
      
      This commit adds the Lenovo Yoga 700 to the no_hw_rfkill dmi list, fixing
      the wifi breakage.
      
      BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1295272
      Tested-by: <dinyar.rabady+spam@gmail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJosh Boyer <jwboyer@fedoraproject.org>
      Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
      6b31de3e
    • S
      MAINTAINERS: Combine multiple telemetry entries · f1fc3cd8
      Souvik Kumar Chakravarty 提交于
      This patch combines all the telemetry file entries in MAINTAINERS via
      wildcard.
      Signed-off-by: NSouvik Kumar Chakravarty <souvik.k.chakravarty@intel.com>
      Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
      f1fc3cd8
    • S
      intel_telemetry_debugfs: Fix unused warnings in telemetry debugfs · 7885f2f9
      Souvik Kumar Chakravarty 提交于
      This patch fixes compile time warnings when CONFIG_PM_SLEEP
      is undefined. In this case sleep related counters are unused.
      Signed-off-by: NSouvik Kumar Chakravarty <souvik.k.chakravarty@intel.com>
      Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
      7885f2f9
    • C
      vmstat: Remove BUG_ON from vmstat_update · 587198ba
      Christoph Lameter 提交于
      If we detect that there is nothing to do just set the flag and do not
      check if it was already set before.  Races really do not matter.  If the
      flag is set by any code then the shepherd will start dealing with the
      situation and reenable the vmstat workers when necessary again.
      
      Since commit 0eb77e98 ("vmstat: make vmstat_updater deferrable again
      and shut down on idle") quiet_vmstat might update cpu_stat_off and mark
      a particular cpu to be handled by vmstat_shepherd.  This might trigger a
      VM_BUG_ON in vmstat_update because the work item might have been
      sleeping during the idle period and see the cpu_stat_off updated after
      the wake up.  The VM_BUG_ON is therefore misleading and no more
      appropriate.  Moreover it doesn't really suite any protection from real
      bugs because vmstat_shepherd will simply reschedule the vmstat_work
      anytime it sees a particular cpu set or vmstat_update would do the same
      from the worker context directly.  Even when the two would race the
      result wouldn't be incorrect as the counters update is fully idempotent.
      Reported-by: NSasha Levin <sasha.levin@oracle.com>
      Signed-off-by: NChristoph Lameter <cl@linux.com>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      587198ba
  5. 24 1月, 2016 20 次提交