Commit graph

1201958 commits

Author SHA1 Message Date
Sean Christopherson
ba5ca5e5e6 x86/retpoline: Don't clobber RFLAGS during srso_safe_ret()
Use LEA instead of ADD when adjusting %rsp in srso_safe_ret{,_alias}()
so as to avoid clobbering flags.  Drop one of the INT3 instructions to
account for the LEA consuming one more byte than the ADD.

KVM's emulator makes indirect calls into a jump table of sorts, where
the destination of each call is a small blob of code that performs fast
emulation by executing the target instruction with fixed operands.

E.g. to emulate ADC, fastop() invokes adcb_al_dl():

  adcb_al_dl:
    <+0>:  adc    %dl,%al
    <+2>:  jmp    <__x86_return_thunk>

A major motivation for doing fast emulation is to leverage the CPU to
handle consumption and manipulation of arithmetic flags, i.e. RFLAGS is
both an input and output to the target of the call.  fastop() collects
the RFLAGS result by pushing RFLAGS onto the stack and popping them back
into a variable (held in %rdi in this case):

  asm("push %[flags]; popf; " CALL_NOSPEC " ; pushf; pop %[flags]\n"

  <+71>: mov    0xc0(%r8),%rdx
  <+78>: mov    0x100(%r8),%rcx
  <+85>: push   %rdi
  <+86>: popf
  <+87>: call   *%rsi
  <+89>: nop
  <+90>: nop
  <+91>: nop
  <+92>: pushf
  <+93>: pop    %rdi

and then propagating the arithmetic flags into the vCPU's emulator state:

  ctxt->eflags = (ctxt->eflags & ~EFLAGS_MASK) | (flags & EFLAGS_MASK);

  <+64>:  and    $0xfffffffffffff72a,%r9
  <+94>:  and    $0x8d5,%edi
  <+109>: or     %rdi,%r9
  <+122>: mov    %r9,0x10(%r8)

The failures can be most easily reproduced by running the "emulator"
test in KVM-Unit-Tests.

If you're feeling a bit of deja vu, see commit b63f20a778
("x86/retpoline: Don't clobber RFLAGS during CALL_NOSPEC on i386").

In addition, this breaks booting of clang-compiled guest on
a gcc-compiled host where the host contains the %rsp-modifying SRSO
mitigations.

  [ bp: Massage commit message, extend, remove addresses. ]

Fixes: fb3bd914b3 ("x86/srso: Add a Speculative RAS Overflow mitigation")
Closes: https://lore.kernel.org/all/de474347-122d-54cd-eabf-9dcc95ab9eae@amd.com
Reported-by: Srikanth Aithal <sraithal@amd.com>
Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/20230810013334.GA5354@dev-arch.thelio-3990X/
Link: https://lore.kernel.org/r/20230811155255.250835-1-seanjc@google.com
2023-08-14 10:47:55 +02:00
Helge Deller
7a894c8737 parisc: Fix CONFIG_TLB_PTLOCK to work with lightweight spinlock checks
For the TLB_PTLOCK checks we used an optimization to store the spc
register into the spinlock to unlock it. This optimization works as
long as the lightweight spinlock checks (CONFIG_LIGHTWEIGHT_SPINLOCK_CHECK)
aren't enabled, because they really check if the lock word is zero or
__ARCH_SPIN_LOCK_UNLOCKED_VAL and abort with a kernel crash
("Spinlock was trashed") otherwise.

Drop that optimization to make it possible to activate both checks
at the same time.

Noticed-by: Sam James <sam@gentoo.org>
Signed-off-by: Helge Deller <deller@gmx.de>
Tested-by: Sam James <sam@gentoo.org>
Cc: stable@vger.kernel.org # v6.4+
Fixes: 15e64ef652 ("parisc: Add lightweight spinlock checks")
2023-08-14 09:54:49 +02:00
Vlad Buslov
ace0ab3a4b Revert "vlan: Fix VLAN 0 memory leak"
This reverts commit 718cb09aaa.

The commit triggers multiple syzbot issues, probably due to possibility of
manually creating VLAN 0 on netdevice which will cause the code to delete
it since it can't distinguish such VLAN from implicit VLAN 0 automatically
created for devices with NETIF_F_HW_VLAN_CTAG_FILTER feature.

Reported-by: syzbot+662f783a5cdf3add2719@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/00000000000090196d0602a6167d@google.com/
Reported-by: syzbot+4b4f06495414e92701d5@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/00000000000096ae870602a61602@google.com/
Reported-by: syzbot+d810d3cd45ed1848c3f7@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/0000000000009f0f9c0602a616ce@google.com/
Fixes: 718cb09aaa ("vlan: Fix VLAN 0 memory leak")
Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-08-14 08:14:00 +01:00
Michael Walle
2fc8d02058 MAINTAINERS: add content regex for gpio-regmap
Add a glob to get patches of the users of gpio-regmap, too.

Signed-off-by: Michael Walle <michael@walle.cc>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2023-08-13 21:00:36 +02:00
Linus Torvalds
2ccdd1b13c Linux 6.5-rc6 2023-08-13 11:29:55 -07:00
Shuming Fan
37aba31908
ASoC: rt1308-sdw: fix random louder sound
This patch uses a vendor register to check whether the system hibernated ever.
The driver will only set the preset when the driver brings up or the system hibernated.
It will avoid the unknown issue that makes the speaker output louder and can't control the volume.

Signed-off-by: Shuming Fan <shumingf@realtek.com
Link: https://lore.kernel.org/r/20230811093822.37573-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-13 18:16:32 +01:00
Linus Torvalds
4c75bf7e4a Kbuild fixes for v6.5 (2nd)
- Clear errno before calling getline().
 
  - Fix a modpost warning for ARCH=alpha
 -----BEGIN PGP SIGNATURE-----
 
 iQJJBAABCgAzFiEEbmPs18K1szRHjPqEPYsBB53g2wYFAmTYrFUVHG1hc2FoaXJv
 eUBrZXJuZWwub3JnAAoJED2LAQed4NsGMkwP/0qIeM1JtyU3SfY7C7HxfA8vDxFO
 7sofQFCwPVdRGIFSVYijsZXZdaRfjU9TOG5I/QAfLc+rJdktg130wveooQ6NoRac
 Q2DgvohCyb7FaRDk5uqtm+e0owhHf7z+Oqs9eNlh3h3qF4Pj/KThzkMJd6aAK0N7
 99Ox+bWrmo4Pf2wdpifdntI219fJP7yQUIn2+s0aH3lzQVYbA2f8I0Q06s7PSnab
 PcUhflK3fsqnL72SGPAAZ+UeY7jvONaiLRJvfP/ZzNchn7vPUF00/4e7LES8tq0m
 Hb/XDQPGYq8vR3Uq+2z1lmiDj/a6LpEZ8p/BaCvhi5DZILh8eyoXhZdyCDDr7is8
 r8gemd7iuU9yNij9qTZZLq1dfQpStOyw5x0nR7JO9uqbeXp2ofNe72znAGkOApf9
 bO3iyQp0Dq2JTqgPBVXxnlkzJuBb18BoIHloJi+IuIbyXG9Us647tUCrcybbmDO+
 Bk+fZsje2YBWh9ZVdPUL/S2UcXgEpQBQDlgsyUBWDS8dNPWwe+6lkfxARdPmTsn4
 /t8PeoE0NxG58FcesOOkfnpZdC6YR6W69avcx80dI2F+90lmhl9ZJMZN7zz92Lra
 ZGbmI0B8db+Py40DaC0drRweBNoar1Q61xhVdSHeiLFgiCsbubCv+VggIY3YhIlY
 Wb/YUcUpcXljs9Fo
 =NuiD
 -----END PGP SIGNATURE-----

Merge tag 'kbuild-fixes-v6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild fixes from Masahiro Yamada:

 - Clear errno before calling getline()

 - Fix a modpost warning for ARCH=alpha

* tag 'kbuild-fixes-v6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  alpha: remove __init annotation from exported page_is_ram()
  scripts/kallsyms: Fix build failure by setting errno before calling getline()
2023-08-13 08:56:24 -07:00
Linus Torvalds
3dcf1473c7 platform-drivers-x86 for v6.5-4
Highlights:
  -  lenovo-ymc driver causes keyboard + touchpad to not work with >= 6.4
     on some Thinkbook models, fix this
  -  A set of small fixes for mlx-platform
  -  Other small fixes and hw-id additions
 
 The following is an automated git shortlog grouped by driver:
 
 ACPI:
  -  scan: Create platform device for CS35L56
 
 ISST:
  -  Reduce noise for missing numa information in logs
 
 lenovo-ymc:
  -  Only bind on machines with a convertible DMI chassis-type
 
 msi-ec:
  -  Fix the build
 
 platform:
  -  mellanox: Change register offset addresses
  -  mellanox: mlx-platform: Modify graceful shutdown callback and power down mask
  -  mellanox: mlx-platform: Fix signals polarity and latch mask
  -  mellanox: Fix order in exit flow
 
 platform/x86/amd/pmf:
  -  Fix unsigned comparison with less than zero
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEEuvA7XScYQRpenhd+kuxHeUQDJ9wFAmTY8C8UHGhkZWdvZWRl
 QHJlZGhhdC5jb20ACgkQkuxHeUQDJ9y+wQf/cPZjYmoP/vXbWwBuwmfU66hB8Ihh
 eraGayATU1hixLQGv0N9PbLLkGNzDAzLfhxolK3td+Qv1ZBxOlLKaoGGxtEHGQUd
 NvpbUAIS0oPxzs8georh3SaxvzJ34u3YKn2Tq/NBXtyb23IVdX2mWiGVhmp6sSs2
 vePh4lVNxGpjXe9oQW+99ze1zlgZjlA/HHvm8a2CnerG8Tf9fSDWeQsLRTCukE8t
 J61myAuZURFoZTqgGwVXuA9kYJoifNlpD6+PtBYIVPtJizm34UmfJNzV7TIpDISI
 E7+OPppFIHrTYPQWlIROZmN3pRXisw4gCAbBd2f8ZjkcFgB5S0rnGwb6gg==
 =Hd1i
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v6.5-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform drivers fixes from Hans de Goede:

 -  lenovo-ymc driver causes keyboard + touchpad to not work with >= 6.4
    on some Thinkbook models, fix this

 -  A set of small fixes for mlx-platform

 -  Other small fixes and hw-id additions

* tag 'platform-drivers-x86-v6.5-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
  platform/x86: lenovo-ymc: Only bind on machines with a convertible DMI chassis-type
  platform: mellanox: Change register offset addresses
  platform: mellanox: mlx-platform: Modify graceful shutdown callback and power down mask
  platform: mellanox: mlx-platform: Fix signals polarity and latch mask
  platform: mellanox: Fix order in exit flow
  platform/x86: ISST: Reduce noise for missing numa information in logs
  platform/x86: msi-ec: Fix the build
  ACPI: scan: Create platform device for CS35L56
  platform/x86/amd/pmf: Fix unsigned comparison with less than zero
2023-08-13 08:50:26 -07:00
Linus Torvalds
7308e92756 SCSI fixes on 20230813
Eleven small fixes, ten in drivers.  Of the two fixes marked core, one
 is in the raid helper class (used by some raid device drivers) and the
 other one is the /proc/scsi/scsi parsing fix for potential reads
 beyond the end of the buffer.
 
 Signed-off-by: James E.J. Bottomley <jejb@linux.ibm.com>
 -----BEGIN PGP SIGNATURE-----
 
 iJwEABMIAEQWIQTnYEDbdso9F2cI+arnQslM7pishQUCZNiFDyYcamFtZXMuYm90
 dG9tbGV5QGhhbnNlbnBhcnRuZXJzaGlwLmNvbQAKCRDnQslM7pishWjjAP4mtUh5
 75CoeRVGifOeMAgyoCJJrP0hsco3E/8/6U69wwD/diZOzdmYs+aKzYEJj+Y7m+rO
 PuXwF7i8QAzNoxGERiE=
 =rOpe
 -----END PGP SIGNATURE-----

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
 "Eleven small fixes, ten in drivers.

  Of the two fixes marked core, one is in the raid helper class (used by
  some raid device drivers) and the other one is the /proc/scsi/scsi
  parsing fix for potential reads beyond the end of the buffer"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: qedf: Fix firmware halt over suspend and resume
  scsi: qedi: Fix firmware halt over suspend and resume
  scsi: qedi: Fix potential deadlock on &qedi_percpu->p_work_lock
  scsi: lpfc: Remove reftag check in DIF paths
  scsi: ufs: renesas: Fix private allocation
  scsi: snic: Fix possible memory leak if device_add() fails
  scsi: core: Fix possible memory leak if device_add() fails
  scsi: core: Fix legacy /proc parsing buffer overflow
  scsi: 53c700: Check that command slot is not NULL
  scsi: fnic: Replace return codes in fnic_clean_pending_aborts()
  scsi: storvsc: Fix handling of virtual Fibre Channel timeouts
2023-08-13 08:43:26 -07:00
Hans de Goede
2b6aa6610d platform/x86: lenovo-ymc: Only bind on machines with a convertible DMI chassis-type
The lenovo-ymc driver is causing the keyboard + touchpad to stop working
on some regular laptop models such as the Lenovo ThinkBook 13s G2 ITL 20V9.

The problem is that there are YMC WMI GUID methods in the ACPI tables
of these laptops, despite them not being Yogas and lenovo-ymc loading
causes libinput to see a SW_TABLET_MODE switch with state 1.

This in turn causes libinput to ignore events from the builtin keyboard
and touchpad, since it filters those out for a Yoga in tablet mode.

Similar issues with false-positive SW_TABLET_MODE=1 reporting have
been seen with the intel-hid driver.

Copy the intel-hid driver approach to fix this and only bind to the WMI
device on machines where the DMI chassis-type indicates the machine
is a convertible.

Add a 'force' module parameter to allow overriding the chassis-type check
so that users can easily test if the YMC interface works on models which
report an unexpected chassis-type.

Fixes: e82882cdd2 ("platform/x86: Add driver for Yoga Tablet Mode switch")
Link: https://bugzilla.redhat.com/show_bug.cgi?id=2229373
Cc: André Apitzsch <git@apitzsch.eu>
Cc: stable@vger.kernel.org
Tested-by: Andrew Kallmeyer <kallmeyeras@gmail.com>
Tested-by: Gergő Köteles <soyer@irl.hu>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230812144818.383230-1-hdegoede@redhat.com
2023-08-13 14:50:25 +02:00
Vadim Pasternak
d66a8aab7d platform: mellanox: Change register offset addresses
Move debug register offsets to different location due to hardware changes.

Fixes: dd635e33b5 ("platform: mellanox: Introduce support of new Nvidia L1 switch")
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Link: https://lore.kernel.org/r/20230813083735.39090-5-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2023-08-13 14:49:46 +02:00
Vadim Pasternak
9f8ccdb508 platform: mellanox: mlx-platform: Modify graceful shutdown callback and power down mask
Use kernel_power_off() instead of kernel_halt() to pass through
machine_power_off() -> pm_power_off(), otherwise axillary power does
not go off.

Change "power down" bitmask.

Fixes: dd635e33b5 ("platform: mellanox: Introduce support of new Nvidia L1 switch")
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Link: https://lore.kernel.org/r/20230813083735.39090-4-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2023-08-13 14:49:46 +02:00
Vadim Pasternak
3c91d7e8c6 platform: mellanox: mlx-platform: Fix signals polarity and latch mask
Change polarity of chassis health and power signals and fix latch reset
mask for L1 switch.

Fixes: dd635e33b5 ("platform: mellanox: Introduce support of new Nvidia L1 switch")
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Link: https://lore.kernel.org/r/20230813083735.39090-3-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2023-08-13 14:49:46 +02:00
Vadim Pasternak
8e3938cff0 platform: mellanox: Fix order in exit flow
Fix exit flow order: call mlxplat_post_exit() after
mlxplat_i2c_main_exit() in order to unregister main i2c driver before
to "mlxplat" driver.

Fixes: 0170f616f4 ("platform: mellanox: Split initialization procedure")
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Link: https://lore.kernel.org/r/20230813083735.39090-2-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2023-08-13 14:49:46 +02:00
Russell King (Oracle)
cc941e548b net: phy: fix IRQ-based wake-on-lan over hibernate / power off
Uwe reports:
"Most PHYs signal WoL using an interrupt. So disabling interrupts [at
shutdown] breaks WoL at least on PHYs covered by the marvell driver."

