Skip to content
  1. May 14, 2021
    • Linus Torvalds's avatar
      Merge tag 'pm-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 315d9931
      Linus Torvalds authored
      Pull power management fixes from Rafael Wysocki:
       "These close a coverage gap in the intel_pstate driver and fix runtime
        PM child count imbalance related to interactions with system-wide
        suspend.
      
        Specifics:
      
         - Make intel_pstate work as expected on systems where the platform
           firmware enables HWP even though the HWP EPP support is not
           advertised (Rafael Wysocki).
      
         - Fix possible runtime PM child count imbalance that may occur if
           other runtime PM functions are called after invoking
           pm_runtime_force_suspend() and before pm_runtime_force_resume()
           is called (Tony Lindgren)"
      
      * tag 'pm-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        PM: runtime: Fix unpaired parent child_count for force_resume
        cpufreq: intel_pstate: Use HWP if enabled by platform firmware
      315d9931
    • Linus Torvalds's avatar
      Merge tag 'acpi-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 2df38a8e
      Linus Torvalds authored
      Pull ACPI fixes from Rafael Wysocki:
       "These revert an unnecessary revert of an ACPI power management commit,
        add a missing device ID to one of the lists and fix a possible memory
        leak in an error path.
      
        Specifics:
      
         - Revert a revert of a recent ACPI power management change that does
           not need to be reverted after all (Rafael Wysocki).
      
         - Add missing fan device ID to the list of device IDs for which the
           devices should not be put into the ACPI PM domain (Sumeet
           Pawnikar).
      
         - Fix possible memory leak in an error path in the ACPI device
           enumeration code (Christophe JAILLET)"
      
      * tag 'acpi-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI: PM: Add ACPI ID of Alder Lake Fan
        ACPI: scan: Fix a memory leak in an error handling path
        Revert "Revert "ACPI: scan: Turn off unused power resources during initialization""
      2df38a8e
    • Rafael J. Wysocki's avatar
      Merge branch 'acpi-pm' · fd386517
      Rafael J. Wysocki authored
      * acpi-pm:
        ACPI: PM: Add ACPI ID of Alder Lake Fan
        Revert "Revert "ACPI: scan: Turn off unused power resources during initialization""
      fd386517
    • Rafael J. Wysocki's avatar
      Merge branch 'pm-core' · 78a6948b
      Rafael J. Wysocki authored
      * pm-core:
        PM: runtime: Fix unpaired parent child_count for force_resume
      78a6948b
    • Linus Torvalds's avatar
      Merge branch 'resizex' (patches from Maciej) · adc12a74
      Linus Torvalds authored
      Merge VT_RESIZEX fixes from Maciej Rozycki:
       "I got to the bottom of the issue with VT_RESIZEX recently discussed
        and came up with this small patch series, fixing an additional issue
        that I originally thought might be broken VGA hardware emulation with
        my laptop, which however turned out to be intertwined with the
        original problem and also a regression introduced somewhat later.
      
        The fix for that because the first patch, and then to make backporting
        feasible I had to put a revert of the offending change from last
        September next, followed by a proper fix for the framebuffer issue
        that change had tried to address.
      
        See individual change descriptions for details.
      
        These have been verified with true VGA hardware (a Trident TVGA8900
        ISA video adapter) using various combinations of `svgatextmode' and
        `setfont' command invocations to change both the VT size and the font
        size, and also switching between the text console and X11, both by
        starting/stopping the X server and by switching between VTs.
      
        All this to ensure bringing the behaviour of VGA text console back to
        correct operation as it used to be with Linux 2.6.18"
      
      * emailed patches from Maciej W. Rozycki <macro@orcam.me.uk>:
        vt: Fix character height handling with VT_RESIZEX
        vt_ioctl: Revert VT_RESIZEX parameter handling removal
        vgacon: Record video mode changes with VT_RESIZEX
      adc12a74
    • Maciej W. Rozycki's avatar
      vt: Fix character height handling with VT_RESIZEX · 860dafa9
      Maciej W. Rozycki authored
      Restore the original intent of the VT_RESIZEX ioctl's `v_clin' parameter
      which is the number of pixel rows per character (cell) rather than the
      height of the font used.
      
      For framebuffer devices the two values are always the same, because the
      former is inferred from the latter one.  For VGA used as a true text
      mode device these two parameters are independent from each other: the
      number of pixel rows per character is set in the CRT controller, while
      font height is in fact hardwired to 32 pixel rows and fonts of heights
      below that value are handled by padding their data with blanks when
      loaded to hardware for use by the character generator.  One can change
      the setting in the CRT controller and it will update the screen contents
      accordingly regardless of the font loaded.
      
      The `v_clin' parameter is used by the `vgacon' driver to set the height
      of the character cell and then the cursor position within.  Make the
      parameter explicit then, by defining a new `vc_cell_height' struct
      member of `vc_data', set it instead of `vc_font.height' from `v_clin' in
      the VT_RESIZEX ioctl, and then use it throughout the `vgacon' driver
      except where actual font data is accessed which as noted above is
      independent from the CRTC setting.
      
      This way the framebuffer console driver is free to ignore the `v_clin'
      parameter as irrelevant, as it always should have, avoiding any issues
      attempts to give the parameter a meaning there could have caused, such
      as one that has led to commit 988d0763 ("vt_ioctl: make VT_RESIZEX
      behave like VT_RESIZE"):
      
       "syzbot is reporting UAF/OOB read at bit_putcs()/soft_cursor() [1][2],
        for vt_resizex() from ioctl(VT_RESIZEX) allows setting font height
        larger than actual font height calculated by con_font_set() from
        ioctl(PIO_FONT). Since fbcon_set_font() from con_font_set() allocates
        minimal amount of memory based on actual font height calculated by
        con_font_set(), use of vt_resizex() can cause UAF/OOB read for font
        data."
      
      The problem first appeared around Linux 2.5.66 which predates our repo
      history, but the origin could be identified with the old MIPS/Linux repo
      also at: <git://git.kernel.org/pub/scm/linux/kernel/git/ralf/linux.git>
      as commit 9736a3546de7 ("Merge with Linux 2.5.66."), where VT_RESIZEX
      code in `vt_ioctl' was updated as follows:
      
       		if (clin)
      -			video_font_height = clin;
      +			vc->vc_font.height = clin;
      
      making the parameter apply to framebuffer devices as well, perhaps due
      to the use of "font" in the name of the original `video_font_height'
      variable.  Use "cell" in the new struct member then to avoid ambiguity.
      
      References:
      
      [1] https://syzkaller.appspot.com/bug?id=32577e96d88447ded2d3b76d71254fb855245837
      [2] https://syzkaller.appspot.com/bug?id=6b8355d27b2b94fb5cedf4655e3a59162d9e48e3
      
      
      
      Signed-off-by: default avatarMaciej W. Rozycki <macro@orcam.me.uk>
      Fixes: 1da177e4
      
       ("Linux-2.6.12-rc2")
      Cc: stable@vger.kernel.org # v2.6.12+
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      860dafa9
    • Maciej W. Rozycki's avatar
      vt_ioctl: Revert VT_RESIZEX parameter handling removal · a90c275e
      Maciej W. Rozycki authored
      
      
      Revert the removal of code handling extra VT_RESIZEX ioctl's parameters
      beyond those that VT_RESIZE supports, fixing a functional regression
      causing `svgatextmode' not to resize the VT anymore.
      
      As a consequence of the reverted change when the video adapter is
      reprogrammed from the original say 80x25 text mode using a 9x16
      character cell (720x400 pixel resolution) to say 80x37 text mode and the
      same character cell (720x592 pixel resolution), the VT geometry does not
      get updated and only upper two thirds of the screen are used for the VT,
      and the lower part remains blank.  The proportions change according to
      text mode geometries chosen.
      
      Revert the change verbatim then, bringing back previous VT resizing.
      
      Signed-off-by: default avatarMaciej W. Rozycki <macro@orcam.me.uk>
      Fixes: 988d0763
      
       ("vt_ioctl: make VT_RESIZEX behave like VT_RESIZE")
      Cc: stable@vger.kernel.org # v5.10+
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a90c275e
    • Maciej W. Rozycki's avatar
      vgacon: Record video mode changes with VT_RESIZEX · d4d0ad57
      Maciej W. Rozycki authored
      
      
      Fix an issue with VGA console font size changes made after the initial
      video text mode has been changed with a user tool like `svgatextmode'
      calling the VT_RESIZEX ioctl.  As it stands in that case the original
      screen geometry continues being used to validate further VT resizing.
      
      Consequently when the video adapter is firstly reprogrammed from the
      original say 80x25 text mode using a 9x16 character cell (720x400 pixel
      resolution) to say 80x37 text mode and the same character cell (720x592
      pixel resolution), and secondly the CRTC character cell updated to 9x8
      (by loading a suitable font with the KD_FONT_OP_SET request of the
      KDFONTOP ioctl), the VT geometry does not get further updated from 80x37
      and only upper half of the screen is used for the VT, with the lower
      half showing rubbish corresponding to whatever happens to be there in
      the video memory that maps to that part of the screen.  Of course the
      proportions change according to text mode geometries and font sizes
      chosen.
      
      Address the problem then, by updating the text mode geometry defaults
      rather than checking against them whenever the VT is resized via a user
      ioctl.
      
      Signed-off-by: default avatarMaciej W. Rozycki <macro@orcam.me.uk>
      Fixes: e400b6ec
      
       ("vt/vgacon: Check if screen resize request comes from userspace")
      Cc: stable@vger.kernel.org # v2.6.24+
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d4d0ad57
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-v5.13-rc2' of... · d1e7c13a
      Linus Torvalds authored
      Merge tag 'hwmon-for-v5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull hwmon fixes from Guenter Roeck:
       "Fix bugs/regressions in adm9240, ltc2992, pmbus/fsp-3y, and occ
        drivers, plus a minor cleanup in the corsair-psu driver"
      
      * tag 'hwmon-for-v5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (adm9240) Fix writes into inX_max attributes
        hwmon: (ltc2992) Put fwnode in error case during ->probe()
        hwmon: (pmbus/fsp-3y) Fix FSP-3Y YH-5151E non-compliant vout encoding
        hwmon: (occ) Fix poll rate limiting
        hwmon: (corsair-psu) Remove unneeded semicolons
      d1e7c13a
  2. May 13, 2021
  3. May 12, 2021
  4. May 11, 2021
    • Ritesh Harjani's avatar
      btrfs: handle transaction start error in btrfs_fileattr_set · 9b8a233b
      Ritesh Harjani authored
      Add error handling in btrfs_fileattr_set in case of an error while
      starting a transaction. This fixes btrfs/232 which otherwise used to
      fail with below signature on Power.
      
        btrfs/232 [ 1119.474650] run fstests btrfs/232 at 2021-04-21 02:21:22
        <...>
        [ 1366.638585] BUG: Unable to handle kernel data access on read at 0xffffffffffffff86
        [ 1366.638768] Faulting instruction address: 0xc0000000009a5c88
        cpu 0x0: Vector: 380 (Data SLB Access) at [c000000014f177b0]
            pc: c0000000009a5c88: btrfs_update_root_times+0x58/0xc0
            lr: c0000000009a5c84: btrfs_update_root_times+0x54/0xc0
            <...>
            pid   = 24881, comm = fsstress
      	   btrfs_update_inode+0xa0/0x140
      	   btrfs_fileattr_set+0x5d0/0x6f0
      	   vfs_fileattr_set+0x2a8/0x390
      	   do_vfs_ioctl+0x1290/0x1ac0
      	   sys_ioctl+0x6c/0x120
      	   system_call_exception+0x3d4/0x410
      	   system_call_common+0xec/0x278
      
      Fixes: 97fc2977
      
       ("btrfs: convert to fileattr")
      Signed-off-by: default avatarRitesh Harjani <riteshh@linux.ibm.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      9b8a233b
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-fixes-for-v5.13-2021-05-10' of... · 1140ab59
      Linus Torvalds authored
      Merge tag 'perf-tools-fixes-for-v5.13-2021-05-10' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull perf tools fixes from Arnaldo Carvalho de Melo:
      
       - Fix swapping of cpu_map and stat_config records.
      
       - Fix dynamic libbpf linking.
      
       - Disallow -c and -F option at the same time in 'perf record'.
      
       - Update headers with the kernel originals.
      
       - Silence warning for JSON ArchStd files.
      
       - Fix a build error on arm64 with clang.
      
      * tag 'perf-tools-fixes-for-v5.13-2021-05-10' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
        tools headers UAPI: Sync perf_event.h with the kernel sources
        tools headers cpufeatures: Sync with the kernel sources
        tools include UAPI powerpc: Sync errno.h with the kernel headers
        tools arch: Update arch/x86/lib/mem{cpy,set}_64.S copies used in 'perf bench mem memcpy'
        tools headers UAPI: Sync linux/prctl.h with the kernel sources
        tools headers UAPI: Sync files changed by landlock, quotactl_path and mount_settattr new syscalls
        perf tools: Fix a build error on arm64 with clang
        tools headers kvm: Sync kvm headers with the kernel sources
        tools headers UAPI: Sync linux/kvm.h with the kernel sources
        perf tools: Fix dynamic libbpf link
        perf session: Fix swapping of cpu_map and stat_config records
        perf jevents: Silence warning for ArchStd files
        perf record: Disallow -c and -F option at the same time
        tools arch x86: Sync the msr-index.h copy with the kernel sources
        tools headers UAPI: Sync drm/i915_drm.h with the kernel sources
        tools headers UAPI: Update tools's copy of drm.h headers
      1140ab59
    • Randy Dunlap's avatar
      Documentation: drop optional BOMs · 9e255e2b
      Randy Dunlap authored
      A few of the Documentation .rst files begin with a Unicode
      byte order mark (BOM). The BOM may signify endianess for
      16-bit or 32-bit encodings or indicate that the text stream
      is indeed Unicode. We don't need it for either of those uses.
      It may also interfere with (confuse) some software.
      
      Since we don't need it and its use is optional, just delete
      the uses of it in Documentation/.
      
      https://en.wikipedia.org/wiki/Byte_order_mark
      
      
      
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Reviewed-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
      Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
      Link: https://lore.kernel.org/r/20210506231907.14359-1-rdunlap@infradead.org
      
      
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      9e255e2b
    • Wan Jiabing's avatar
      docs/zh_CN: Remove obsolete translation file · bf9e262f
      Wan Jiabing authored
      This translation file was replaced by
         Documentation/translations/zh_CN/admin-guide/security-bugs.rst
      which was created in commit 2d153571
      
       ("docs/zh_CN: Add
      zh_CN/admin-guide/security-bugs.rst").
      This is a translation left over from history. Remove it.
      
      Signed-off-by: default avatarWan Jiabing <wanjiabing@vivo.com>
      Acked-by: default avatarWu XiangCheng <bobwxc@email.cn>
      Link: https://lore.kernel.org/r/20210508030741.82655-1-wanjiabing@vivo.com
      
      
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      bf9e262f
    • Linus Torvalds's avatar
      Merge tag 'for-5.13-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 142b507f
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
       "First batch of various fixes, here's a list of notable ones:
      
         - fix unmountable seed device after fstrim
      
         - fix silent data loss in zoned mode due to ordered extent splitting
      
         - fix race leading to unpersisted data and metadata on fsync
      
         - fix deadlock when cloning inline extents and using qgroups"
      
      * tag 'for-5.13-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: initialize return variable in cleanup_free_space_cache_v1
        btrfs: zoned: sanity check zone type
        btrfs: fix unmountable seed device after fstrim
        btrfs: fix deadlock when cloning inline extents and using qgroups
        btrfs: fix race leading to unpersisted data and metadata on fsync
        btrfs: do not consider send context as valid when trying to flush qgroups
        btrfs: zoned: fix silent data loss after failure splitting ordered extent
      142b507f
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 0aa099a3
      Linus Torvalds authored
      Pull kvm fixes from Paolo Bonzini:
      
       - Lots of bug fixes.
      
       - Fix virtualization of RDPID
      
       - Virtualization of DR6_BUS_LOCK, which on bare metal is new to this
         release
      
       - More nested virtualization migration fixes (nSVM and eVMCS)
      
       - Fix for KVM guest hibernation
      
       - Fix for warning in SEV-ES SRCU usage
      
       - Block KVM from loading on AMD machines with 5-level page tables, due
         to the APM not mentioning how host CR4.LA57 exactly impacts the
         guest.
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (48 commits)
        KVM: SVM: Move GHCB unmapping to fix RCU warning
        KVM: SVM: Invert user pointer casting in SEV {en,de}crypt helpers
        kvm: Cap halt polling at kvm->max_halt_poll_ns
        tools/kvm_stat: Fix documentation typo
        KVM: x86: Prevent deadlock against tk_core.seq
        KVM: x86: Cancel pvclock_gtod_work on module removal
        KVM: x86: Prevent KVM SVM from loading on kernels with 5-level paging
        KVM: X86: Expose bus lock debug exception to guest
        KVM: X86: Add support for the emulation of DR6_BUS_LOCK bit
        KVM: PPC: Book3S HV: Fix conversion to gfn-based MMU notifier callbacks
        KVM: x86: Hide RDTSCP and RDPID if MSR_TSC_AUX probing failed
        KVM: x86: Tie Intel and AMD behavior for MSR_TSC_AUX to guest CPU model
        KVM: x86: Move uret MSR slot management to common x86
        KVM: x86: Export the number of uret MSRs to vendor modules
        KVM: VMX: Disable loading of TSX_CTRL MSR the more conventional way
        KVM: VMX: Use common x86's uret MSR list as the one true list
        KVM: VMX: Use flag to indicate "active" uret MSRs instead of sorting list
        KVM: VMX: Configure list of user return MSRs at module init
        KVM: x86: Add support for RDPID without RDTSCP
        KVM: SVM: Probe and load MSR_TSC_AUX regardless of RDTSCP support in host
        ...
      0aa099a3
    • Tony Lindgren's avatar
      PM: runtime: Fix unpaired parent child_count for force_resume · c745253e
      Tony Lindgren authored
      As pm_runtime_need_not_resume() relies also on usage_count, it can return
      a different value in pm_runtime_force_suspend() compared to when called in
      pm_runtime_force_resume(). Different return values can happen if anything
      calls PM runtime functions in between, and causes the parent child_count
      to increase on every resume.
      
      So far I've seen the issue only for omapdrm that does complicated things
      with PM runtime calls during system suspend for legacy reasons:
      
      omap_atomic_commit_tail() for omapdrm.0
       dispc_runtime_get()
        wakes up 58000000.dss as it's the dispc parent
         dispc_runtime_resume()
          rpm_resume() increases parent child_count
       dispc_runtime_put() won't idle, PM runtime suspend blocked
      pm_runtime_force_suspend() for 58000000.dss, !pm_runtime_need_not_resume()
       __update_runtime_status()
      system suspended
      pm_runtime_force_resume() for 58000000.dss, pm_runtime_need_not_resume()
       pm_runtime_enable() only called because of pm_runtime_need_not_resume()
      omap_atomic_commit_tail() for omapdrm.0
       dispc_runtime_get()
        wakes up 58000000.dss as it's the dispc parent
         dispc_runtime_resume()
          rpm_resume() increases parent child_count
       dispc_runtime_put() won't idle, PM runtime suspend blocked
      ...
      rpm_suspend for 58000000.dss but parent child_count is now unbalanced
      
      Let's fix the issue by adding a flag for needs_force_resume and use it in
      pm_runtime_force_resume() instead of pm_runtime_need_not_resume().
      
      Additionally omapdrm system suspend could be simplified later on to avoid
      lots of unnecessary PM runtime calls and the complexity it adds. The
      driver can just use internal functions that are shared between the PM
      runtime and system suspend related functions.
      
      Fixes: 4918e1f8
      
       ("PM / runtime: Rework pm_runtime_force_suspend/resume()")
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      Reviewed-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      Tested-by: default avatarTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
      Cc: 4.16+ <stable@vger.kernel.org> # 4.16+
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      c745253e
    • Christophe JAILLET's avatar
      ACPI: scan: Fix a memory leak in an error handling path · 0c8bd174
      Christophe JAILLET authored
      If 'acpi_device_set_name()' fails, we must free
      'acpi_device_bus_id->bus_id' or there is a (potential) memory leak.
      
      Fixes: eb50aaf9
      
       ("ACPI: scan: Use unique number for instance_no")
      Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0c8bd174
  5. May 10, 2021