Skip to content
  1. May 30, 2021
    • Linus Torvalds's avatar
      Merge tag 'driver-core-5.13-rc4' of... · e1a9e3db
      Linus Torvalds authored
      Merge tag 'driver-core-5.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
      
      Pull driver core fixes from Greg KH:
       "Here are three small driver core / debugfs fixes for 5.13-rc4:
      
         - debugfs fix for incorrect "lockdown" mode for selinux accesses
      
         - two device link changes, one bugfix and one cleanup
      
        All of these have been in linux-next for over a week with no reported
        problems"
      
      * tag 'driver-core-5.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        drivers: base: Reduce device link removal code duplication
        drivers: base: Fix device link removal
        debugfs: fix security_locked_down() call for SELinux
      e1a9e3db
    • Linus Torvalds's avatar
      Merge tag 'staging-5.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 494b99f7
      Linus Torvalds authored
      Pull staging and IIO driver fixes from Greg KH:
       "Here are some small IIO and staging driver fixes for reported issues
        for 5.13-rc4.
      
        Nothing major here, tiny changes for reported problems, full details
        are in the shortlog if people are curious.
      
        All have been in linux-next for a while with no reported problems"
      
      * tag 'staging-5.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        iio: adc: ad7793: Add missing error code in ad7793_setup()
        iio: adc: ad7923: Fix undersized rx buffer.
        iio: adc: ad7768-1: Fix too small buffer passed to iio_push_to_buffers_with_timestamp()
        iio: dac: ad5770r: Put fwnode in error case during ->probe()
        iio: gyro: fxas21002c: balance runtime power in error path
        staging: emxx_udc: fix loop in _nbu2ss_nuke()
        staging: iio: cdc: ad7746: avoid overwrite of num_channels
        iio: adc: ad7192: handle regulator voltage error first
        iio: adc: ad7192: Avoid disabling a clock that was never enabled.
        iio: adc: ad7124: Fix potential overflow due to non sequential channel numbers
        iio: adc: ad7124: Fix missbalanced regulator enable / disable on error.
      494b99f7
    • Linus Torvalds's avatar
      Merge tag 'tty-5.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 3837f9a0
      Linus Torvalds authored
      Pull tty / serial driver fixes from Greg KH:
       "Here are some small fixes for reported problems for tty and serial
        drivers for 5.13-rc4.
      
        They consist of:
      
         - 8250 bugfixes and new device support
      
         - lockdown security mode fixup
      
         - syzbot found problems fixed
      
         - 8250_omap fix for interrupt storm
      
         - revert of 8250_omap driver fix as it caused worse problem than the
           original issue
      
        All but the last patch have been in linux-next for a while, the last
        one is a revert of a problem found in linux-next with the 8250_omap
        driver change"
      
      * tag 'tty-5.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        Revert "serial: 8250: 8250_omap: Fix possible interrupt storm"
        serial: 8250_pci: handle FL_NOIRQ board flag
        serial: rp2: use 'request_firmware' instead of 'request_firmware_nowait'
        serial: 8250_pci: Add support for new HPE serial device
        serial: 8250: 8250_omap: Fix possible interrupt storm
        serial: 8250: Use BIT(x) for UART_{CAP,BUG}_*
        serial: 8250: Add UART_BUG_TXRACE workaround for Aspeed VUART
        serial: 8250_dw: Add device HID for new AMD UART controller
        serial: sh-sci: Fix off-by-one error in FIFO threshold register setting
        serial: core: fix suspicious security_locked_down() call
        serial: tegra: Fix a mask operation that is always true
      3837f9a0
    • Linus Torvalds's avatar
      Merge tag 'usb-5.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 523d0b1e
      Linus Torvalds authored
      Pull USB / Thunderbolt fixes from Greg KH:
       "Here are a number of tiny USB and Thunderbolt driver fixes for
        5.13-rc4.
      
        They consist of:
      
         - thunderbolt fixes for some NVM bound issues
      
         - xhci fixes for reported problems
      
         - control-request fixups
      
         - documentation build warning fixes
      
         - new usb-serial driver device ids
      
         - typec bugfixes for reported issues
      
         - usbfs warning fixups (could be triggered from userspace)
      
         - other tiny fixes for reported problems.
      
        All of these have been in linux-next with no reported issues"
      
      * tag 'usb-5.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (22 commits)
        xhci: Fix 5.12 regression of missing xHC cache clearing command after a Stall
        xhci: fix giving back URB with incorrect status regression in 5.12
        usb: gadget: udc: renesas_usb3: Fix a race in usb3_start_pipen()
        usb: typec: tcpm: Respond Not_Supported if no snk_vdo
        usb: typec: tcpm: Properly interrupt VDM AMS
        USB: trancevibrator: fix control-request direction
        usb: Restore the usb_header label
        usb: typec: tcpm: Use LE to CPU conversion when accessing msg->header
        usb: typec: ucsi: Clear pending after acking connector change
        usb: typec: mux: Fix matching with typec_altmode_desc
        misc/uss720: fix memory leak in uss720_probe
        usb: dwc3: gadget: Properly track pending and queued SG
        USB: usbfs: Don't WARN about excessively large memory allocations
        thunderbolt: usb4: Fix NVM read buffer bounds and offset issue
        thunderbolt: dma_port: Fix NVM read buffer bounds and offset issue
        usb: chipidea: udc: assign interrupt number to USB gadget structure
        usb: cdnsp: Fix lack of removing request from pending list.
        usb: cdns3: Fix runtime PM imbalance on error
        USB: serial: pl2303: add device id for ADLINK ND-6530 GC
        USB: serial: ti_usb_3410_5052: add startech.com device id
        ...
      523d0b1e
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 22447828
      Linus Torvalds authored
      Pull KVM fixes from Paolo Bonzini:
       "ARM fixes:
      
         - Another state update on exit to userspace fix
      
         - Prevent the creation of mixed 32/64 VMs
      
         - Fix regression with irqbypass not restarting the guest on failed
           connect
      
         - Fix regression with debug register decoding resulting in
           overlapping access
      
         - Commit exception state on exit to usrspace
      
         - Fix the MMU notifier return values
      
         - Add missing 'static' qualifiers in the new host stage-2 code
      
        x86 fixes:
      
         - fix guest missed wakeup with assigned devices
      
         - fix WARN reported by syzkaller
      
         - do not use BIT() in UAPI headers
      
         - make the kvm_amd.avic parameter bool
      
        PPC fixes:
      
         - make halt polling heuristics consistent with other architectures
      
        selftests:
      
         - various fixes
      
         - new performance selftest memslot_perf_test
      
         - test UFFD minor faults in demand_paging_test"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (44 commits)
        selftests: kvm: fix overlapping addresses in memslot_perf_test
        KVM: X86: Kill off ctxt->ud
        KVM: X86: Fix warning caused by stale emulation context
        KVM: X86: Use kvm_get_linear_rip() in single-step and #DB/#BP interception
        KVM: x86/mmu: Fix comment mentioning skip_4k
        KVM: VMX: update vcpu posted-interrupt descriptor when assigning device
        KVM: rename KVM_REQ_PENDING_TIMER to KVM_REQ_UNBLOCK
        KVM: x86: add start_assignment hook to kvm_x86_ops
        KVM: LAPIC: Narrow the timer latency between wait_lapic_expire and world switch
        selftests: kvm: do only 1 memslot_perf_test run by default
        KVM: X86: Use _BITUL() macro in UAPI headers
        KVM: selftests: add shared hugetlbfs backing source type
        KVM: selftests: allow using UFFD minor faults for demand paging
        KVM: selftests: create alias mappings when using shared memory
        KVM: selftests: add shmem backing source type
        KVM: selftests: refactor vm_mem_backing_src_type flags
        KVM: selftests: allow different backing source types
        KVM: selftests: compute correct demand paging size
        KVM: selftests: simplify setup_demand_paging error handling
        KVM: selftests: Print a message if /dev/kvm is missing
        ...
      22447828
  2. May 29, 2021
    • Linus Torvalds's avatar
      Merge tag 's390-5.13-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 866c4b8a
      Linus Torvalds authored
      Pull s390 fixes from Vasily Gorbik:
       "Fix races in vfio-ccw request handling"
      
      * tag 's390-5.13-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        vfio-ccw: Serialize FSM IDLE state with I/O completion
        vfio-ccw: Reset FSM state to IDLE inside FSM
        vfio-ccw: Check initialized flag in cp_init()
      866c4b8a
    • Paolo Bonzini's avatar
      selftests: kvm: fix overlapping addresses in memslot_perf_test · 000ac429
      Paolo Bonzini authored
      
      
      vm_create allocates memory and maps it close to GPA.  This memory
      is separate from what is allocated in subsequent calls to
      vm_userspace_mem_region_add, so it is incorrect to pass the
      test memory size to vm_create_default.  Just pass a small
      fixed amount of memory which can be used later for page table,
      otherwise GPAs are already allocated at MEM_GPA and the
      test aborts.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      000ac429
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 6799d4f2
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Ten small fixes, all in drivers"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: target: qla2xxx: Wait for stop_phase1 at WWN removal
        scsi: hisi_sas: Drop free_irq() of devm_request_irq() allocated irq
        scsi: vmw_pvscsi: Set correct residual data length
        scsi: bnx2fc: Return failure if io_req is already in ABTS processing
        scsi: aic7xxx: Remove multiple definition of globals
        scsi: aic7xxx: Restore several defines for aic7xxx firmware build
        scsi: target: iblock: Fix smp_processor_id() BUG messages
        scsi: libsas: Use _safe() loop in sas_resume_port()
        scsi: target: tcmu: Fix xarray RCU warning
        scsi: target: core: Avoid smp_processor_id() in preemptible code
      6799d4f2
    • Linus Torvalds's avatar
      Merge tag 'block-5.13-2021-05-28' of git://git.kernel.dk/linux-block · 0217a27e
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - NVMe pull request (Christoph):
            - fix a memory leak in nvme_cdev_add (Guoqing Jiang)
            - fix inline data size comparison in nvmet_tcp_queue_response (Hou
              Pu)
            - fix false keep-alive timeout when a controller is torn down
              (Sagi Grimberg)
            - fix a nvme-tcp Kconfig dependency (Sagi Grimberg)
            - short-circuit reconnect retries for FC (Hannes Reinecke)
            - decode host pathing error for connect (Hannes Reinecke)
      
       - MD pull request (Song):
            - Fix incorrect chunk boundary assert (Christoph)
      
       - Fix s390/dasd verification panic (Stefan)
      
      * tag 'block-5.13-2021-05-28' of git://git.kernel.dk/linux-block:
        nvmet: fix false keep-alive timeout when a controller is torn down
        nvmet-tcp: fix inline data size comparison in nvmet_tcp_queue_response
        nvme-tcp: remove incorrect Kconfig dep in BLK_DEV_NVME
        md/raid5: remove an incorrect assert in in_chunk_boundary
        s390/dasd: add missing discipline function
        nvme-fabrics: decode host pathing error for connect
        nvme-fc: short-circuit reconnect retries
        nvme: fix potential memory leaks in nvme_cdev_add
      0217a27e
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.13-2021-05-28' of git://git.kernel.dk/linux-block · b3dbbae6
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
       "A few minor fixes:
      
         - Fix an issue with hashed wait removal on exit (Zqiang, Pavel)
      
         - Fix a recent data race introduced in this series (Marco)"
      
      * tag 'io_uring-5.13-2021-05-28' of git://git.kernel.dk/linux-block:
        io_uring: fix data race to avoid potential NULL-deref
        io-wq: Fix UAF when wakeup wqe in hash waitqueue
        io_uring/io-wq: close io-wq full-stop gap
      b3dbbae6
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2021-05-29' of git://anongit.freedesktop.org/drm/drm · 567d1fd8
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Pretty quiet this week, couple of amdgpu, one i915, and a few misc otherwise.
      
        ttm:
         - prevent irrelevant swapout
      
        amdgpu:
         - MultiGPU fan fix
         - VCN powergating fixes
      
        amdkfd:
         - Fix SDMA register offset error
      
        meson:
         - fix shutdown crash
      
        i915:
         - Re-enable LTTPR non-transparent LT mode for DPCD_REV < 1.4"
      
      * tag 'drm-fixes-2021-05-29' of git://anongit.freedesktop.org/drm/drm:
        drm/ttm: Skip swapout if ttm object is not populated
        drm/i915: Reenable LTTPR non-transparent LT mode for DPCD_REV<1.4
        drm/meson: fix shutdown crash when component not probed
        drm/amdgpu/jpeg3: add cancel_delayed_work_sync before power gate
        drm/amdgpu/jpeg2.5: add cancel_delayed_work_sync before power gate
        drm/amdgpu/jpeg2.0: add cancel_delayed_work_sync before power gate
        drm/amdgpu/vcn3: add cancel_delayed_work_sync before power gate
        drm/amdgpu/vcn2.5: add cancel_delayed_work_sync before power gate
        drm/amdgpu/vcn2.0: add cancel_delayed_work_sync before power gate
        drm/amdgpu/vcn1: add cancel_delayed_work_sync before power gate
        drm/amdkfd: correct sienna_cichlid SDMA RLC register offset error
        drm/amd/pm: correct MGpuFanBoost setting
      567d1fd8
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-fixes-for-v5.13-2021-05-28' of... · f289d990
      Linus Torvalds authored
      Merge tag 'perf-tools-fixes-for-v5.13-2021-05-28' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull perf tools fixes from Arnaldo Carvalho de Melo:
      
       - Fix error checking of BPF prog attachment in 'perf stat'.
      
       - Fix getting maximum number of fds in the vendor events JSON parser.
      
       - Move debug initialization earlier, fixing a segfault in some cases.
      
       - Fix eventcode of power10 JSON events.
      
      * tag 'perf-tools-fixes-for-v5.13-2021-05-28' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
        perf vendor events powerpc: Fix eventcode of power10 JSON events
        perf stat: Fix error check for bpf_program__attach
        perf debug: Move debug initialization earlier
        perf jevents: Fix getting maximum number of fds
      f289d990
    • Linus Torvalds's avatar
      Merge tag '5.13-rc4-smb3' of git://git.samba.org/sfrench/cifs-2.6 · 7c0ec89d
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
       "Three SMB3 fixes.
      
        Two for stable, and the other fixes a problem pointed out with a
        recently added ioctl"
      
      * tag '5.13-rc4-smb3' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: change format of CIFS_FULL_KEY_DUMP ioctl
        cifs: fix string declarations and assignments in tracepoints
        cifs: set server->cipher_type to AES-128-CCM for SMB3.0
      7c0ec89d
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-5.13-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs · 5ff2756a
      Linus Torvalds authored
      Pull NFS client bugfixes from Trond Myklebust:
      "Stable fixes:
         - Fix v4.0/v4.1 SEEK_DATA return -ENOTSUPP when set NFS_V4_2 config
         - Fix Oops in xs_tcp_send_request() when transport is disconnected
         - Fix a NULL pointer dereference in pnfs_mark_matching_lsegs_return()
      
        Bugfixes:
         - Fix instances where signal_pending() should be fatal_signal_pending()
         - fix an incorrect limit in filelayout_decode_layout()
         - Fixes for the SUNRPC backlogged RPC queue
         - Don't corrupt the value of pg_bytes_written in nfs_do_recoalesce()
         - Revert commit 586a0787 ("Clean up rpcrdma_prepare_readch()")"
      
      * tag 'nfs-for-5.13-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
        nfs: Remove trailing semicolon in macros
        xprtrdma: Revert 586a0787
        NFSv4: Fix v4.0/v4.1 SEEK_DATA return -ENOTSUPP when set NFS_V4_2 config
        NFS: Clean up reset of the mirror accounting variables
        NFS: Don't corrupt the value of pg_bytes_written in nfs_do_recoalesce()
        NFS: Fix an Oopsable condition in __nfs_pageio_add_request()
        SUNRPC: More fixes for backlog congestion
        SUNRPC: Fix Oops in xs_tcp_send_request() when transport is disconnected
        NFSv4: Fix a NULL pointer dereference in pnfs_mark_matching_lsegs_return()
        SUNRPC in case of backlog, hand free slots directly to waiting task
        pNFS/NFSv4: Remove redundant initialization of 'rd_size'
        NFS: fix an incorrect limit in filelayout_decode_layout()
        fs/nfs: Use fatal_signal_pending instead of signal_pending
      5ff2756a
    • Linus Torvalds's avatar
      Merge tag 'sound-5.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · fc683f96
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "A slightly high volume at this time due to pending ASoC fixes.
      
        While there are a few generic simple-card fixes for regressions, most
        of the changes are device-specific fixes: ASoC Intel SOF, codec
        clocks, other codec / platform fixes as well as usual HD-audio and
        USB-audio"
      
      * tag 'sound-5.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (37 commits)
        ALSA: hda/realtek: fix mute/micmute LEDs and speaker for HP Zbook Fury 17 G8
        ALSA: hda/realtek: fix mute/micmute LEDs and speaker for HP Zbook Fury 15 G8
        ALSA: hda/realtek: fix mute/micmute LEDs and speaker for HP Zbook G8
        ALSA: hda/realtek: fix mute/micmute LEDs for HP 855 G8
        ALSA: hda/realtek: Chain in pop reduction fixup for ThinkStation P340
        ALSA: usb-audio: scarlett2: snd_scarlett_gen2_controls_create() can be static
        ALSA: hda/realtek: the bass speaker can't output sound on Yoga 9i
        ALSA: hda/realtek: Headphone volume is controlled by Front mixer
        ALSA: usb-audio: scarlett2: Improve driver startup messages
        ALSA: usb-audio: scarlett2: Fix device hang with ehci-pci
        ALSA: usb-audio: fix control-request direction
        ASoC: qcom: lpass-cpu: Use optional clk APIs
        ASoC: cs35l33: fix an error code in probe()
        ASoC: SOF: Intel: hda: don't send DAI_CONFIG IPC for older firmware
        ASoC: fsl: fix SND_SOC_IMX_RPMSG dependency
        ASoC: cs42l52: Minor tidy up of error paths
        ASoC: cs35l32: Add missing regmap use_single config
        ASoC: cs35l34: Add missing regmap use_single config
        ASoC: cs42l73: Add missing regmap use_single config
        ASoC: cs53l30: Add missing regmap use_single config
        ...
      fc683f96
    • Linus Torvalds's avatar
      Merge tag 'clang-features-v5.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · 8508b97a
      Linus Torvalds authored
      Pull clang feature fixes from Kees Cook:
      
       - Correctly pass stack frame size checking under LTO (Nick Desaulniers)
      
       - Avoid CFI mismatches by checking initcall_t types (Marco Elver)
      
      * tag 'clang-features-v5.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        Makefile: LTO: have linker check -Wframe-larger-than
        init: verify that function is initcall_t at compile-time
      8508b97a
    • Linus Torvalds's avatar
      Merge tag 'mips-fixes_5.13_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux · afdd1470
      Linus Torvalds authored
      Pull MIPS fixes from Thomas Bogendoerfer:
      
       - fix function/preempt trace hangs
      
       - a few build fixes
      
      * tag 'mips-fixes_5.13_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
        MIPS: Fix kernel hang under FUNCTION_GRAPH_TRACER and PREEMPT_TRACER
        MIPS: ralink: export rt_sysc_membase for rt2880_wdt.c
        MIPS: launch.h: add include guard to prevent build errors
        MIPS: alchemy: xxs1500: add gpio-au1000.h header file
      afdd1470
    • Paolo Bonzini's avatar
      Merge tag 'kvmarm-fixes-5.13-2' of... · a3d2ec9d
      Paolo Bonzini authored
      Merge tag 'kvmarm-fixes-5.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD
      
      KVM/arm64 fixes for 5.13, take #2
      
      - Another state update on exit to userspace fix
      - Prevent the creation of mixed 32/64 VMs
      a3d2ec9d
    • Wanpeng Li's avatar
      KVM: X86: Kill off ctxt->ud · b35491e6
      Wanpeng Li authored
      
      
      ctxt->ud is consumed only by x86_decode_insn(), we can kill it off by
      passing emulation_type to x86_decode_insn() and dropping ctxt->ud
      altogether. Tracking that info in ctxt for literally one call is silly.
      
      Suggested-by: default avatarSean Christopherson <seanjc@google.com>
      Signed-off-by: default avatarWanpeng Li <wanpengli@tencent.com>
      Reviewed-by: default avatarSean Christopherson <seanjc@google.com>
      Message-Id: <1622160097-37633-2-git-send-email-wanpengli@tencent.com>
      b35491e6
    • Wanpeng Li's avatar
      KVM: X86: Fix warning caused by stale emulation context · da6393cd
      Wanpeng Li authored
      Reported by syzkaller:
      
        WARNING: CPU: 7 PID: 10526 at linux/arch/x86/kvm//x86.c:7621 x86_emulate_instruction+0x41b/0x510 [kvm]
        RIP: 0010:x86_emulate_instruction+0x41b/0x510 [kvm]
        Call Trace:
         kvm_mmu_page_fault+0x126/0x8f0 [kvm]
         vmx_handle_exit+0x11e/0x680 [kvm_intel]
         vcpu_enter_guest+0xd95/0x1b40 [kvm]
         kvm_arch_vcpu_ioctl_run+0x377/0x6a0 [kvm]
         kvm_vcpu_ioctl+0x389/0x630 [kvm]
         __x64_sys_ioctl+0x8e/0xd0
         do_syscall_64+0x3c/0xb0
         entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      Commit 4a1e10d5 ("KVM: x86: handle hardware breakpoints during emulation())
      adds hardware breakpoints check before emulation the instruction and parts of
      emulation context initialization, actually we don't have the EMULTYPE_NO_DECODE flag
      here and the emulation context will not be reused. Commit c8848cee ("KVM: x86:
      set ctxt->have_exception in x86_decode_insn()) triggers the warning because it
      catches the stale emulation context has #UD, however, it is not during instruction
      decoding which should result in EMULATION_FAILED. This patch fixes it by moving
      the second part emulation context initialization into init_emulate_ctxt() and
      before hardware breakpoints check. The ctxt->ud will be dropped by a follow-up
      patch.
      
      syzkaller source: https://syzkaller.appspot.com/x/repro.c?x=134683fdd00000
      
      
      
      Reported-by: default avatar <syzbot+71271244f206d17f6441@syzkaller.appspotmail.com>
      Fixes: 4a1e10d5
      
       (KVM: x86: handle hardware breakpoints during emulation)
      Signed-off-by: default avatarWanpeng Li <wanpengli@tencent.com>
      Reviewed-by: default avatarSean Christopherson <seanjc@google.com>
      Message-Id: <1622160097-37633-1-git-send-email-wanpengli@tencent.com>
      da6393cd
    • Yuan Yao's avatar
      KVM: X86: Use kvm_get_linear_rip() in single-step and #DB/#BP interception · e87e46d5
      Yuan Yao authored
      
      
      The kvm_get_linear_rip() handles x86/long mode cases well and has
      better readability, __kvm_set_rflags() also use the paired
      function kvm_is_linear_rip() to check the vcpu->arch.singlestep_rip
      set in kvm_arch_vcpu_ioctl_set_guest_debug(), so change the
      "CS.BASE + RIP" code in kvm_arch_vcpu_ioctl_set_guest_debug() and
      handle_exception_nmi() to this one.
      
      Signed-off-by: default avatarYuan Yao <yuan.yao@intel.com>
      Message-Id: <20210526063828.1173-1-yuan.yao@linux.intel.com>
      Reviewed-by: default avatarSean Christopherson <seanjc@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      e87e46d5
  3. May 28, 2021
  4. May 27, 2021
    • Rolf Eike Beer's avatar
      iommu/vt-d: Fix sysfs leak in alloc_iommu() · 0ee74d5a
      Rolf Eike Beer authored
      iommu_device_sysfs_add() is called before, so is has to be cleaned on subsequent
      errors.
      
      Fixes: 39ab9555
      
       ("iommu: Add sysfs bindings for struct iommu_device")
      Cc: stable@vger.kernel.org # 4.11.x
      Signed-off-by: default avatarRolf Eike Beer <eb@emlix.com>
      Acked-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
      Link: https://lore.kernel.org/r/17411490.HIIP88n32C@mobilepool36.emlix.com
      Link: https://lore.kernel.org/r/20210525070802.361755-2-baolu.lu@linux.intel.com
      
      
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      0ee74d5a
    • Marco Elver's avatar
      io_uring: fix data race to avoid potential NULL-deref · b16ef427
      Marco Elver authored
      Commit ba5ef6dc ("io_uring: fortify tctx/io_wq cleanup") introduced
      setting tctx->io_wq to NULL a bit earlier. This has caused KCSAN to
      detect a data race between accesses to tctx->io_wq:
      
        write to 0xffff88811d8df330 of 8 bytes by task 3709 on cpu 1:
         io_uring_clean_tctx                  fs/io_uring.c:9042 [inline]
         __io_uring_cancel                    fs/io_uring.c:9136
         io_uring_files_cancel                include/linux/io_uring.h:16 [inline]
         do_exit                              kernel/exit.c:781
         do_group_exit                        kernel/exit.c:923
         get_signal                           kernel/signal.c:2835
         arch_do_signal_or_restart            arch/x86/kernel/signal.c:789
         handle_signal_work                   kernel/entry/common.c:147 [inline]
         exit_to_user_mode_loop               kernel/entry/common.c:171 [inline]
         ...
        read to 0xffff88811d8df330 of 8 bytes by task 6412 on cpu 0:
         io_uring_try_cancel_iowq             fs/io_uring.c:8911 [inline]
         io_uring_try_cancel_requests         fs/io_uring.c:8933
         io_ring_exit_work                    fs/io_uring.c:8736
         process_one_work                     kernel/workqueue.c:2276
         ...
      
      With the config used, KCSAN only reports data races with value changes:
      this implies that in the case here we also know that tctx->io_wq was
      non-NULL. Therefore, depending on interleaving, we may end up with:
      
                    [CPU 0]                 |        [CPU 1]
        io_uring_try_cancel_iowq()          | io_uring_clean_tctx()
          if (!tctx->io_wq) // false        |   ...
          ...                               |   tctx->io_wq = NULL
          io_wq_cancel_cb(tctx->io_wq, ...) |   ...
            -> NULL-deref                   |
      
      Note: It is likely that thus far we've gotten lucky and the compiler
      optimizes the double-read into a single read into a register -- but this
      is never guaranteed, and can easily change with a different config!
      
      Fix the data race by restoring the previous behaviour, where both
      setting io_wq to NULL and put of the wq are _serialized_ after
      concurrent io_uring_try_cancel_iowq() via acquisition of the uring_lock
      and removal of the node in io_uring_del_task_file().
      
      Fixes: ba5ef6dc
      
       ("io_uring: fortify tctx/io_wq cleanup")
      Suggested-by: default avatarPavel Begunkov <asml.silence@gmail.com>
      Reported-by: default avatar <syzbot+bf2b3d0435b9b728946c@syzkaller.appspotmail.com>
      Signed-off-by: default avatarMarco Elver <elver@google.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Link: https://lore.kernel.org/r/20210527092547.2656514-1-elver@google.com
      
      
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      b16ef427
    • Jens Axboe's avatar
      Merge tag 'nvme-5.13-2021-05-27' of git://git.infradead.org/nvme into block-5.13 · a4b58f17
      Jens Axboe authored
      Pull NVMe fixes from Christoph:
      
      "nvme fixes for Linux 5.13
      
       - fix a memory leak in nvme_cdev_add (Guoqing Jiang)
       - fix inline data size comparison in nvmet_tcp_queue_response (Hou Pu)
       - fix false keep-alive timeout when a controller is torn down
         (Sagi Grimberg)
       - fix a nvme-tcp Kconfig dependency (Sagi Grimberg)
       - short-circuit reconnect retries for FC (Hannes Reinecke)
       - decode host pathing error for connect (Hannes Reinecke)"
      
      * tag 'nvme-5.13-2021-05-27' of git://git.infradead.org/nvme:
        nvmet: fix false keep-alive timeout when a controller is torn down
        nvmet-tcp: fix inline data size comparison in nvmet_tcp_queue_response
        nvme-tcp: remove incorrect Kconfig dep in BLK_DEV_NVME
        nvme-fabrics: decode host pathing error for connect
        nvme-fc: short-circuit reconnect retries
        nvme: fix potential memory leaks in nvme_cdev_add
      a4b58f17