Discussing with Ioana, the problem which was trying to be solved was:
"The board in question is a LS1021ATSN which has two AR8031 PHYs that
share an interrupt line. In case only one of the PHYs is probed and
there are pending interrupts on the PHY#2 an IRQ storm will happen
since there is no entity to clear the interrupt from PHY#2's registers.
PHY#1's driver will get stuck in .handle_interrupt() indefinitely."

Further confirmation that "the two AR8031 PHYs are on the same MDIO
bus."

With WoL using interrupts to wake the system, in such a case, the
system will begin booting with an asserted interrupt. Thus, we need to
cope with an interrupt asserted during boot.

Solve this instead by disabling interrupts during PHY probe. This will
ensure in Ioana's situation that both PHYs of the same type sharing an
interrupt line on a common MDIO bus will have their interrupt outputs
disabled when the driver probes the device, but before we hook in any
interrupt handlers - thus avoiding the interrupt storm.

A better fix would be for platform firmware to disable the interrupting
devices at source during boot, before control is handed to the kernel.

Fixes: e2f016cf77 ("net: phy: add a shutdown procedure")
Link: 20230804071757.383971-1-u.kleine-koenig@pengutronix.de
Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-08-13 12:27:08 +01:00
Linus Torvalds
a785fd28d3 for-6.5-rc5-tag
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE8rQSAMVO+zA4DBdWxWXV+ddtWDsFAmTXzuUACgkQxWXV+ddt
 WDvQVg/+PwDYtfsFBBxWboR/Ehu+nGj+PGRGH5kUumCt03760GtVMYqJzakinAoA
 TUg7N+SvC0i6STUQ1LxkqdyU+eHxk0D1qwK7HJtbqNQJ+kwaEPlilHwsptMmuuM/
 xaei+C8gLmQreL5ZH6ZsnLfV4aaFR7Ur8KSiAq28H6dKXGnh4q9yio2BspeFoc4Y
 8cD2Q8eOUxLBbGkAy9RHeMWf6OMOv2jyzdA761NZrjxUe23bDWSdRM6cRhfdJIh+
 gfwW1IVH2EVOwo+FeaIpMSf4dpnenOYOKOftTncrz7XS0VEN/wJYQXGjNbLa7u4d
 RxV2RujzRPePAUKDbLRakfXotcuKdSQuX2epLSYkQTfGQ0KRYu5YIDQgkm3r7Yky
 cF5mkyEyI8lFCiop7Bgi3MqnzoY5ZgWAkWSy9/TzjQ4yRhjiZ3fmk5JgoJ8gwUc3
 Fle4czcmKvk6ZqQAn90b0qGtW9FXzVAekZjLAH26O7+dgEn+CCAfwT9GuG7h+ATM
 9Bh+5U5PWxWmNPTYU8Sn+WR9HpVL6+1maxrax/Ftb8/FuFlQXFHxK+OnTcKx9K+y
 OGsv0r/4Zv517k1qqlHvf397Jvz7MmYLyOwkqu5xyomCGtrKIBkkEGF/9sHrZJVM
 YokgphDZL8AILrnnPwCOgt4lsph1VKS/Sgvu7XKovnZbvvh8S+M=
 =csAj
 -----END PGP SIGNATURE-----

Merge tag 'for-6.5-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux

Pull btrfs fixes from David Sterba:
 "More fixes, some of them going back to older releases and there are
  fixes for hangs in stress tests regarding space caching:

   - fixes and progress tracking for hangs in free space caching, found
     by test generic/475

   - writeback fixes, write pages in integrity mode and skip writing
     pages that have been written meanwhile

   - properly clear end of extent range after an error

   - relocation fixes:
      - fix race betwen qgroup tree creation and relocation
      - detect and report invalid reloc roots"

* tag 'for-6.5-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
  btrfs: set cache_block_group_error if we find an error
  btrfs: reject invalid reloc tree root keys with stack dump
  btrfs: exit gracefully if reloc roots don't match
  btrfs: avoid race between qgroup tree creation and relocation
  btrfs: properly clear end of the unreserved range in cow_file_range
  btrfs: don't wait for writeback on clean pages in extent_write_cache_pages
  btrfs: don't stop integrity writeback too early
  btrfs: wait for actual caching progress during allocation
2023-08-12 13:28:55 -07:00
Linus Torvalds
ae545c3283 gpio fixes for v6.5-rc6
- mark virtual chips exposed by gpio-sim as ones that can sleep (callbacks
   must not be called from interrupt context)
 - fix an off-by-one error in gpio-ws16c48
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmTXzeAACgkQEacuoBRx
 13JptQ/7BY2F9umrhU0gtvX7MX7HI052bPM03XX0YnN2s7bgO0VQIAoch/3yiFIU
 ZjLHGmig6XufOixL2xhtLOezKydrRu1e54usSNMWLRTfCzFOZbuXJQ2cl37DUxFJ
 WD8FIN+p8JyzdBvIXN9rF730AH9kPOBBjE6V1Q/SLG8eWC66jEAXiNGp7TECogGA
 CmV9t3+8R8SvhAN0YOcK761/Hxqxp2PIl0rM8kVLTir/0oOx2l7RJ/ceIi6ZlFBQ
 5th2uv0ncggd4w6HsGqitgYaQbV0KOzjzGQsDHGX3gzDZDAFkYGvexj4E90LmvjH
 As4UbEjhkZa9iFH8mNoQRENsm2Iq+jhyL0ho8wBxEyy58jOTamCgcDMr2tij6lKU
 2/CAZzcgfl8XzqpkyX5ZIuKToDwEyMMtvgxPjgXEBsBi6R9fxkFuH1i0vLCWjwU3
 f+8987TTlBdJXlAUtbgXWucotBkUuIdgXgeC8oTRoKwxUnIwZt5aCmqfbZhW2UqJ
 Qer1au1rXBC7EmbQbVBntdRqejpH/jO0dihTR6D+7bz21p6Xp+eYsMn0jeIPTO6c
 cbQTgR6kGmkodNqH88Y4dImdzidtdRK9aXq0k66FWdrY3+vo0jbzaS6y0FPRk7Bs
 2dqUraAv6407sqS8iZ9Jc0zbKDj7kAMkuJMY0elGlsS87pmlUmI=
 =7oB/
 -----END PGP SIGNATURE-----

Merge tag 'gpio-fixes-for-v6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio fixes from Bartosz Golaszewski:

 - mark virtual chips exposed by gpio-sim as ones that can sleep
   (callbacks must not be called from interrupt context)

 - fix an off-by-one error in gpio-ws16c48

* tag 'gpio-fixes-for-v6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
  gpio: ws16c48: Fix off-by-one error in WS16C48 resource region extent
  gpio: sim: mark the GPIO chip as a one that can sleep
2023-08-12 11:34:23 -07:00
Mateusz Guzik
c8afaa1b0f locking: remove spin_lock_prefetch
The only remaining consumer is new_inode, where it showed up in 2001 as
commit c37fa164f793 ("v2.4.9.9 -> v2.4.9.10") in a historical repo [1]
with a changelog which does not mention it.

Since then the line got only touched up to keep compiling.

While it may have been of benefit back in the day, it is guaranteed to
at best not get in the way in the multicore setting -- as the code
performs *a lot* of work between the prefetch and actual lock acquire,
any contention means the cacheline is already invalid by the time the
routine calls spin_lock().  It adds spurious traffic, for short.

On top of it prefetch is notoriously tricky to use for single-threaded
purposes, making it questionable from the get go.

As such, remove it.

I admit upfront I did not see value in benchmarking this change, but I
can do it if that is deemed appropriate.

Removal from new_inode and of the entire thing are in the same patch as
requested by Linus, so whatever weird looks can be directed at that guy.

Link: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit/fs/inode.c?id=c37fa164f793735b32aa3f53154ff1a7659e6442 [1]
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2023-08-12 09:18:47 -07:00
Linus Torvalds
3feecb1b84 Char/Misc driver fixes for 6.5-rc6
Here are some small char/misc driver fixes for 6.5-rc6 that resolve some
 reported issues.  Included in here are:
   - bunch of iio driver fixes for reported problems
   - interconnect driver fixes
   - counter driver build fix
   - cardreader driver fixes
   - binder driver fixes
   - other tiny driver fixes
 
 All of these have been in linux-next for a while with no reported
 problems.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCZNdWFQ8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+yl9TACeOsUiS31nWuv+JS6Kljj5qZ0p+V0An0kmBw/+
 FOQVIk0niv+Hnnb4WwvF
 =ZtpJ
 -----END PGP SIGNATURE-----

Merge tag 'char-misc-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char / misc driver fixes from Greg KH:
 "Here are some small char/misc driver fixes for 6.5-rc6 that resolve
  some reported issues. Included in here are:

   - bunch of iio driver fixes for reported problems

   - interconnect driver fixes

   - counter driver build fix

   - cardreader driver fixes

   - binder driver fixes

   - other tiny driver fixes

  All of these have been in linux-next for a while with no reported
  problems"

* tag 'char-misc-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (21 commits)
  misc: tps6594-esm: Disable ESM for rev 1 PMIC
  misc: rtsx: judge ASPM Mode to set PETXCFG Reg
  binder: fix memory leak in binder_init()
  iio: cros_ec: Fix the allocation size for cros_ec_command
  tools/counter: Makefile: Replace rmdir by rm to avoid make,clean failure
  iio: imu: lsm6dsx: Fix mount matrix retrieval
  iio: adc: meson: fix core clock enable/disable moment
  iio: core: Prevent invalid memory access when there is no parent
  iio: frequency: admv1013: propagate errors from regulator_get_voltage()
  counter: Fix menuconfig "Counter support" submenu entries disappearance
  dt-bindings: iio: adi,ad74115: remove ref from -nanoamp
  iio: adc: ina2xx: avoid NULL pointer dereference on OF device match
  iio: light: bu27008: Fix intensity data type
  iio: light: bu27008: Fix scale format
  iio: light: bu27034: Fix scale format
  iio: adc: ad7192: Fix ac excitation feature
  interconnect: qcom: sa8775p: add enable_mask for bcm nodes
  interconnect: qcom: sm8550: add enable_mask for bcm nodes
  interconnect: qcom: sm8450: add enable_mask for bcm nodes
  interconnect: qcom: Add support for mask-based BCMs
  ...
2023-08-12 09:03:15 -07:00
Linus Torvalds
469a2f5041 USB/Thunderbolt driver fixes for 6.5-rc6
Here are some small USB and Thunderbolt driver fixes for reported
 problems.  Included in here are:
   - thunderbolt driver memory leak fix
   - thunderbolt display flicker fix
   - usb dwc3 driver fix
   - usb gadget uvc disconnect crash fix
   - usb typec Kconfig build dependency fix
   - usb typec small fixes
   - usb-con-gpio bugfix
   - usb-storage old driver bugfix
 
 All of these have been in linux-next for a while with no reported
 issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCZNdb/g8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+yk09QCg0F3JgIt/upbSHkzTfuZhAhyyEQ4Ani3VN9QS
 gmrwM74YbefSpQFxkdzx
 =pnq0
 -----END PGP SIGNATURE-----

Merge tag 'usb-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB / Thunderbolt driver fixes from Greg KH:
 "Here are some small USB and Thunderbolt driver fixes for reported
  problems. Included in here are:

   - thunderbolt driver memory leak fix

   - thunderbolt display flicker fix

   - usb dwc3 driver fix

   - usb gadget uvc disconnect crash fix

   - usb typec Kconfig build dependency fix

   - usb typec small fixes

   - usb-con-gpio bugfix

   - usb-storage old driver bugfix

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

* tag 'usb-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  thunderbolt: Fix memory leak in tb_handle_dp_bandwidth_request()
  usb: dwc3: Properly handle processing of pending events
  usb-storage: alauda: Fix uninit-value in alauda_check_media()
  usb: common: usb-conn-gpio: Prevent bailing out if initial role is none
  USB: Gadget: core: Help prevent panic during UVC unconfigure
  usb: typec: mux: intel: Add dependency on USB_COMMON
  usb: typec: nb7vpq904m: Add an error handling path in nb7vpq904m_probe()
  usb: typec: altmodes/displayport: Signal hpd when configuring pin assignment
  usb: typec: tcpm: Fix response to vsafe0V event
  thunderbolt: Fix Thunderbolt 3 display flickering issue on 2nd hot plug onwards
2023-08-12 08:58:54 -07:00
Linus Torvalds
43972cf2de - Do not parse the confidential computing blob on non-AMD hardware as it
leads to an EFI config table ending up unmapped
 
 - Use the correct segment selector in the 32-bit version of getcpu() in
   the vDSO
 
 - Make sure vDSO and VVAR regions are placed in the 47-bit VA range even
   on 5-level paging systems
 
 - Add models 0x90-0x91 to the range of AMD Zenbleed-affected CPUs
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEzv7L6UO9uDPlPSfHEsHwGGHeVUoFAmTXVWMACgkQEsHwGGHe
 VUrrpg//f0BFZV4dbANuYAX47A/hhrm8n5KwV9Mjq8JDeG/TumUN/vAK9+n8outO
 pLpPOoXRSCSPybXBSmI1ryVwLaDq6BJy0fYyq4kHOvBFXYKodfTNdO8Oec+le3V/
 DBGnY6TQ5x1PgWuAUE9WoeGQuTN1d3Dxm0V/pG2LU/qW3mr+GlBXsSKUVjwp9/OW
 JPNw1XQDFVuxT+heRLxQONPkdTxkwwKxZBDRwnSSj7chbJ/jSbnX9a5xinwBvMZY
 Q6nelt/AMwAgfO2oz38y1tnR0bfd8fM08SUUgoajWWghKemZK5uNAgZZJd4tPNq6
 lBonNc6jF9UGohzgQbNOAjfmDomtyxe4JYGl2SnyWcfwFzGANpcSKSbM9H91LMaI
 Sh7hKykZQNGmDctbLsxvlPFgIoxWFLK1DfNeM2yQRzlayqDF8CRlDIcWXHEtYOXf
 AOZFMJtOJBZjLbSeWIBW278atNG3ONWEb75kqiKRYxsX9QzvwAZYCYZH+NGe6sLO
 kkCm7g3NcAItf1qrPNGZd/k9fA/+3RXEWNdjYsmegMvU8vQBPY0w4NVwGtU9LCkq
 jspQxnNlVy1ayqr/TQXRhzn5+d7CQ1PLNwVsGh4S+diCEFu2aEdOhrBhS1uaujLv
 5iLpmyyh0yO9aHebK/u4cciAvwVB7WuzQqWYIGzdsolrc+lbY54=
 =zPFr
 -----END PGP SIGNATURE-----

Merge tag 'x86_urgent_for_v6.5_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Borislav Petkov:

 - Do not parse the confidential computing blob on non-AMD hardware as
   it leads to an EFI config table ending up unmapped

 - Use the correct segment selector in the 32-bit version of getcpu() in
   the vDSO

 - Make sure vDSO and VVAR regions are placed in the 47-bit VA range
   even on 5-level paging systems

 - Add models 0x90-0x91 to the range of AMD Zenbleed-affected CPUs

* tag 'x86_urgent_for_v6.5_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/cpu/amd: Enable Zenbleed fix for AMD Custom APU 0405
  x86/mm: Fix VDSO and VVAR placement on 5-level paging machines
  x86/linkage: Fix typo of BUILD_VDSO in asm/linkage.h
  x86/vdso: Choose the right GDT_ENTRY_CPUNODE for 32-bit getcpu() on 64-bit kernel
  x86/sev: Do not try to parse for the CC blob on non-AMD hardware
2023-08-12 08:47:01 -07:00
Linus Torvalds
272b86ba9d - A first series of cleanups/unifications and documentation improvements
to the SRSO and GDS mitigations code which got postponed to after the
   embargo date
 
 - Fix the SRSO aliasing addresses assertion so that the LLVM linker can
   parse it too
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEzv7L6UO9uDPlPSfHEsHwGGHeVUoFAmTXULMACgkQEsHwGGHe
 VUqAKxAAlGm4YodsbEX+SQTVDLsECBw9lpJ3wU8lD0fBmIAmGiWFy9jqn4FYyAi8
 YlKNI8Ru/mME5cM5BBV5ZZ5PNIZPD8OmqbbaHkSjcjLJfdNg03D/RDUPELSyY7T5
 HviLaknJFjn6HwvLkSLdBIsAAkVqF5lYitP8x5OgBp6Lc9PO7/xWjSZoVhOUkrFe
 Pjc8sT0DgtC2PWkxbB66/uxhdUnFqpioWL+06akeSWuHweIQDQ+P7sxfCB8NZO0u
 YV4hmd/JfjoVc0DtvS3HOm14Ruhmru/oiKg/XcJO7uGPBKxuVK8xsHqeUyGMdTeS
 +sNXA0XjbvaUV9IihuvVHrX8nMirkW7u0NWMNlJCO9QF5eJPfc0I07VLpKJGEsph
 wKSNCN7F64GfjkRGl4jPo26tX+fXGMm32+gGgpqsCYnTBu+nrqprXck4DJQZBNl4
 6Le7sfUky2PSllbFh5MnKaylfeWKcqlOzfko7tjWtFm7raOHEGy31m92igKms0hM
 IlCyEe6mJUcMJ60QzYwaB9FJ+50jIZXeckRnud/mExgaAGQqe7RcVbwurQCCDtYq
 vd4sb9TV9vU07Uqz1NBxmzl6GbYM1ORV9hnlpj/eDnh/ArBzj44UwiGB1bVQ31Iy
 OMBJZ+RQtspa12xq7Zu++mjc+9XTeX9JK81PYg6UU+5ogQapdx4=
 =P0vQ
 -----END PGP SIGNATURE-----

Merge tag 'x86_bugs_for_v6.5_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 mitigation fixes from Borislav Petkov:
 "The first set of fallout fixes after the embargo madness. There will
  be another set next week too.

   - A first series of cleanups/unifications and documentation
     improvements to the SRSO and GDS mitigations code which got
     postponed to after the embargo date

   - Fix the SRSO aliasing addresses assertion so that the LLVM linker
     can parse it too"

* tag 'x86_bugs_for_v6.5_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  driver core: cpu: Fix the fallback cpu_show_gds() name
  x86: Move gds_ucode_mitigated() declaration to header
  x86/speculation: Add cpu_show_gds() prototype
  driver core: cpu: Make cpu_show_not_affected() static
  x86/srso: Fix build breakage with the LLVM linker
  Documentation/srso: Document IBPB aspect and fix formatting
  driver core: cpu: Unify redundant silly stubs
  Documentation/hw-vuln: Unify filename specification in index
2023-08-12 08:34:20 -07:00
Jiasheng Jiang
6e6d847a8c
soc: aspeed: socinfo: Add kfree for kstrdup
Add kfree() in the later error handling in order to avoid memory leak.

Fixes: e0218dca57 ("soc: aspeed: Add soc info driver")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Link: https://lore.kernel.org/r/20230707021625.7727-1-jiasheng@iscas.ac.cn
Signed-off-by: Joel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/20230810123104.231167-1-joel@jms.id.au
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-08-12 12:12:58 +02:00
Zev Weiss
e4ad279ae3
soc: aspeed: uart-routing: Use __sysfs_match_string
The existing use of match_string() caused it to reject 'echo foo' due
to the implicitly appended newline, which was somewhat ergonomically
awkward and inconsistent with typical sysfs behavior.  Using the
__sysfs_* variant instead provides more convenient and consistent
linefeed-agnostic behavior.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Fixes: c6807970c3 ("soc: aspeed: Add UART routing support")
Reviewed-by: Joel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/20230628083735.19946-2-zev@bewilderbeest.net
Signed-off-by: Joel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/20230810122941.231085-1-joel@jms.id.au
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-08-12 12:12:34 +02:00
Lin Yujun
42ff49a196
ARM: dts: integrator: fix PCI bus dtc warnings
An warning is reported when allmodconfig is used to compile the kernel of the ARM architecture:

arch/arm/boot/dts/arm/integratorap.dts:161.22-206.4: Warning (pci_bridge): /pciv3@62000000: node name is not "pci" or "pcie"

Change the node name to pci to clear the build warning.

Signed-off-by: Lin Yujun <linyujun809@huawei.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230811-versatile-dts-v6-6-v1-1-d8cb9d1947ed@linaro.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-08-12 10:14:16 +02:00
Arnd Bergmann
d842f4dc68 ARM: Zynq SoC changes for v6.6
- Sort out OF headers in pm.c
 -----BEGIN PGP SIGNATURE-----
 
 iF0EABECAB0WIQQbPNTMvXmYlBPRwx7KSWXLKUoMIQUCZMzcuAAKCRDKSWXLKUoM
 IeNlAJ9ZxrC2yUdxxev+51vmVMHs32xbzwCfaLkDev0tR1XXUpQdEdzs52z3Dws=
 =QVnR
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmTXPxgACgkQYKtH/8kJ
 UifuHg/6Aso7qoXlCW377qH7JK5q6opqH24O5sE6uAm4SJ9BKYP/eCuzO54LGMaO
 fsls0pIV19zL/kyjoKGYsZYCjWOagNnP2hHhF4MGaj+coV6SnDyL//xwa2GSDe3i
 7wybMUDG3+2f1dnBuoZz4+vZXOs4Z7fzA9q/Vh4AhaGVPRSwfYjwMpiK2T7KWgc/
 WdxvaYywCArhpS6MgWEh1eYAdXlePI3dal+ogqzhl67+9El5UtSGX86EuszIPaOi
 OBrN9XCkuHMkcBN9zrfxeHWLfybFR5VbZXCZYyNEnGppifPDlH1aSrJ5v4oR3iiz
 eWdDpPbhRoe+t6N1GpXpyH+WobRmYHbxdf+y/KG7RIUNswEzGIY2VT/1+C8EcuVx
 3bmhqBumH6w3Th6MA7FEUSzHo3sMO2O5ngT0Uj4J1sHnxzn6SnHVRibsp8d1Ua+P
 0Jb0oYFM3Sg638sV62BHD18dKXPwlRowIad0zMCyLFBScTIJT+mWqHHVc5/NDZIV
 8pjyjfRnX16CevBTF0cRdS6ynCuf1UavwqBW1kCpXwd/2Tv8iUrmA2IHi+J7/X5K
 FYOb22hs4qdqnN8znMB0MWsUwNeduTsn1HKisRmDh3+IXuTXumTOzBqIZIz6mxa8
 3d0tAD4dU1U8/MAyBtMuAYdKC8exFqjzHo2Amjz4ESk2e9f6ZS8=
 =QcvG
 -----END PGP SIGNATURE-----

Merge tag 'zynq-soc-for-6.6' of https://github.com/Xilinx/linux-xlnx into arm/fixes

ARM: Zynq SoC changes for v6.6

- Sort out OF headers in pm.c

* tag 'zynq-soc-for-6.6' of https://github.com/Xilinx/linux-xlnx:
  ARM: zynq: Explicitly include correct DT includes

Link: https://lore.kernel.org/r/a56457a0-7e5a-df46-2c86-3f2ace578984@monstr.eu
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-08-12 10:13:12 +02:00
Arnd Bergmann
991e0d9dbb i.MX fixes for 6.5, 2nd round:
- Fix i.MX93 ANATOP 'reg' resource size to avoid overlapping with TMU
   memory area.
 - Fix RTC interrupt level on imx6qdl-phytec-mira board.
 - Remove LDB endpoint from from the common imx6sx.dtsi as it causes
   regression for boards that has the LCDIF connected directly to
   a parallel display.
 - Drop CSI1 PHY reference clock configuration from i.MX8MM/N device tree
   to avoid overclocking.
 - Set a proper default tuning step for i.MX6SX and i.MX7D uSDHC to fix
   a tuning failure seen with some SD cards.
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCgAyFiEEFmJXigPl4LoGSz08UFdYWoewfM4FAmTTYzIUHHNoYXduZ3Vv
 QGtlcm5lbC5vcmcACgkQUFdYWoewfM5THQf/bDZP+YPT8RxUdxVdL6jT2GGHR3t8
 wq3+vM1KVgg+1E9nMBcG0aT1fUTvPM22N5Ae72bGYd69HGbqS64UJ37JlvrSXfwW
 QtJHPb9mbDPsdyoLbWBuJq3bdY6NgdbzeKEEGRWlZAkJqvB5a1S63g3riJO89inp
 mMsm0dFGn7IZFkhflMtMFL9T0FOz4IwbJGBCm5WvRCR/5nH82MJe5w9JfWBGoRPY
 Y0+vm8bS8A/hjQrYVWyAxe1sRAjxNNPWEsjelY/F89gpqOcuBrTTFVmMhEVKX6sd
 BjgCQFFWzds4ezmTNloMTyB4dSnW/q2Nsg87A9MXVECW6eIzAeO9p2dINA==
 =pxhp
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmTXPu4ACgkQYKtH/8kJ
 UieZnRAAnbxsC6/NT7qOwo/d6+hfX2Nh7Tgy9MDLBwIGtzdR822SD0WKwYRIb0K/
 iMQMt+6ItPcYDKOLUXKv1MY3QX3BcirvE4yDyPGVxgcnkmL1egeUlYJ4R2U8QnOq
 Vwn+cqAcA6RSQIYEV0w32gXHjeDBMdsToT+DlV7id5C6QyreQEkSRzrqf0zm1CTF
 zNWCXeaaLkTV+j7W4fb3yPhSMhnnfkwmZB3lVVd5K/vwt7x3OQc7WaSQVNPAcGTC
 jiWsbW5KF4HbcukUpb16hyxyyJlt94FxrqqUyN86mj/ONBS55Hf7ilgZX4x/KphG
 PJ2V7fnCDnrhIWVEUlknMxLZmPUXTMqaSVsXrx0JOOz+y3KSq6lZudswXPK5fvbV
 WGZw9YpC/Hm3hN7Xi+BBUZVJGB7r9pyjcZUcUZBqK1EOxDSRiDMogyC55cC6C6Z2
 uX4AfntpeDskj1nUtAgXK38bM1NLQ/jQnkZPVV69qpSkRQK/zLBwNuTSDUtW42vM
 ftbbSIyN4tEBQD5bmXy01ug7qxFJaeRQ9dW44UH03zYvDlH5QTrRM64tmySKIRZ+
 urab1ShoN0UNA7t9PFpj45bbLb9sndeI6EOh0Vi8RozQ+dCEq1I6HFt54K886qar
 sjcsnrJxMZysZnoGGf3q1REe3NjuQ1gRd2nwg4Rbj7VkytuInWI=
 =3ZEY
 -----END PGP SIGNATURE-----

Merge tag 'imx-fixes-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes

i.MX fixes for 6.5, 2nd round:

- Fix i.MX93 ANATOP 'reg' resource size to avoid overlapping with TMU
  memory area.
- Fix RTC interrupt level on imx6qdl-phytec-mira board.
- Remove LDB endpoint from from the common imx6sx.dtsi as it causes
  regression for boards that has the LCDIF connected directly to
  a parallel display.
- Drop CSI1 PHY reference clock configuration from i.MX8MM/N device tree
  to avoid overclocking.
- Set a proper default tuning step for i.MX6SX and i.MX7D uSDHC to fix
  a tuning failure seen with some SD cards.

* tag 'imx-fixes-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
  arm64: dts: imx93: Fix anatop node size
  ARM: dts: imx: Set default tuning step for imx6sx usdhc
  arm64: dts: imx8mm: Drop CSI1 PHY reference clock configuration
  arm64: dts: imx8mn: Drop CSI1 PHY reference clock configuration
  ARM: dts: imx: Set default tuning step for imx7d usdhc
  ARM: dts: imx6: phytec: fix RTC interrupt level
  ARM: dts: imx6sx: Remove LDB endpoint

Link: https://lore.kernel.org/r/20230809100034.GS151430@dragon
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-08-12 10:12:29 +02:00
Linus Torvalds
f8de32cc06 Hi,
These change the probing and enabling of interrupts advertised by the
 platform firmware (i.e. ACPI, Device Tree) to tpm_tis as an opt-in,
 which can be set from the kernel command-line.
 
 BR, Jarkko
 -----BEGIN PGP SIGNATURE-----
 
 iIgEABYIADAWIQRE6pSOnaBC00OEHEIaerohdGur0gUCZNbL6RIcamFya2tvQGtl
 cm5lbC5vcmcACgkQGnq6IXRrq9LMaQEAtHmqTq4TjuKPFBy3R3WC883KCkE0Dd9Z
 Lm2hXwVjjj0A/2i9ucqQbDoPoFOBS4B/mH9NN/7M2K50tn0Ia35csQgA
 =YQ5W
 -----END PGP SIGNATURE-----

Merge tag 'tpmdd-v6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd

Pull tpm irq fixes from Jarkko Sakkinen:
 "These change the probing and enabling of interrupts advertised by the
  platform firmware (i.e. ACPI, Device Tree) to be an opt-in for tpm_tis,
  which can be set from the kernel command-line.

  Note that the opt-in change is only for the PC MMIO tpm_tis module. It
  does not affect other similar drivers using IRQs, like tpm_tis_spi and
  synquacer"

* tag 'tpmdd-v6.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd:
  tpm_tis: Opt-in interrupts
  tpm: tpm_tis: Fix UPX-i11 DMI_MATCH condition
2023-08-11 19:46:04 -07:00
Linus Torvalds
9a20704fb4 v6.5 second rc RDMA pull request
Few small bugs:
 
 - Fix longstanding mlx5 bug where ODP would fail with certain MR alignments
 
 - cancel work to prevent a hfi1 UAF
 
 - MAINTAINERS update
 
 - UAF, missing mutex_init and an error unwind bug in bnxt_re
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQRRRCHOFoQz/8F5bUaFwuHvBreFYQUCZNU9zQAKCRCFwuHvBreF
 YaG/AQDZqytJ6FtlTowtsVbv87h+xPF8qmiVlqJs+bQnO9hc+gD/TtaavpYHpafY
 2yvZUKkoukoRo5w+3Kzz4ZMSStSXwgY=
 =0p9M
 -----END PGP SIGNATURE-----

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma

Pull rdma fixes from Jason Gunthorpe:
 "A few small bugs:

   - Fix longstanding mlx5 bug where ODP would fail with certain MR
     alignments

   - cancel work to prevent a hfi1 UAF

   - MAINTAINERS update

   - UAF, missing mutex_init and an error unwind bug in bnxt_re"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
  RDMA/bnxt_re: Initialize dpi_tbl_lock mutex
  RDMA/bnxt_re: Fix error handling in probe failure path
  RDMA/bnxt_re: Properly order ib_device_unalloc() to avoid UAF
  MAINTAINERS: Remove maintainer of HiSilicon RoCE
  IB/hfi1: Fix possible panic during hotplug remove
  RDMA/umem: Set iova in ODP flow
2023-08-11 19:39:01 -07:00
Linus Torvalds
0725a70411 zonefs fixes for 6.5-rc6
- The switch to using iomap for executing direct synchronous write to
    sequential files using zone append BIO overlooked cases where the BIO
    built by iomap is too large and needs splitting, which is not allowed
    with zone append. Fix this by using regular write commands instead.
    The use of zone append commands will be reintroduces later with
    proper support from iomap.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQSRPv8tYSvhwAzJdzjdoc3SxdoYdgUCZNbIugAKCRDdoc3SxdoY
 dgGZAQCJWVBGXP/FAB4o7ifuqZ9xDjcf0RyrYrcS1N+kV1REqgD/ZnHXxAbNJNtx
 A3A5W7bFQJogNp/gWR7K7/jt1cRNwgo=
 =nlBY
 -----END PGP SIGNATURE-----

Merge tag 'zonefs-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs

Pull zonefs fix from Damien Le Moal:

 - The switch to using iomap for executing a direct synchronous write to
   sequential files using a zone append BIO overlooked cases where the
   BIO built by iomap is too large and needs splitting, which is not
   allowed with zone append.

   Fix this by using regular write commands instead. The use of zone
   append commands will be reintroduced later with proper support from
   iomap.

* tag 'zonefs-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs:
  zonefs: fix synchronous direct writes to sequential files
2023-08-11 18:35:56 -07:00
Linus Torvalds
5512c33c7b hwmon fixes for v6.5-rc6
* Fix sporadic comunication errors in pmbus/bel-pfe and
   aquacomputer_d5next drivers
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEiHPvMQj9QTOCiqgVyx8mb86fmYEFAmTWvZUACgkQyx8mb86f
 mYGwjA/+OsXkdz90jsZ+JdJSUuqWsr5kGwEEWHZzPFizxnHw8/EeMiEdhwPwN8Wm
 SBlqXPWs0FiAZaQ/oWJEXPg0Lw6hQ8uIAds99USUpYWu0uQMyg6GeIq+14u+EbR0
 LpvjVr/TY4x4v6KeQBHxUfhc2b7x9Tk+XfUFs2m21nnv+TmrvWONqKVCXCYmKXTQ
 f0wrErxcznwguj6aD7CrYQRdXfXk2LX6kgxPqFAlsbBLALceA0OpgnWZrAM00de+
 ChnoOxZ+kSfNeZvDk6eXGMJDcR/N7z98y2/qWZNqtGNxhzMUoGKROQlbyovVLbVw
 dmmThs2IKWLa8CUcQG4tyAYHQr7KoZN+uMdwoMII9+eB5fCC48Po0vqZz993Fxo0
 tX5FGZnifigLKL30dpU2q7wfPzdIC/xmbibTjS5klnEFD5zrPPRf1bgsa4EnaPsh
 2ZlpiMJLtEM8b1LjjYydhdLoi+EerpHr9wilaiYnhKTnraeD4lQAPCU4yeBYZHza
 R9mfqgXtfoUzKkiY3odGTfhjsahkUxPn5C0+Dt29ON4hQcLig08UqByDaM2S5PVb
 qPjBinLaD3/RYPADxMRWJwZvwUkoq7bIWu62mxnPBwmvURz211T4s9Hnfrxo8/fc
 pUVXlqM2s+5TUuCv3l/Wj8BLtBIPzxOskVdANOw3RlTT2+ymKG0=
 =z7ER
 -----END PGP SIGNATURE-----

Merge tag 'hwmon-for-v6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fixes from Guenter Roeck:

 - Fix sporadic comunication errors in pmbus/bel-pfe and
   aquacomputer_d5next drivers

* tag 'hwmon-for-v6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (aquacomputer_d5next) Add selective 200ms delay after sending ctrl report
  hwmon: (pmbus/bel-pfe) Enable PMBUS_SKIP_STATUS_CHECK for pfe1100
2023-08-11 18:30:29 -07:00
Jarkko Sakkinen
6aaf663ee0 tpm_tis: Opt-in interrupts
Cc: stable@vger.kernel.org # v6.4+
Link: https://lore.kernel.org/linux-integrity/CAHk-=whRVp4h8uWOX1YO+Y99+44u4s=XxMK4v00B6F1mOfqPLg@mail.gmail.com/
Fixes: e644b2f498 ("tpm, tpm_tis: Enable interrupt test")
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
2023-08-12 02:36:28 +03:00
Peter Ujfalusi
51e5e551af tpm: tpm_tis: Fix UPX-i11 DMI_MATCH condition
The patch which made it to the kernel somehow changed the
match condition from
DMI_MATCH(DMI_PRODUCT_NAME, "UPX-TGL01")
to
DMI_MATCH(DMI_PRODUCT_VERSION, "UPX-TGL")

Revert back to the correct match condition to disable the
interrupt mode on the board.

Cc: stable@vger.kernel.org # v6.4+
Fixes: edb13d7bb0 ("tpm: tpm_tis: Disable interrupts *only* for AEON UPX-i11")
Link: https://lore.kernel.org/lkml/20230524085844.11580-1-peter.ujfalusi@linux.intel.com/
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
2023-08-12 02:36:28 +03:00
Linus Torvalds
190bf7b14b 14 hotfixes. 11 of these are cc:stable and the remainder address post-6.4
issues, or are not considered suitable for -stable backporting.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQTTMBEPP41GrTpTJgfdBJ7gKXxAjgUCZNad/gAKCRDdBJ7gKXxA
 jmw6AP9u6k8XcS8ec3/u0IUEuh7ckHx5Vvjfmo5YgWlIJDeWegD9G2fh3ZJgcjMO
 jMssklfXmP+QSijCIxUva1TlzwtPDAQ=
 =MqiN
 -----END PGP SIGNATURE-----

Merge tag 'mm-hotfixes-stable-2023-08-11-13-44' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull misc fixes from Andrew Morton:
 "14 hotfixes. 11 of these are cc:stable and the remainder address
  post-6.4 issues, or are not considered suitable for -stable
  backporting"

* tag 'mm-hotfixes-stable-2023-08-11-13-44' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
  mm/damon/core: initialize damo_filter->list from damos_new_filter()
  nilfs2: fix use-after-free of nilfs_root in dirtying inodes via iput
  selftests: cgroup: fix test_kmem_basic false positives
  fs/proc/kcore: reinstate bounce buffer for KCORE_TEXT regions
  MAINTAINERS: add maple tree mailing list
  mm: compaction: fix endless looping over same migrate block
  selftests: mm: ksm: fix incorrect evaluation of parameter
  hugetlb: do not clear hugetlb dtor until allocating vmemmap
  mm: memory-failure: avoid false hwpoison page mapped error info
  mm: memory-failure: fix potential unexpected return value from unpoison_memory()
  mm/swapfile: fix wrong swap entry type for hwpoisoned swapcache page
  radix tree test suite: fix incorrect allocation size for pthreads
  crypto, cifs: fix error handling in extract_iter_to_sg()
  zsmalloc: fix races between modifications of fullness and isolated
2023-08-11 14:19:20 -07:00
Cristian Ciocaltea
6dbef74aeb x86/cpu/amd: Enable Zenbleed fix for AMD Custom APU 0405
Commit

  522b1d6921 ("x86/cpu/amd: Add a Zenbleed fix")

provided a fix for the Zen2 VZEROUPPER data corruption bug affecting
a range of CPU models, but the AMD Custom APU 0405 found on SteamDeck
was not listed, although it is clearly affected by the vulnerability.

Add this CPU variant to the Zenbleed erratum list, in order to
unconditionally enable the fallback fix until a proper microcode update
is available.

Fixes: 522b1d6921 ("x86/cpu/amd: Add a Zenbleed fix")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230811203705.1699914-1-cristian.ciocaltea@collabora.com
2023-08-11 22:52:29 +02:00
William Breathitt Gray
33f83d13de gpio: ws16c48: Fix off-by-one error in WS16C48 resource region extent
The WinSystems WS16C48 I/O address region spans offsets 0x0 through 0xA,
which is a total of 11 bytes. Fix the WS16C48_EXTENT define to the
correct value of 11 so that access to necessary device registers is
properly requested in the ws16c48_probe() callback by the
devm_request_region() function call.

Fixes: 2c05a0f29f ("gpio: ws16c48: Implement and utilize register structures")
Cc: stable@vger.kernel.org
Cc: Paul Demetrotion <pdemetrotion@winsystems.com>
Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2023-08-11 21:31:59 +02:00
Linus Torvalds
29d99aae13 ACPI fixes for 6.5-rc6
Rework the handling of interrupt overrides on AMD Zen-based machines to
 avoid recently introduced regressions (Hans de Goede).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAmTWgQMSHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxaggP/iYft7/0saIW/gQEWUngTdwwYpDdL5c6
 cnym9fO7dNvZ7svGgv1oQj3Nge79hWWWKTOVB5F3ZKPEmYHlhAekSYb+SI+/YUcp
 fpIyVKO/y8nO+Cnw5t9EoTteJ65WJaadBNTuRUw28j4ETs/4AewWFFXSogzO2IIU
 x4UoWPHEXhhjYTnYL+ivRAKJG5iTIbfQS16muO7p2z630FneUYGDvUxx0XuIvbf0
 dXVjKi/rxgfozNyL8HmyeDE3LSjG1b7h7h6MS/ZrdM2LoE4V2pp/Z7qtxs53sIeG
 Y+dsBZEp8G/YReuMPush31Sgepf6l4OQpjKkq54vRMD6su36IMojMYXayLWHmWK7
 RP7n896takZ80tC7GH/pDJUUCoiyvE08/RUxnwg8QPCj5PCMmp2w0/DhhYi1FeFD
 4QxYx7UBYGGFy94Bx97LvBVZXM484F8CJnQreXm7csniy0BME5MeV6S6YNjXsXJH
 M+O0uwdlk24g4SH7E21jUQl6Ch+YtbcH0LRtivGnC6YkcItWkcNRccph3H27wNHH
 jMR43tJsWp6yjXeyWw+vrML9VZ0aK3yyUKPAqcXhC4aIp8DSgVaVuLdRwXHmBqK5
 Phx5+7zuxJ4UpOAQb1RtFOCgRAtfNN57QaXJ0hPuOuzopVOWPHjmcuw4fUdW5YCG
 esjxuO9VAyQZ
 =4kD6
 -----END PGP SIGNATURE-----

Merge tag 'acpi-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI fixes from Rafael Wysocki:
 "Rework the handling of interrupt overrides on AMD Zen-based machines
  to avoid recently introduced regressions (Hans de Goede).

  Note that this is intended as a short-term mitigation for 6.5 and the
  long-term approach will be to attempt to use the configuration left by
  the BIOS, but it requires more investigation"

* tag 'acpi-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI: resource: Add IRQ override quirk for PCSpecialist Elimina Pro 16 M
  ACPI: resource: Honor MADT INT_SRC_OVR settings for IRQ1 on AMD Zen
  ACPI: resource: Always use MADT override IRQ settings for all legacy non i8042 IRQs
  ACPI: resource: revert "Remove "Zen" specific match and quirks"
2023-08-11 12:30:00 -07:00
Linus Torvalds
9578b04c32 Power management fixes for 6.5-rc6
- Make amd-pstate use device_attributes as expected by the CPU root
    kobject (Thomas Weißschuh).
 
  - Restore the previous behavior of resume_store() when hibernation is
    not available which is to return the full number of bytes that were
    to be written by user space (Vlastimil Babka).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAmTWgJ8SHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxGEgP/01+F+nmq0c5QebC3LWw4cyYuepeCJ86
 jfIbJR+XHOoiTaQMORHKBEk8xlelL/R65tRhkB/Gq1uFzeIId+xYJJlsW4Lpj7bz
 rx/FXOAW8mAyPe/kNitBtcjh4tqEiPBiVzn1tKTA4OOLm0CzOE5v9KML93U2vsOa
 Y2I3Jp1N6HHC8oRzbYpQgvB6R2MXX/oRd5fCvrVyMidFFbgYz8sWssRe8eUTGFAj
 U/bufaKM7N/qlavikSul1f4T3KpRN+xpu7+I3W6M5/w0EQt663u3TffY1Mo+qllB
 uoIM7emwsR6J6WsJyWbHgZEh/fIPmPAhGtsUsam9dN4aoDXfac2Trqrf+xYYbAtS
 7mafAyWa+NxQCy/90QxoTrqhj3U4/dIbne4l1ZqgZQ7vyzM/NA4Gi0VBDEpt1BZU
 q6uvhS4PXvkRm/PezQSQCSMaP66F0erMCHxKTXTN1wYNob0AKjV6l1bmG5LdPcIh
 Nsk+CDkAVGmbqfDrtek9FfJZWgH3/lPDg0oVVMi9WiE8CdhYfKoB+Eh/MFVGiiDg
 69cogAHqTUeuB46NPNedeOacGc6F0+mnAwkgNkClCTCHZJ0QSDlh2yVR003ZhnUj
 sHx6jf6rYodW+nBQydjUzVm+twH47tltY0ibzN3ZIXiMM0UlALHBF+Oj4hOtGxUa
 jiiqkLyB/9kH
 =0RaA
 -----END PGP SIGNATURE-----

Merge tag 'pm-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management fixes from Rafael Wysocki:
 "These fix an amd-pstate cpufreq driver issues and recently introduced
  hibernation-related breakage.

  Specifics:

   - Make amd-pstate use device_attributes as expected by the CPU root
     kobject (Thomas Weißschuh)

   - Restore the previous behavior of resume_store() when hibernation is
     not available which is to return the full number of bytes that were
     to be written by user space (Vlastimil Babka)"

* tag 'pm-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  cpufreq: amd-pstate: fix global sysfs attribute type
  PM: hibernate: fix resume_store() return value when hibernation not available
2023-08-11 12:24:22 -07:00
Tony Lindgren
04c7f60ca4 serial: core: Fix serial core port id, including multiport devices
We want to fix the serial core port DEVNAME to use a port id of the
hardware specific controller port instance instead of the port->line.

For example, the 8250 driver sets up a number of serial8250 ports
initially that can be inherited by the hardware specific driver. At that
the port->line no longer decribes the port's relation to the serial core
controller instance.

Let's fix the issue by assigning port->port_id for each serial core
controller port instance.

Fixes: 7d695d8376 ("serial: core: Fix serial_base_match() after fixing controller port name")
Tested-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230811103648.2826-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-11 21:19:22 +02:00
Jiri Slaby (SUSE)
3d9e6f556e serial: 8250: drop lockdep annotation from serial8250_clear_IER()
The port lock is not always held when calling serial8250_clear_IER().
When an oops is in progress, the lock is tried to be taken and when it
is not, a warning is issued:
 WARNING: CPU: 0 PID: 1 at drivers/tty/serial/8250/8250_port.c:707 	+0x57/0x60
 Modules linked in:
 CPU: 0 PID: 1 Comm: init Not tainted 6.5.0-rc5-1.g225bfb7-default+ #774 00f1be860db663ed29479b8255d3b01ab1135bd3
 Hardware name: QEMU Standard PC ...
 RIP: 0010:serial8250_clear_IER+0x57/0x60
...
 Call Trace:
  <TASK>
  serial8250_console_write+0x9e/0x4b0
  console_flush_all+0x217/0x5f0
...

Therefore, remove the annotation as it doesn't hold for all invocations.

The other option would be to make the lockdep test conditional on
'oops_in_progress' or pass 'locked' from serial8250_console_write(). I
don't think, that is worth it.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Reported-by: Vlastimil Babka <vbabka@suse.cz>
Cc: John Ogness <john.ogness@linutronix.de>
Fixes: d0b309a5d3 (serial: 8250: synchronize and annotate UART_IER access)
Link: https://lore.kernel.org/r/20230811064340.13400-1-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-11 21:19:18 +02:00
Yi Yang
3c4f8333b5 tty: n_gsm: fix the UAF caused by race condition in gsm_cleanup_mux
In commit 9b9c8195f3 ("tty: n_gsm: fix UAF in gsm_cleanup_mux"), the UAF
problem is not completely fixed. There is a race condition in
gsm_cleanup_mux(), which caused this UAF.

The UAF problem is triggered by the following race:
task[5046]                     task[5054]
-----------------------        -----------------------
gsm_cleanup_mux();
dlci = gsm->dlci[0];
mutex_lock(&gsm->mutex);
                               gsm_cleanup_mux();
			       dlci = gsm->dlci[0]; //Didn't take the lock
gsm_dlci_release(gsm->dlci[i]);
gsm->dlci[i] = NULL;
mutex_unlock(&gsm->mutex);
                               mutex_lock(&gsm->mutex);
			       dlci->dead = true; //UAF

Fix it by assigning values after mutex_lock().

Link: https://syzkaller.appspot.com/text?tag=CrashReport&x=176188b5a80000
Cc: stable <stable@kernel.org>
Fixes: 9b9c8195f3 ("tty: n_gsm: fix UAF in gsm_cleanup_mux")
Fixes: aa371e96f0 ("tty: n_gsm: fix restart handling via CLD command")
Signed-off-by: Yi Yang <yiyang13@huawei.com>
Co-developed-by: Qiumiao Zhang <zhangqiumiao1@huawei.com>
Signed-off-by: Qiumiao Zhang <zhangqiumiao1@huawei.com>
Link: https://lore.kernel.org/r/20230811031121.153237-1-yiyang13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-11 21:17:02 +02:00
Linus Torvalds
360e694282 block-6.5-2023-08-11
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEwPw5LcreJtl1+l5K99NY+ylx4KYFAmTWfLQQHGF4Ym9lQGtl
 cm5lbC5kawAKCRD301j7KXHgpg3nEACROhaeX6cpeDCSTqDVDW/ontbyn15eX7ep
 tGPLn/TVtKv2AztIobEinS08MdywqBO/VcB7XkxQV9Ov4JqCHIAKhndWI6/HqD9P
 DH3h6tE5JA8RQlNw1aHRrqWWIl1lpDQI6263um1tB2TuaxRa4xuR560jju0VZzAm
 9541ceKlJT8Qc7yG0aiiCv6Bxz+b6Htv3DqCf1mY2yznl3BpN52RQHKhiA0sfnlF
 WKqNsvSJ9/kz3vJbNpFucO7ch8a7W+MzmBx0vf2ickTBpL/3hbhUOrE7dGeKI9rS
 cWh1HaULWqjnKY1uxF9nnapZxm8QoxkT/5T0DgmprKjwuZivfLASAhYpHBc3mT1S
 eQQ0AK8hqx7sPnPeO/kxWtxM2nzRLkeVd19ClbIwux/zDbRrpHWk2/wgnSUUd3/H
 HBbjbgPWbkgLvTOUKhIA5VPBcgkC1efom1+ePzkH/H4TRRuVJwg6s6utGXdgc1PX
 +B4TA8GtXRH/7L0tsblFyJRmd0Y6G7gYE/yy0DYZTMie3oaWrKx3lmz48AQUtEzh
 DG46VRA4wnthHRlw3mkLP7C6z4PJvK9WWBiK11eZ9VfJMF643FNpXQ3/bviR9pfF
 kXdwYXoi1mlnsQ0VUhu2f+JeV4hHalrjwD/VE2H0E8Ogb4ezmJteLyiZKcw5xwaA
 Hmtmbb7Qxw==
 =+1Vt
 -----END PGP SIGNATURE-----

Merge tag 'block-6.5-2023-08-11' of git://git.kernel.dk/linux

Pull block fixes from Jens Axboe:

 - NVMe pull request via Keith:
      - Fixes for request_queue state (Ming)
      - Another uuid quirk (August)

 - RCU poll fix for NVMe (Ming)

 - Fix for an IO stall with polled IO (me)

 - Fix for blk-iocost stats enable/disable accounting (Chengming)

 - Regression fix for large pages for zram (Christoph)

* tag 'block-6.5-2023-08-11' of git://git.kernel.dk/linux:
  nvme: core: don't hold rcu read lock in nvme_ns_chr_uring_cmd_iopoll
  blk-iocost: fix queue stats accounting
  block: don't make REQ_POLLED imply REQ_NOWAIT
  block: get rid of unused plug->nowait flag
  zram: take device and not only bvec offset into account
  nvme-pci: add NVME_QUIRK_BOGUS_NID for Samsung PM9B1 256G and 512G
  nvme-rdma: fix potential unbalanced freeze & unfreeze
  nvme-tcp: fix potential unbalanced freeze & unfreeze
  nvme: fix possible hang when removing a controller during error recovery
2023-08-11 12:14:08 -07:00
Jiri Slaby (SUSE)
e67d7f60d2 tty: gdm724x: simplify gdm_tty_write()
len and remain can never be negative in gdm_tty_write(). So remove such
a check and move the check of remaining bytes to the loop condition.
This way, the preceding 'if' is now superfluous too. Fix all that and
make the code cleaner.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Cc: linux-staging@lists.linux.dev
Link: https://lore.kernel.org/r/20230810103900.19353-1-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-11 21:13:21 +02:00
Jiri Slaby (SUSE)
c70fd7c0e9 tty: rfcomm: convert counts to size_t
Unify the type of tty_operations::write() counters with the 'count'
parameter. I.e. use size_t for them.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>
Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Link: https://lore.kernel.org/r/20230810091510.13006-37-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-11 21:12:47 +02:00
Jiri Slaby (SUSE)
6fcd3b6728 tty: hso: simplify hso_serial_write()
There is no need for two more variables in hso_serial_write(). Switch to
min_t() and eliminate those.

Furthermore, the 'if-goto' is superfluous as memcpy() of zero count is a
nop. So is addition of zero. So remove the 'if-goto' completely.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Link: https://lore.kernel.org/r/20230810091510.13006-36-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-11 21:12:47 +02:00
Jiri Slaby (SUSE)
c3e5c706ae tty: gdm724x: convert counts to size_t
Unify the type of tty_operations::write() counters with the 'count'
parameter. I.e. use size_t for them.

This includes changing constants to UL to keep min() and avoid min_t().

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: linux-staging@lists.linux.dev
Link: https://lore.kernel.org/r/20230810091510.13006-35-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-11 21:12:47 +02:00
Jiri Slaby (SUSE)
cfc7c12b50 tty: vcc: convert counts to size_t
Unify the type of tty_operations::write() counters with the 'count'
parameter. I.e. use size_t for them.

This includes changing vcc_port::chars_in_buffer to size_t to keep min()
and avoid min_t().

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Link: https://lore.kernel.org/r/20230810091510.13006-34-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-11 21:12:47 +02:00
Jiri Slaby (SUSE)
8428e5223e tty: hvc: convert counts to size_t
Unify the type of tty_operations::write() counters with the 'count'
parameter. I.e. use size_t for them.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20230810091510.13006-33-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-11 21:12:47 +02:00
Jiri Slaby (SUSE)
49b8220cee tty: ldops: unify to u8
Some hooks in struct tty_ldisc_ops still reference buffers by 'unsigned
char'. Unify to 'u8' as the rest of the tty layer does.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>
Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810091510.13006-32-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-11 21:12:47 +02:00
Jiri Slaby (SUSE)
3e04ba41f2 tty: audit: unify to u8
Somewhere, we use 'char', somewhere 'unsigned char'. Unify to 'u8' as
the rest of the tty layer does.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20230810091510.13006-31-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-11 21:12:46 +02:00