Commit graph

1013799 commits

Author SHA1 Message Date
Rui Miguel Silva
60d789f3bf usb: isp1760: add support for isp1763
isp1763 have some differences from the isp1760, 8 bit address for
registers and 16 bit for values, no bulk access to memory addresses,
16 PTD's instead of 32.

Following the regmap work done before add the registers, memory access
and add the functions to support differences in setup sequences.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Link: https://lore.kernel.org/r/20210513084717.2487366-8-rui.silva@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 20:05:32 +02:00
Rui Miguel Silva
3eb96e04be usb: isp1760: use dr_mode binding
There is already a binding to describe the dual role mode (dr_mode),
use that instead of defining a new one (port1-otg).

Update driver code and devicetree files that use that port1-otg
binding.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Link: https://lore.kernel.org/r/20210513084717.2487366-7-rui.silva@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 20:05:32 +02:00
Rui Miguel Silva
a74f639c5b usb: isp1760: hcd: refactor mempool config and setup
In preparation to support other family member IP, which may have
different memory layout. Drop macros and setup a configuration
struct.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Link: https://lore.kernel.org/r/20210513084717.2487366-6-rui.silva@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 20:05:32 +02:00
Rui Miguel Silva
f9a88370e6 usb: isp1760: remove platform data struct and code
Since the removal of the Blackfin port with:
commit 4ba66a9760 ("arch: remove blackfin port")

No one is using or referencing this header and platform data struct.
Remove them.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Link: https://lore.kernel.org/r/20210513084717.2487366-5-rui.silva@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 20:05:32 +02:00
Rui Miguel Silva
03e28d5233 usb: isp1760: use relaxed primitives
Use io relaxed access memory primitives to satisfy strict type
checking (__force).

This will fix some existing sparse warnings:
sparse: warning: cast to restricted __le32

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Link: https://lore.kernel.org/r/20210513084717.2487366-4-rui.silva@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 20:05:32 +02:00
Rui Miguel Silva
1da9e1c068 usb: isp1760: move to regmap for register access
Rework access to registers and memory to use regmap framework.
No change in current feature or way of work is intended with this
change.

This will allow to reuse this driver with other IP of this family,
for example isp1763, with little changes and effort.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Link: https://lore.kernel.org/r/20210513084717.2487366-3-rui.silva@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 20:05:31 +02:00
Rui Miguel Silva
abfabc8ae3 usb: isp1760: fix strict typechecking
There are a lot of pre-existing typechecking warnings around the
access and assign of elements of ptd structure of __dw type.

sparse: warning: invalid assignment: |=
sparse:    left side has type restricted __dw
sparse:    right side has type unsigned int

or

warning: restricted __dw degrades to integer

or

sparse: warning: incorrect type in assignment (different base types)
sparse:    expected restricted __dw [usertype] dw4
sparse:    got unsigned int [assigned] [usertype] usof

To handle this, annotate conversions along the {TO,FROM}_DW* macros
and some assignments and function arguments.

This clean up completely all sparse warnings for this driver.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Link: https://lore.kernel.org/r/20210513084717.2487366-2-rui.silva@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 20:05:31 +02:00
Zhen Lei
24bb0076d7 usb: fix spelling mistakes in header files
Fix some spelling mistakes in comments:
trasfer ==> transfer
consumtion ==> consumption
endoint ==> endpoint
sharable ==> shareable
contraints ==> constraints
Auxilary ==> Auxiliary
correspondig ==> corresponding
interupt ==> interrupt
inifinite ==> infinite
assignement ==> assignment

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Link: https://lore.kernel.org/r/20210517094020.7310-1-thunder.leizhen@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 20:05:31 +02:00
Chunfeng Yun
ddaf0d6dc4 usb: common: usb-conn-gpio: use dev_err_probe() to print log
Use dev_err_probe() to print debug or error message depending on
whether the error value is -DPROBE_DEFER or not.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1621406386-18838-2-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 14:09:54 +02:00
Chunfeng Yun
880287910b usb: common: usb-conn-gpio: fix NULL pointer dereference of charger
When power on system with OTG cable, IDDIG's interrupt arises before
the charger registration, it will cause a NULL pointer dereference,
fix the issue by registering the power supply before requesting
IDDIG/VBUS irq.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1621406386-18838-1-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 14:09:54 +02:00
Andre Przywara
c63fef4c43 dt-bindings: usb: Add H616 compatible string
The H616 has four PHYs as the H3, along with their respective clock
gates and resets, so the property description is identical.

However the PHYs itself need some special bits, so we need a new
compatible string for it.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210519104152.21119-9-andre.przywara@arm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 14:08:34 +02:00
Andre Przywara
3f87443b4e dt-bindings: usb: sunxi-musb: Add H616 compatible string
The H616 MUSB peripheral is compatible to the H3 one (8 endpoints).

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210519104152.21119-10-andre.przywara@arm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 14:08:01 +02:00
Tony Lindgren
7d076c2f55 usb: musb: Check devctl status again for a spurious session request
On start-up, we can get a spurious session request interrupt with nothing
connected. After that the devctl session bit will silently clear, but the
musb hardware is never idled until a cable is plugged in, or the glue
layer module is reloaded.

Let's just check the session bit again in 3 seconds in peripheral mode
to catch the issue.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20210518150615.53464-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 14:07:57 +02:00
Tony Lindgren
62d472d8ad usb: musb: Add missing PM suspend and resume functions for 2430 glue
Looks like we are missing suspend and resume functions for pm_ops that
are needed to idle the hardware for system suspend for 2430 glue layer.

We can rely on the driver internal PM runtime state, and call driver
functions to idle the hardware on suspend if needed. There is no need
to add a dependency to PM runtime for system suspend here.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20210518074449.17070-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 14:07:16 +02:00
Chris Chiu
c5c7489dc9 Revert "USB: Add reset-resume quirk for WD19's Realtek Hub"
This reverts commit ca91fd8c76 ("USB: Add reset-resume quirk for
WD19's Realtek Hub"). The previous patch in the series now handles
the problematic hubs by checking the port status and handling it
accordingly when PORT_SUSPEND timeout occurs. We don't need to use
reset-resume all the time.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Chris Chiu <chris.chiu@canonical.com>
Link: https://lore.kernel.org/r/20210514045405.5261-3-chris.chiu@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 14:06:29 +02:00
Chris Chiu
7142452387 USB: Verify the port status when timeout happens during port suspend
On the Realtek high-speed Hub(0bda:5487), the port which has wakeup
enabled_descendants will sometimes timeout when setting PORT_SUSPEND
feature. After checking the PORT_SUSPEND bit in wPortStatus, it is
already set which means the port has been suspended. We should treat
it suspended to make sure it will be resumed correctly.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Chris Chiu <chris.chiu@canonical.com>
Link: https://lore.kernel.org/r/20210514045405.5261-2-chris.chiu@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 14:06:29 +02:00
Gustavo A. R. Silva
106133dacc usb: gadget: s3c-hsudc: Use struct_size() in devm_kzalloc()
Make use of the struct_size() helper instead of an open-coded version,
in order to avoid any potential type mistakes or integer overflows
that, in the worse scenario, could lead to heap overflows.

This code was detected with the help of Coccinelle and, audited and
fixed manually.

Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20210513193353.GA196565@embeddedor
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 14:05:27 +02:00
Rikard Falkeborn
53ad92fdf7 usb: gadget: tegra-xudc: Constify static structs
Constify a couple of ops-structs that are never modified, to let the
compiler put them in read-only memory.

Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20210513200908.448351-1-rikard.falkeborn@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 14:05:21 +02:00
Gopalakrishnan Santhanam
005775859a fsl-usb: add need_oc_pp_cycle flag for 85xx also
Commit e6604a7fd7 ("EHCI: Quirk flag for port power handling
on overcurrent.") activated the quirks handling (flag need_oc_pp_cycle)
for Freescale 83xx based boards.
Activate same for 85xx based boards as well.

Cc: xe-linux-external@cisco.com
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Gopalakrishnan Santhanam <gsanthan@cisco.com>
Signed-off-by: Daniel Walker <danielwa@cisco.com>
Link: https://lore.kernel.org/r/20210513083225.68912-1-gsanthan@cisco.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 14:04:57 +02:00
Greg Kroah-Hartman
1d50071b53 USB: gadget: pxa25x_udc: remove dentry storage for debugfs file
There is no need to store the dentry pointer for a debugfs file that we
only use to remove it when the device goes away.  debugfs can do the
lookup for us instead, saving us some trouble, and making things smaller
overall.

Cc: Daniel Mack <daniel@zonque.org>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Felipe Balbi <balbi@kernel.org>
Cc: linux-usb@vger.kernel.org
Acked-by: Daniel Mack <daniel@zonque.org>
Link: https://lore.kernel.org/r/20210518162054.3697992-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 13:45:50 +02:00
Greg Kroah-Hartman
1531a2bb44 USB: gadget: s3c2410_udc: remove dentry storage for debugfs file
There is no need to store the dentry pointer for a debugfs file that we
only use to remove it when the device goes away.  debugfs can do the
lookup for us instead, saving us some trouble, and making things smaller
overall.

Cc: Felipe Balbi <balbi@kernel.org>
Cc: linux-usb@vger.kernel.org
Link: https://lore.kernel.org/r/20210518162105.3698090-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 13:45:36 +02:00
Greg Kroah-Hartman
e3d59eff47 USB: gadget: lpc32xx_udc: remove debugfs dentry variable
There is no need to store the dentry for a fixed filename that we have
the string for.  So just have debugfs look it up when we need it to
remove the file, no need to store it anywhere locally.

Note, this driver is broken in that debugfs will not work for more than
one instance of the device it supports.  But given that this patch does
not change that, and no one has ever seemed to notice, it must not be an
issue...

Cc: Felipe Balbi <balbi@kernel.org>
Cc: Vladimir Zapolskiy <vz@mleia.com>
Cc: linux-usb@vger.kernel.org
Acked-by: Vladimir Zapolskiy <vz@mleia.com>
Acked-by: Felipe Balbi <balbi@kernel.org>
Link: https://lore.kernel.org/r/20210518162035.3697860-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 13:44:40 +02:00
Andy Shevchenko
92c6dc0beb usb: typec: wcove: Fx wrong kernel doc format
The top comment in the file wrongly uses kernel doc format:

.../typec/tcpm/wcove.c:17: warning: expecting prototype for typec_wcove.c - WhiskeyCove PMIC USB Type(). Prototype was for WCOVE_CHGRIRQ0() instead

Fix this by converting it to plain comment.

Fixes: ae8a2ca8a2 ("usb: typec: Group all TCPCI/TCPM code together")
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210519085527.48657-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 13:44:12 +02:00
Greg Kroah-Hartman
9fbf82c764 Merge 5.13-rc2 into usb-next
We need the USB fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-17 09:45:58 +02:00
Linus Torvalds
d07f6ca923 Linux 5.13-rc2 2021-05-16 15:27:44 -07:00
Linus Torvalds
28183dbf54 Driver core fixes for 5.13-rc2
Here are 2 driver fixes for driver core changes that happened in
 5.13-rc1.
 
 The clk driver fix resolves a many-reported issue with booting some
 devices, and the USB typec fix resolves the reported problem of USB
 systems on some embedded boards.
 
 Both of these have been in linux-next this week with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCYKDc2A8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ylF8QCeIeAZ24HKyzGiS2CPYHEHBdiip40An1eefar7
 WvvZuHQCZV3gfVEHdVpp
 =jCwI
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core fixes from Greg KH:
 "Here are two driver fixes for driver core changes that happened in
  5.13-rc1.

  The clk driver fix resolves a many-reported issue with booting some
  devices, and the USB typec fix resolves the reported problem of USB
  systems on some embedded boards.

  Both of these have been in linux-next this week with no reported
  issues"

* tag 'driver-core-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
  clk: Skip clk provider registration when np is NULL
  usb: typec: tcpm: Don't block probing of consumers of "connector" nodes
2021-05-16 10:13:14 -07:00
Linus Torvalds
6942d81a8f Staging/IIO driver fixes for 5.13-rc2
Here are some small IIO driver fixes and one Staging driver fix for
 5.13-rc2.
 
 Nothing major, just some resolutions for reported problems:
 	- gcc11 bogus warning fix for rtl8723bs
 	- iio driver tiny fixes
 
 All of these have been in linux-next for many days with no reported
 issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCYKDcQA8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+yk8hQCg0+YRIUZfhBm1qUiq9JuTBr62kM8An2qYpr9Q
 8iiAoBETOYo5P5HByG52
 =Dyx9
 -----END PGP SIGNATURE-----

Merge tag 'staging-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging and IIO driver fixes from Greg KH:
 "Here are some small IIO driver fixes and one Staging driver fix for
  5.13-rc2.

  Nothing major, just some resolutions for reported problems:

   - gcc-11 bogus warning fix for rtl8723bs

   - iio driver tiny fixes

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

* tag 'staging-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  iio: tsl2583: Fix division by a zero lux_val
  iio: core: return ENODEV if ioctl is unknown
  iio: core: fix ioctl handlers removal
  iio: gyro: mpu3050: Fix reported temperature value
  iio: hid-sensors: select IIO_TRIGGERED_BUFFER under HID_SENSOR_IIO_TRIGGER
  iio: proximity: pulsedlight: Fix rumtime PM imbalance on error
  iio: light: gp2ap002: Fix rumtime PM imbalance on error
  staging: rtl8723bs: avoid bogus gcc warning
2021-05-16 10:06:19 -07:00
Linus Torvalds
4a668429e0 USB fixes for 5.13-rc2
Here are some small USB fixes for 5.13-rc2.  They consist of a number of
 resolutions for reported issues:
 	- typec fixes for found problems
 	- xhci fixes and quirk additions
 	- dwc3 driver fixes
 	- minor fixes found by Coverity
 	- cdc-wdm fixes for reported problems
 
 All of these have been in linux-next for a few days with no reported
 issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCYKDexQ8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+yk72gCffEE5ZfO64iFqARPx9Mim04YaSDUAnRJM1mBk
 dsRT2X0yddqdKek6fN+g
 =C9x7
 -----END PGP SIGNATURE-----

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

Pull USB fixes from Greg KH:
 "Here are some small USB fixes for 5.13-rc2. They consist of a number
  of resolutions for reported issues:

   - typec fixes for found problems

   - xhci fixes and quirk additions

   - dwc3 driver fixes

   - minor fixes found by Coverity

   - cdc-wdm fixes for reported problems

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

* tag 'usb-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (28 commits)
  usb: core: hub: fix race condition about TRSMRCY of resume
  usb: typec: tcpm: Fix SINK_DISCOVERY current limit for Rp-default
  xhci: Add reset resume quirk for AMD xhci controller.
  usb: xhci: Increase timeout for HC halt
  xhci: Do not use GFP_KERNEL in (potentially) atomic context
  xhci: Fix giving back cancelled URBs even if halted endpoint can't reset
  xhci-pci: Allow host runtime PM as default for Intel Alder Lake xHCI
  usb: musb: Fix an error message
  usb: typec: tcpm: Fix wrong handling for Not_Supported in VDM AMS
  usb: typec: tcpm: Send DISCOVER_IDENTITY from dedicated work
  usb: typec: ucsi: Retrieve all the PDOs instead of just the first 4
  usb: fotg210-hcd: Fix an error message
  docs: usb: function: Modify path name
  usb: dwc3: omap: improve extcon initialization
  usb: typec: ucsi: Put fwnode in any case during ->probe()
  usb: typec: tcpm: Fix wrong handling in GET_SINK_CAP
  usb: dwc2: Remove obsolete MODULE_ constants from platform.c
  usb: dwc3: imx8mp: fix error return code in dwc3_imx8mp_probe()
  usb: dwc3: imx8mp: detect dwc3 core node via compatible string
  usb: dwc3: gadget: Return success always for kick transfer in ep queue
  ...
2021-05-16 09:55:05 -07:00
Linus Torvalds
8ce3648158 Two fixes for timers:
- Use the ALARM feature check in the alarmtimer core code insted of
     the old method of checking for the set_alarm() callback. Drivers
     can have that callback set but the feature bit cleared. If such
     a RTC device is selected then alarms wont work.
 
   - Use a proper define to let the preprocessor check whether Hyper-V VDSO
     clocksource should be active. The code used a constant in an enum with
     #ifdef, which evaluates to always false and disabled the clocksource
     for VDSO.
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCgAxFiEEQp8+kY+LLUocC4bMphj1TA10mKEFAmChLI8THHRnbHhAbGlu
 dXRyb25peC5kZQAKCRCmGPVMDXSYoUJMD/wOQ/R7jXe/EWti3+w11TATvkP+ZzDv
 LcAfZ/ZP8wgrUTbjLqTTyeOFoI9q39emnq3FvCoRsF+rdHRbnZNAB3kWQmh/i1tL
 j8BuGogzvVLkBmriQIzVxYgEroCZVySWkO27B7ToBq64IeI4IBVB4jQiJis614m7
 5wTHKgN0MkAtWUmwDqkqycFDuWyZNPkR3Ht26zk46Lvk0dmIPh14zbVzezfFEtq4
 9DBeGuLDLVtzaBNLWUvnpXL7wxuFB+E8euO5otbmgRNz7CXaE6e6zy6zspK2ahmp
 FRq+nrG6yK6ucoFhGFABfKZCGorhh1ghhniPUXQKP9B29z146pN6TLFAVAutBk4z
 RoRdyGb9npoO1pB0f2tl0U65TBBlMCnLnDB3hcQ/eyMG7AC8ABHalBIFUjzEPB4b
 3eDa+ZxfkW8/oiSLTssQiJ6TJW1EQNaVja1TuHvtPi5RdasbS4LEkQnDaePQ3/nl
 tDLekfsDF4KxetZehIlRDqyN9cqIHVphs3pTysyWR7+aOTduWWF58ZtgR7SvTCVu
 7Zu+PhP06A1MtEugnwcAcpG5XYCsAXdZXinuQhPndXqazN4wMJkanXNk03z//JmQ
 wG//lFAC+9EfA8i9RDr2DeE6JISD2g+jj2Di9bjjxelp5Mi0bNZ0zdIiww6EJjRg
 v4F0vCp3By8SQg==
 =TruV
 -----END PGP SIGNATURE-----

Merge tag 'timers-urgent-2021-05-16' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer fixes from Thomas Gleixner:
 "Two fixes for timers:

   - Use the ALARM feature check in the alarmtimer core code insted of
     the old method of checking for the set_alarm() callback.

     Drivers can have that callback set but the feature bit cleared. If
     such a RTC device is selected then alarms wont work.

   - Use a proper define to let the preprocessor check whether Hyper-V
     VDSO clocksource should be active.

     The code used a constant in an enum with #ifdef, which evaluates to
     always false and disabled the clocksource for VDSO"

* tag 'timers-urgent-2021-05-16' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  clocksource/drivers/hyper-v: Re-enable VDSO_CLOCKMODE_HVCLOCK on X86
  alarmtimer: Check RTC features instead of ops
2021-05-16 09:42:13 -07:00
Linus Torvalds
f44e58bb19 xen: branch for v5.13-rc2
-----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQRTLbB6QfY48x44uB6AXGG7T9hjvgUCYKC7SQAKCRCAXGG7T9hj
 vpmTAQCmz5LvFHN9eAfq5jwz4cMvrN5h8aWnZjChgiAFZl0T7wD/TEDjtK18piUM
 xWjZDUefMonnk0U8+bPityDmt8UV2AI=
 =KFFw
 -----END PGP SIGNATURE-----

Merge tag 'for-linus-5.13b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull xen fixes from Juergen Gross:

 - two patches for error path fixes

 - a small series for fixing a regression with swiotlb with Xen on Arm

* tag 'for-linus-5.13b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
  xen/swiotlb: check if the swiotlb has already been initialized
  arm64: do not set SWIOTLB_NO_FORCE when swiotlb is required
  xen/arm: move xen_swiotlb_detect to arm/swiotlb-xen.h
  xen/unpopulated-alloc: fix error return code in fill_list()
  xen/gntdev: fix gntdev_mmap() error exit path
2021-05-16 09:39:04 -07:00
Linus Torvalds
ccb013c29d - Enable -Wundef for the compressed kernel build stage
- Reorganize SEV code to streamline and simplify future development
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEzv7L6UO9uDPlPSfHEsHwGGHeVUoFAmCg1XQACgkQEsHwGGHe
 VUpRKA//dwzDD1QU16JucfhgFlv/9OTm48ukSwAb9lZjDEy4H1CtVL3xEHFd7L3G
 LJp0LTW+OQf0/0aGlQp/cP6sBF6G9Bf4mydx70Id4SyCQt8eZDodB+ZOOWbeteWq
 p92fJPbX8CzAglutbE+3v/MD8CCAllTiLZnJZPVj4Kux2/wF6EryDgF1+rb5q8jp
 ObTT9817mHVwWVUYzbgceZtd43IocOlKZRmF1qivwScMGylQTe1wfMjunpD5pVt8
 Zg4UDNknNfYduqpaG546E6e1zerGNaJK7SHnsuzHRUVU5icNqtgBk061CehP9Ksq
 DvYXLUl4xF16j6xJAqIZPNrBkJGdQf4q1g5x2FiBm7rSQU5owzqh5rkVk4EBFFzn
 UtzeXpqbStbsZHXycyxBNdq2HXxkFPf2NXZ+bkripPg+DifOGots1uwvAft+6iAE
 GudK6qxAvr8phR1cRyy6BahGtgOStXbZYEz0ZdU6t7qFfZMz+DomD5Jimj0kAe6B
 s6ras5xm8q3/Py87N/KNjKtSEpgsHv/7F+idde7ODtHhpRL5HCBqhkZOSRkMMZqI
 ptX1oSTvBXwRKyi5x9YhkKHUFqfFSUTfJhiRFCWK+IEAv3Y7SipJtfkqxRbI6fEV
 FfCeueKDDdViBtseaRceVLJ8Tlr6Qjy27fkPPTqJpthqPpCdoZ0=
 =ENfF
 -----END PGP SIGNATURE-----

Merge tag 'x86_urgent_for_v5.13_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Borislav Petkov:
 "The three SEV commits are not really urgent material. But we figured
  since getting them in now will avoid a huge amount of conflicts
  between future SEV changes touching tip, the kvm and probably other
  trees, sending them to you now would be best.

  The idea is that the tip, kvm etc branches for 5.14 will all base
  ontop of -rc2 and thus everything will be peachy. What is more, those
  changes are purely mechanical and defines movement so they should be
  fine to go now (famous last words).

  Summary:

   - Enable -Wundef for the compressed kernel build stage

   - Reorganize SEV code to streamline and simplify future development"

* tag 'x86_urgent_for_v5.13_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/boot/compressed: Enable -Wundef
  x86/msr: Rename MSR_K8_SYSCFG to MSR_AMD64_SYSCFG
  x86/sev: Move GHCB MSR protocol and NAE definitions in a common header
  x86/sev-es: Rename sev-es.{ch} to sev.{ch}
2021-05-16 09:31:06 -07:00
Linus Torvalds
63d1cb53e2 powerpc fixes for 5.13 #3
- Fix a regression in the conversion of the 64-bit BookE interrupt entry to C.
 
  - Fix KVM hosts running with the hash MMU since the recent KVM gfn changes.
 
  - Fix a deadlock in our paravirt spinlocks when hcall tracing is enabled.
 
  - Several fixes for oopses in our runtime code patching for security mitigations.
 
  - A couple of minor fixes for the recent conversion of 32-bit interrupt entry/exit to C.
 
  - Fix __get_user() causing spurious crashes in sigreturn due to a bad inline asm
    constraint, spotted with GCC 11.
 
  - A fix for the way we track IRQ masking state vs NMI interrupts when using the new scv
    system call entry path.
 
  - A couple more minor fixes.
 
 Thanks to: Cédric Le Goater, Christian Zigotzky, Christophe Leroy, Naveen N. Rao, Nicholas
 Piggin Paul Menzel, Sean Christopherson.
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCAAxFiEEJFGtCPCthwEv2Y/bUevqPMjhpYAFAmCgU34THG1wZUBlbGxl
 cm1hbi5pZC5hdQAKCRBR6+o8yOGlgB0/EACeomslDGkG3vxo4VLntOrxaOgxhgYq
 yXYG/hWOj0tpQv63HnGcJuXhrYeQpZXp1hQZEUODuLKoJC1ZHwwu5y/1z95sVyFz
 Nf+YA0DjxWfTbsJXY5OA8jtellCXhsTaPRDGYPi6N+0JI5nZq7p4eguP2GkWM0lA
 9xNhRAD2X7lpioVZzP2G2YAR/vmfcJl+VWN70GVB8SzMUB8vHe5pUa6WJhk+g//y
 annQn53Cbz2Qe43r59iQ6bKYMm7qGTVR5igwmkkfDivHV3RpOql3n/wFd5xtIFjd
 OveBy6wXq/uHqxth5ISsB/DWKLJnAZv506jmFQCol2DbIN5LHNxYFu00QjQimUSf
 rxUdxhLj7Ef6XciI1KPVBXnZsLWMVZhUOPv+xM6FYz+UlWcEi6fJexeAPPn3+AMc
 NoZh8v654l5vgsludkwCiw2jjt3PlYPWZEcUisDntji9lIxnK5vjfgUhy4B+MQR1
 Ty+au0eeGOuUaScy+o4kHB8SuIU9EdYx169W3NST5U4QmgbrdAFld/aOYyDWeyCd
 qlYCylZztn0W704uu84dEXBhEAu5KLeaBwWlQTeF23AUPZsoS3GPwDvFiiy83u6e
 QxPuC57uGfBOtGls6skg5UPev7jY9tc4bOJ1uhZqUr5rv0x8rxeGeDVKS0m9ONdC
 JXWd9ZqowXiPzg==
 =V7PP
 -----END PGP SIGNATURE-----

Merge tag 'powerpc-5.13-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:

 - Fix a regression in the conversion of the 64-bit BookE interrupt
   entry to C.

 - Fix KVM hosts running with the hash MMU since the recent KVM gfn
   changes.

 - Fix a deadlock in our paravirt spinlocks when hcall tracing is
   enabled.

 - Several fixes for oopses in our runtime code patching for security
   mitigations.

 - A couple of minor fixes for the recent conversion of 32-bit interrupt
   entry/exit to C.

 - Fix __get_user() causing spurious crashes in sigreturn due to a bad
   inline asm constraint, spotted with GCC 11.

 - A fix for the way we track IRQ masking state vs NMI interrupts when
   using the new scv system call entry path.

 - A couple more minor fixes.

Thanks to Cédric Le Goater, Christian Zigotzky, Christophe Leroy,
Naveen N. Rao, Nicholas Piggin Paul Menzel, and Sean Christopherson.

* tag 'powerpc-5.13-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/64e/interrupt: Fix nvgprs being clobbered
  powerpc/64s: Make NMI record implicitly soft-masked code as irqs disabled
  powerpc/64s: Fix stf mitigation patching w/strict RWX & hash
  powerpc/64s: Fix entry flush patching w/strict RWX & hash
  powerpc/64s: Fix crashes when toggling entry flush barrier
  powerpc/64s: Fix crashes when toggling stf barrier
  KVM: PPC: Book3S HV: Fix kvm_unmap_gfn_range_hv() for Hash MMU
  powerpc/legacy_serial: Fix UBSAN: array-index-out-of-bounds
  powerpc/signal: Fix possible build failure with unsafe_copy_fpr_{to/from}_user
  powerpc/uaccess: Fix __get_user() with CONFIG_CC_HAS_ASM_GOTO_OUTPUT
  powerpc/pseries: warn if recursing into the hcall tracing code
  powerpc/pseries: use notrace hcall variant for H_CEDE idle
  powerpc/pseries: Don't trace hcall tracing wrapper
  powerpc/pseries: Fix hcall tracing recursion in pv queued spinlocks
  powerpc/syscall: Calling kuap_save_and_lock() is wrong
  powerpc/interrupts: Fix kuep_unlock() call
2021-05-15 16:39:45 -07:00
Linus Torvalds
c12a29ed90 Fix an idle CPU selection bug, and an AMD Ryzen maximum frequency enumeration bug.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCgAvFiEEBpT5eoXrXCwVQwEKEnMQ0APhK1gFAmCffOARHG1pbmdvQGtl
 cm5lbC5vcmcACgkQEnMQ0APhK1iHBRAAm7p68+/sec2neJ2SxrOdl3kWU5yUXgM/
 X2WUQiU8ERAI1IfaKcJBbJCDlIr7Pufwec31IvLpyM5my+pfNkuB9EcLxwQuUZ8y
 2IZXF3HlaxWUEfwVqAQ/Dm1J1jExz20vSVzom/2TeE8H1kibdjs6EfouW17FZbwc
 CXtZC5MWArU/Wt5cjm84Cn5JAx0Udw3RKv8O5o3w/gz0RMjTGCzxlS54QwF+j1fG
 r1kRL+64yS1LPofnsEDSqfw52J/agSpVOgOiRtn7RUYPoTlmkYZ7l1JeZe/bukDi
 YsF6uE8nfoRrjhdWVwOpvjEeTzP1hnNBT64piOY+G0wdoBJHmU+jzu5mJIyjxAeY
 BnJqA7cH16F9cIKCPilmsifbptJtli+Y301036sxMBj8IlcbPKdHlW/qG9ibUCeN
 r6IPZnONd5JaDeEUCQl91fhGxDn8JrSew5Bh6Yp8B2KsJ9cXirUoPORjqu7Fccfe
 YRHNPfK8JpSPGv5SSXRrrr6bSdPBhEueqUemfItTGsPpZY/mD0iTIlecol6o0Wfc
 A11rk6Hb1BMVveNSCTrH7VFJ9nsql1XI5C7rp0D4+9uEDEYRHsq9rInZSevbytsI
 ocF03ineypbGmiiLT5cYiwR2+ucheX8WaS+BpGXlxjTwvAV+s0QdeTe9UyW9mySl
 R1ly0Jwpd3Q=
 =Ggm4
 -----END PGP SIGNATURE-----

Merge tag 'sched-urgent-2021-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull scheduler fixes from Ingo Molnar:
 "Fix an idle CPU selection bug, and an AMD Ryzen maximum frequency
  enumeration bug"

* tag 'sched-urgent-2021-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86, sched: Fix the AMD CPPC maximum performance value on certain AMD Ryzen generations
  sched/fair: Fix clearing of has_idle_cores flag in select_idle_cpu()
2021-05-15 10:24:48 -07:00
Linus Torvalds
e7c425b744 Fix a couple of endianness bugs that crept in.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCgAvFiEEBpT5eoXrXCwVQwEKEnMQ0APhK1gFAmCfe/sRHG1pbmdvQGtl
 cm5lbC5vcmcACgkQEnMQ0APhK1iVBw/9GMgwfp85TlB1vGN+ObOpAIAVHA839pIf
 Yvf1nRCWrK7P9+RdU5fZIi2CxuZ7QPcZK8r9zimwvpqhi2PVGfFPsciSVHzVxzll
 bvmqgfXMUWWwOdfUwg8cE3yK31J4s7yetrAx+Vklp/IiO72tvjNIcpxiI9unkyjb
 9c758XtMb4M9cHlNC4g0+yNhZMfOHYsH9/nW+5jWFtvmWOMM7cpGUjees+Do83+H
 qRv8je7aYsyZH6ams9xsVaUv9hyONYG2hSFaTj0Lz8AmCnKjj+NQnydG5i/R0MyX
 9i++JBdfsY3QjeqPQ4Rh82eAeqL3YcPQkReN+jcux7rFPa7ltsJL+wRnQoJcHS0H
 X+MJmBaII7JTE0LF2RXxauPkBeeK56Rg4M+kxI31X5Zq18KTmOjHb2Z4GUVbKzOV
 6jrGu6iujcvpEgmlaku0E35+6e3VaGbDK8QFTXVDEc3Ksa0fkh8WZlVJLI/Y30Vv
 DRMI/w597xyiWYW3lXDFlxy/jnI+YFIFtYtE9ud1j2ftRRv0yp4BYFCRqRNTu0r1
 uYKuDHssfshYscLb2LUumlA0VxOZHqnYZnWOOgyYnpkYyyLs1trI9eFrcgIJdAUi
 mAJzroDsJ6PsSj7AHCYNqcMx9OthDWBT32gYcazo7vFEyuNBDp8E79cI8pQiYGNN
 qEO+Lv1Z5Hk=
 =4nHq
 -----END PGP SIGNATURE-----

Merge tag 'objtool-urgent-2021-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull objtool fixes from Ingo Molnar:
 "Fix a couple of endianness bugs that crept in"

* tag 'objtool-urgent-2021-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  objtool/x86: Fix elf_add_alternative() endianness
  objtool: Fix elf_create_undef_symbol() endianness
2021-05-15 10:18:23 -07:00
Linus Torvalds
077fc64407 Fix build warning on SH.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCgAvFiEEBpT5eoXrXCwVQwEKEnMQ0APhK1gFAmCfed0RHG1pbmdvQGtl
 cm5lbC5vcmcACgkQEnMQ0APhK1hWjg//Qptk6P82mTN9ucObqb/TU3lwyKe5EmS8
 9S7XCixegFoZG0d3eFmGhi4dTBVXDJtbTR7Ej2xI4mXhawtLkO/GiCbTLwMMT/Iw
 zsWjlXFF7dRz1b62R67LPaPhdLfhdub6/OqEan+hAvIgowWLk5kZ04xRz2g5A97R
 DmVHWcTV/4AYvwnIWVNp8IyexXsyH+9noDOotTSeWcO1PerSWDwxd0Cgtoqf2KM8
 leschiz019Fifo8kAEx/zAcrhEISTcze2NtImf0kzPOZ8DiClEFdV1adth2TiMOk
 xVDlesL6mKH88DTCLDg54s89nGRh3xuLjcFNaH6Fm7pr/33AUwE9PdqeA2tcOy3G
 uS6K53eCynn6kkNZVC/wckOQBTZH5hpSwweGKEItKWHpmP8xAuIygDNlHizujgYO
 9bWnxsSFsuWqY4DfE9AmsRE0ZWEIuzbiQeyrJlndMEyM1GG27r7i5CzeyUrm/pvl
 ahLsQuYIZuo93xZbybBXc5oe1mZsCgT/yVgoH9zpADGgtvg4Y1ZAGvgQ1q/a5l8R
 sa3G2iWyq+3KX0eBYXTiqA2w+AvGwFUIhPTXPnKcDiQ7l+a6TH1E6soSRTcUkAff
 dqRMjgXyMxNOL3d14sRypH2WBSh2tMyaqWenCvBlGuxROw5Vh7FynozbqRvjBamF
 zc8NFpRjJho=
 =UQjk
 -----END PGP SIGNATURE-----

Merge tag 'irq-urgent-2021-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull irq fix from Ingo Molnar:
 "Fix build warning on SH"

* tag 'irq-urgent-2021-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  sh: Remove unused variable
2021-05-15 10:13:42 -07:00
Linus Torvalds
91b7a0f063 Fix an assembly constraint that affected LLVM up to version 12.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCgAvFiEEBpT5eoXrXCwVQwEKEnMQ0APhK1gFAmCfdCIRHG1pbmdvQGtl
 cm5lbC5vcmcACgkQEnMQ0APhK1hmJg//bjyDpmdIwuKA5cos+mYD7alSjHycXwLP
 2QllyD9xmhpSUjAotliFD2C0NzkJ3NleasLJ/wucop4wI/gaOlk02bzs34cYIaJT
 yf4NH/to/EtCXMv+hMyAguFbHAcBB79fmB1OKqMw8x7pokYN3f+MPKjC8aTeOUDq
 30Jyq4TDy5u5kzedhsKcdzESQAUKzcIr9+mlAHeFKUOibOukMOsiRFEIiEJydRiq
 gQGUSveObCaIZ7ZGWzuR6jtU/wHSgGIUOl15M1OVrErSs9ty8VionD+RGZ48XZge
 PgfQExyGMUw/DxZNl+UroKclPR9zAb/9/Gnm54b1h4Stdg8GV0a0H65RHD0Ukogt
 vonAp42xgxPIlf6/hHfciT+CS9uMVyFTL0NpywSx8b+88SQkAtrz3uXlTK9kKvpc
 v7jniR9WSiLtcjJQ/eZiA2wuO31ncxaNSA5pK7qlSKf+HWmD+1sOYpdl+uL2NiW7
 bxxrrtfsqjXxZKeuu2DhTBq9IQBpfhCfkmu1rgQ7vWljkMlUgI9P5eDAFbkROCcz
 VgkPxcqg/CbgOaIDoau84eiou/5r1vAehrSskaTXL01+huLq5feaMFB9429B8VT4
 hYg36ECZlRLAlGgsDLdNz5O55uNeZCHW47UUgT7wdwNc4QjKRdHu7JsUgYc/FRP6
 eFXy6baEhcU=
 =ijOe
 -----END PGP SIGNATURE-----

Merge tag 'core-urgent-2021-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 stack randomization fix from Ingo Molnar:
 "Fix an assembly constraint that affected LLVM up to version 12"

* tag 'core-urgent-2021-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  stack: Replace "o" output with "r" input constraint
2021-05-15 10:00:35 -07:00
Linus Torvalds
a4147415bd Merge branch 'akpm' (patches from Andrew)
Merge misc fixes from Andrew Morton:
 "13 patches.

  Subsystems affected by this patch series: resource, squashfs, hfsplus,
  modprobe, and mm (hugetlb, slub, userfaultfd, ksm, pagealloc, kasan,
  pagemap, and ioremap)"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  mm/ioremap: fix iomap_max_page_shift
  docs: admin-guide: update description for kernel.modprobe sysctl
  hfsplus: prevent corruption in shrinking truncate
  mm/filemap: fix readahead return types
  kasan: fix unit tests with CONFIG_UBSAN_LOCAL_BOUNDS enabled
  mm: fix struct page layout on 32-bit systems
  ksm: revert "use GET_KSM_PAGE_NOLOCK to get ksm page in remove_rmap_item_from_tree()"
  userfaultfd: release page in error path to avoid BUG_ON
  squashfs: fix divide error in calculate_skip()
  kernel/resource: fix return code check in __request_free_mem_region
  mm, slub: move slub_debug static key enabling outside slab_mutex
  mm/hugetlb: fix cow where page writtable in child
  mm/hugetlb: fix F_SEAL_FUTURE_WRITE
2021-05-15 09:42:27 -07:00
Linus Torvalds
f36edc5533 ARC updates for 5.13-rc2
- PAE fixes
 
  - syscall num check off-by-one bug
 
  - miscll fixes
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEOXpuCuR6hedrdLCJadfx3eKKwl4FAmCfOAIACgkQadfx3eKK
 wl6mVg//ZeVQXng1Km/J3icPVX/Hl8AXLVEcvTNmlkaHbceRAt5G5iguTcoEpbtY
 8rprCcH+4dmhoeS3zqWX5mORiKKQxsIzmEIq/7xWlS2do8KuknwZC3yrkC8JZSGM
 Mh2ezNPV6gNXG61zD6/sRpM+AmM/AZFUZWiwVBxHcJhH3rnlguascQX5tB+ClDjH
 /a1uaczgWF0urpDa8j+njJHNKMy1NQ6hJfYooDx9ShIHfOjCHrf9C1JfKugpNaqF
 fI/GUThpxKXMZnWw2WggENoZ8CcdhV1oPJR1PoIrxFT+nVo/LS1LXjgJjVLQ/SyT
 O5eaZuXoJf0lJK+TS0sqdpOSb4zzfe+j+hsv0SVFqGj3cS7n0ld5/V2k3q1dSbdQ
 WQdYEgacMWkUSNikDnCj4FeYF8B9F4jd6HkZYkalPZJDl2kUAAxflqavWzG+ZBoi
 j8wHYqqMp9VN/51I/jMjUlakN5oeCEGk40MDm28Q5hWEEI/kPG8Wt8ocRS+u39w9
 W1cXAZ0r7Ike2vZuHufqO1yEcMa3LJu0kJm20V3r/6huUBRE46+n3kiSpz0ySrE1
 Tir73s+vSEXWsg+TsW9GfkISl32cSNu9QUUAK6Mvj/p8edb5BS4KL66tdVyaIejJ
 fFVElQrII19MTtUyjHxMKfkFgppilROL4enqUmFWay6IhO3OgyY=
 =b7JE
 -----END PGP SIGNATURE-----

Merge tag 'arc-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc

Pull ARC fixes from Vineet Gupta:

 - PAE fixes

 - syscall num check off-by-one bug

 - misc fixes

* tag 'arc-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
  ARC: mm: Use max_high_pfn as a HIGHMEM zone border
  ARC: mm: PAE: use 40-bit physical page mask
  ARC: entry: fix off-by-one error in syscall number validation
  ARC: kgdb: add 'fallthrough' to prevent a warning
  arc: Fix typos/spellos
2021-05-15 09:01:45 -07:00
Linus Torvalds
8f4ae0f68c block-5.13-2021-05-14
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEwPw5LcreJtl1+l5K99NY+ylx4KYFAmCexAAQHGF4Ym9lQGtl
 cm5lbC5kawAKCRD301j7KXHgpo3SEADXxkU29LW0GPLvtQqaHSWiHZRHL1BHeqcI
 tDRMx4Sch3wGJg6dKV9KoL1xRRTeKNpPFzVvQ0BLDrE+Brqu6S44AnWrYuRFvhAa
 uOXsvyUCYkcB2y1ylGxPfj35ccAyFCi204/px96nz7+2J/0ASI5qaPXcZ7yf1yR/
 HbN8oV3iM/pYohHlwFkEt785sMSqjDVNFA8gWWwCek+iF0Pp34J8ktesHEJubCJ+
 R8B5YEK5JSfQ7ROQFlCYn/dS/DrP5mD6+1Yyy1iDumPkHgkxIz8tJ+z6h8jlyfhE
 XqKPtSFVyE6LYyOk0m9j4lmNuNXWcIo1c5iiScMRvcvHyvVMMZoV0mjzSGI7HCsf
 RoYQt8Ypi27Iei2EXph1V+WmpdYDhG55649m8ubn2YfMJbbep2+ya5DYZpWO1Ir+
 Bof8idZkYFDZVSA6T9eBzMg/XwTvNI5WuwjCdD9tfO0s9R7OSVD0eZQNlLSJSjJA
 c7N+jQkod+2uhgMzqGLSDvRze/0BOaN25Xt+R7bbOEG+k/mBd8+xgPIemAPKmS93
 s6Ia87SRFdYpcJkxoIPJ6Tqky3QTcmSApTZ9ckYVUCxo8IGSsYV5gaoKX6G4O9nm
 eewhdiN7si65f1duDkjXEySQ2eBPqwWpA0/w/O1WUwPDJdIYhXU2d1zDdnVGh0nH
 NUcsJD1UDQ==
 =JpHn
 -----END PGP SIGNATURE-----

Merge tag 'block-5.13-2021-05-14' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:

 - Fix for shared tag set exit (Bart)

 - Correct ioctl range for zoned ioctls (Damien)

 - Removed dead/unused function (Lin)

 - Fix perf regression for shared tags (Ming)

 - Fix out-of-bounds issue with kyber and preemption (Omar)

 - BFQ merge fix (Paolo)

 - Two error handling fixes for nbd (Sun)

 - Fix weight update in blk-iocost (Tejun)

 - NVMe pull request (Christoph):
      - correct the check for using the inline bio in nvmet (Chaitanya
        Kulkarni)
      - demote unsupported command warnings (Chaitanya Kulkarni)
      - fix corruption due to double initializing ANA state (me, Hou Pu)
      - reset ns->file when open fails (Daniel Wagner)
      - fix a NULL deref when SEND is completed with error in nvmet-rdma
        (Michal Kalderon)

 - Fix kernel-doc warning (Bart)

* tag 'block-5.13-2021-05-14' of git://git.kernel.dk/linux-block:
  block/partitions/efi.c: Fix the efi_partition() kernel-doc header
  blk-mq: Swap two calls in blk_mq_exit_queue()
  blk-mq: plug request for shared sbitmap
  nvmet: use new ana_log_size instead the old one
  nvmet: seset ns->file when open fails
  nbd: share nbd_put and return by goto put_nbd
  nbd: Fix NULL pointer in flush_workqueue
  blkdev.h: remove unused codes blk_account_rq
  block, bfq: avoid circular stable merges
  blk-iocost: fix weight updates of inner active iocgs
  nvmet: demote fabrics cmd parse err msg to debug
  nvmet: use helper to remove the duplicate code
  nvmet: demote discovery cmd parse err msg to debug
  nvmet-rdma: Fix NULL deref when SEND is completed with error
  nvmet: fix inline bio check for passthru
  nvmet: fix inline bio check for bdev-ns
  nvme-multipath: fix double initialization of ANA state
  kyber: fix out of bounds access when preempted
  block: uapi: fix comment about block device ioctl
2021-05-15 08:52:30 -07:00
Linus Torvalds
5601591035 io_uring-5.13-2021-05-14
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEwPw5LcreJtl1+l5K99NY+ylx4KYFAmCew+oQHGF4Ym9lQGtl
 cm5lbC5kawAKCRD301j7KXHgpnAAD/0RGU6BTpYX0AjSuHtHPsGxAWlLroe7Yvew
 BBXX58uL9LqSYDe+FfCherA7GbyLdXrN9yvbeKVEZH7wmFV0u6dGX/RiK8lpWvfd
 pMTSf14QkASkoQ5bMQURdSv73OruzKQN7CisN3btwD2sDcqZqz7RsFuWf5Fuxs4r
 UjyQdJpt+sNs1UTvHBjqQcCrAipEVWePH93/jhayx8iBykab4+aNKFtysjqYJdD0
 LL5NG5LihP5G2WECD5Q7vDmb9+km3cN5TJLhHSDsmQg4Ln6U9zd4X3bnvEXNtlWk
 edNNhKVmS8rtwK2qiZCoVlR4HrSjCCjUg/0h6hyOL8AYNV9vPup/0EuWfRKxLE+3
 l3TRTO02/SM8Tjdu27lYtxFYnIkIgRv+w2/ZmURzwnPpIvjwbdfth5DN+10bFnUV
 IPKcEvMXhbgdyQ5OtA1oPk3udWesrk836s2W6kqBLSEeqFrb0UbI8A40VXxoAfVQ
 Ig5LmuuDAlZzt4fCu3GYhVZS1jj2CXuBsGrsbSVZaJGbMu9MPbmMUoz6XBS3lsY6
 gnhYv2paMuOo/hD6q4XeCH4j1jveLXgzenW3fzEP4E0wxfvMkybyWCwfW14a15Q+
 Sr8VEEUTc74RfW5pP0ZTvrYGnR+oJwB1RacdbU5WpOrB01A5bWkmb0fRNHfj8vjH
 h49oIdqZKw==
 =5+hs
 -----END PGP SIGNATURE-----

Merge tag 'io_uring-5.13-2021-05-14' of git://git.kernel.dk/linux-block

Pull io_uring fixes from Jens Axboe:
 "Just a few minor fixes/changes:

   - Fix issue with double free race for linked timeout completions

   - Fix reference issue with timeouts

   - Remove last few places that make SQPOLL special, since it's just an
     io thread now.

   - Bump maximum allowed registered buffers, as we don't allocate as
     much anymore"

* tag 'io_uring-5.13-2021-05-14' of git://git.kernel.dk/linux-block:
  io_uring: increase max number of reg buffers
  io_uring: further remove sqpoll limits on opcodes
  io_uring: fix ltout double free on completion race
  io_uring: fix link timeout refs
2021-05-15 08:43:44 -07:00
Linus Torvalds
41f035c062 Changes since last update:
- update documentation to fix the broken illustration due to ReST
    conversion by accident at that time and complete the big pcluster
    introduction;
 
  - fix 1 lcluster-sized pclusters for the big pcluster feature.
 -----BEGIN PGP SIGNATURE-----
 
 iIcEABYIAC8WIQThPAmQN9sSA0DVxtI5NzHcH7XmBAUCYJ8DGBEceGlhbmdAa2Vy
 bmVsLm9yZwAKCRA5NzHcH7XmBAC0AQDaap8fSTWMLroLLBCcr1MwTqoS6wf44tx8
 iq2FFcU/hQD+PqrnCFJW7wjWjMC84weOudRvh2/lu/GKH2a5LgJ5Xgs=
 =UTkq
 -----END PGP SIGNATURE-----

Merge tag 'erofs-for-5.13-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs

Pull erofs fixes from Gao Xiang:
 "This mainly fixes 1 lcluster-sized pclusters for the big pcluster
  feature, which can be forcely generated by mkfs as a specific on-disk
  case for per-(sub)file compression strategies but missed to handle in
  runtime properly.

  Also, documentation updates are included to fix the broken
  illustration due to the ReST conversion by accident and complete the
  big pcluster introduction.

  Summary:

   - update documentation to fix the broken illustration due to ReST
     conversion by accident at that time and complete the big pcluster
     introduction

   - fix 1 lcluster-sized pclusters for the big pcluster feature"

* tag 'erofs-for-5.13-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs:
  erofs: fix 1 lcluster-sized pcluster for big pcluster
  erofs: update documentation about data compression
  erofs: fix broken illustration in documentation
2021-05-15 08:37:21 -07:00
Linus Torvalds
a5ce4296b0 libnvdimm fixes for 5.13-rc2
- Fix regression in ACPI NFIT table handling leading to crashes and
   driver load failures.
 
 - Move the nvdimm mailing list
 
 - Miscellaneous minor fixups
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEf41QbsdZzFdA8EfZHtKRamZ9iAIFAmCfCWEACgkQHtKRamZ9
 iAIhjA/7BJcayM6TpBO+jSWgCbhgEMKw37DWVxI43aRRStt5xQYNcVhgZO3lQJ9D
 mUK1oQxWTlXOOzgp4SNM/WK5XCO2xj7DHWlsKvyrwPKusGnnjACYKXISAr+TL7QI
 j9dsu+kMWJrnr4H5aqLBmG1n7a6sJbqLqFbEU7DXb0ZdHh9O2+Lq5KoWyNwtNRLh
 ZzyGD1tuTpxfiUnvyyuKwMQCrmDqgoHA5uYvwiPm6fE8XhKiHGqNZ2sUnxAU/UU+
 A5R3EMkmMAzphzvpFJu16UAy4zDxXHH94dIwrtsYkO4JmJ9TYRlZjQkRxjqquE45
 vqtlGrvq333OfnINA9sm8i7nHI+USMqCThSkWdM2LkAHiZlyqk1CbyL7X4CIES+H
 3GPEVAozn5/mCpS6vDkHrZxFeMpdBhIM9tczu4ClQVjQKrKvJTrRMkNDa1WonEYz
 StBkUShMSGylpWxWN0CuNU3MN9LbP3ea+ihV0S/VRwQBIsLr5/1bZHBMoTnsWCpD
 9sMRE312gbsV5uUXV5BO4un0I8bDTbPpLafWAwwBL4MNE9V8cNYZyGoTr1atxeIr
 sXQAhfABugjiWcmoL9TPy2Q1ihF8crSZOZOr9OhiEcDGpLk4sSLmsKNgKWTNQ95V
 0eT+9/nJ6neaRxLblXepcym6w9lltPMoEkXncUcK/pWgQ/6tUfY=
 =UGmD
 -----END PGP SIGNATURE-----

Merge tag 'libnvdimm-fixes-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm

Pull libnvdimm fixes from Dan Williams:
 "A regression fix for a bootup crash condition introduced in this merge
  window and some other minor fixups:

   - Fix regression in ACPI NFIT table handling leading to crashes and
     driver load failures.

   - Move the nvdimm mailing list

   - Miscellaneous minor fixups"

* tag 'libnvdimm-fixes-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
  ACPI: NFIT: Fix support for variable 'SPA' structure size
  MAINTAINERS: Move nvdimm mailing list
  tools/testing/nvdimm: Make symbol '__nfit_test_ioremap' static
  libnvdimm: Remove duplicate struct declaration
2021-05-15 08:32:51 -07:00
Linus Torvalds
393f42f113 dax fixes for 5.13-rc2
- Fix a hang condition (missed wakeups with virtiofs when invalidating
   entries)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEf41QbsdZzFdA8EfZHtKRamZ9iAIFAmCfBboACgkQHtKRamZ9
 iAIiHQ/+LqD0USAXxWQFcDupTATVy0Z/hpUCBWcEKII/ljluUWLLkGUT2/Gy3TXE
 0HZmJBWyJyqNRyWtzNZ8hu4FpxSawtYVkqTv0/ODAjrpva9m8p4eVYFp0UpTHn3d
 KL/DD+VeLWs1yoPIXgqd2dSwV2YsAJSEYYXcF0CYeHOWH4BVGrOglQBL7kJyra6n
 IQsnXGJQMXkOoDMB/5xTI7LgYD0R09OevsHE6Eupxm9SI8ud2qUQlBLde8Eh+7qb
 pMhkeNNjG2w461C8215rhGPzCweMMasiBwUz1EHXDpXebZSsDfURwBWMCFbe/H7p
 x3u0s3hlJydTZmUnaMeWje+wR1Ku8YXiBeelMobpXi4RzNyebhZ0Fap3fMDbrR8/
 5mro6H9blEYGZ1kISHSdvZUfh6uzWiL8hs+uBb/ANICZouValjyVrHuTauwncyQP
 PHaKZYo/kh6Hj3j1LYDHbMs69Cbr+E0x/JFnYAxIkZSggYJeXN9+3K9hhUXcQNIf
 Lh4p1F/t7DmIXzljFu6qwJl9JmCC+yx4PcSgOqa6vPvm2H6KEH+rMCLHtu+WgaXq
 1Gj9EI1sshTXgot8Y1xlPCCTLNqxhV0O30L+EsasmjNCjWwVRi2zz+FjkgFAeDvo
 7LZUNVepC9YMffknBNGkfNibfVBn5/DxbGR/9SWygHy8ahECoLc=
 =cWwB
 -----END PGP SIGNATURE-----

Merge tag 'dax-fixes-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm

Pull dax fixes from Dan Williams:
 "A fix for a hang condition due to missed wakeups in the filesystem-dax
  core when exercised by virtiofs.

  This bug has been there from the beginning, but the condition has
  not triggered on other filesystems since they hold a lock over
  invalidation events"

* tag 'dax-fixes-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
  dax: Wake up all waiters after invalidating dax entry
  dax: Add a wakeup mode parameter to put_unlocked_entry()
  dax: Add an enum for specifying dax wakup mode
2021-05-15 08:28:08 -07:00
Linus Torvalds
33f85ca44e drm fixes for 5.13-rc2 (part two)
msm
 - dsi regression fix
 - dma-buf pinning fix
 - displayport fixes
 - llc fix
 
 i915:
 - Fix active callback alignment annotations and subsequent crashes
 - Retract link training strategy to slow and wide, again
 - Avoid division by zero on gen2
 - Use correct width reads for C0DRB3/C1DRB3 registers
 - Fix double free in pdp allocation failure path
 - Fix HDMI 2.1 PCON downstream caps check
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJgnuSsAAoJEAx081l5xIa+G6QQAI1RfmoxL2TrabYuVb0n1ek4
 5FGv8niKdbPDzJEA7XyMWLRTC92Q9kITdvGweJODF0dvCGBusppa4Xv97jCDIOSS
 Mxu2DDdIejXGmQbzLCN50SIhE7sMm+R1vtmbYJdk209I6dZyWPAlIN5YgIfavDp1
 aek7gUhcx6dp0uzOP/TeZqlDXGarDV8SzZHwUyUJkXno2FZRPoCa08ueo7beeyMY
 E6Sgjxl97mTBkFmfKxyiMTYNpJfENuM32HTDKGX9PD0XPpoNSgadrufk375h2xPr
 2Hnp8ahePKCiNTgdC8ELkMJwAEIc1ZFi0pac8w6kUj9GdeSZP4oqWml2wKj1AzdA
 FTCgfUoBGV6ZrVwMiLegGhDaHUBw4owuVo1k7IZjDcohWL+OHdbZpiWyzBcqVWb5
 vhp02/yso6XXok6suVjmAChie1bk5ipW3w1cqxtjDLkvY+4k8HX02l3BiGZD/BwW
 3pIZCPda84+DzYRFrWFffm8H74K2Rcmq8ENDzlhbDtPSrGaf428KX443oMy9daaH
 yYYk3raqLC483p7m3w357zFVTzJA8K9bYI6xZYCm/lfXvuQNBc5/NrRYkQpxVMru
 4o4/m6Hdr2YoWr3zJuHmDzN1M1mFvjJRzxXeu1ny6jtbKt4n9/0vV+ESa7geRLry
 E7pV9YJhxatjgPhyRF/E
 =LqER
 -----END PGP SIGNATURE-----

Merge tag 'drm-fixes-2021-05-15' of git://anongit.freedesktop.org/drm/drm

Pull more drm fixes from Dave Airlie:
 "Looks like I wasn't the only one not fully switched on this week. The
  msm pull has a missing tag so I missed it, and i915 team were a bit
  late. In my defence I did have a day with the roof of my home office
  removed, so was sitting at my kids desk.

  msm:
   - dsi regression fix
   - dma-buf pinning fix
   - displayport fixes
   - llc fix

  i915:
   - Fix active callback alignment annotations and subsequent crashes
   - Retract link training strategy to slow and wide, again
   - Avoid division by zero on gen2
   - Use correct width reads for C0DRB3/C1DRB3 registers
   - Fix double free in pdp allocation failure path
   - Fix HDMI 2.1 PCON downstream caps check"

* tag 'drm-fixes-2021-05-15' of git://anongit.freedesktop.org/drm/drm:
  drm/i915: Use correct downstream caps for check Src-Ctl mode for PCON
  drm/i915/overlay: Fix active retire callback alignment
  drm/i915: Fix crash in auto_retire
  drm/i915/gt: Fix a double free in gen8_preallocate_top_level_pdp
  drm/i915: Read C0DRB3/C1DRB3 as 16 bits again
  drm/i915: Avoid div-by-zero on gen2
  drm/i915/dp: Use slow and wide link training for everything
  drm/msm/dp: initialize audio_comp when audio starts
  drm/msm/dp: check sink_count before update is_connected status
  drm/msm: fix minor version to indicate MSM_PARAM_SUSPENDS support
  drm/msm/dsi: fix msm_dsi_phy_get_clk_provider return code
  drm/msm/dsi: dsi_phy_28nm_8960: fix uninitialized variable access
  drm/msm: fix LLC not being enabled for mmu500 targets
  drm/msm: Do not unpin/evict exported dma-buf's
2021-05-15 08:18:29 -07:00
Tetsuo Handa
ffb324e6f8 tty: vt: always invoke vc->vc_sw->con_resize callback
syzbot is reporting OOB write at vga16fb_imageblit() [1], for
resize_screen() from ioctl(VT_RESIZE) returns 0 without checking whether
requested rows/columns fit the amount of memory reserved for the graphical
screen if current mode is KD_GRAPHICS.

----------
  #include <sys/types.h>
  #include <sys/stat.h>
  #include <fcntl.h>
  #include <sys/ioctl.h>
  #include <linux/kd.h>
  #include <linux/vt.h>

  int main(int argc, char *argv[])
  {
        const int fd = open("/dev/char/4:1", O_RDWR);
        struct vt_sizes vt = { 0x4100, 2 };

        ioctl(fd, KDSETMODE, KD_GRAPHICS);
        ioctl(fd, VT_RESIZE, &vt);
        ioctl(fd, KDSETMODE, KD_TEXT);
        return 0;
  }
----------

Allow framebuffer drivers to return -EINVAL, by moving vc->vc_mode !=
KD_GRAPHICS check from resize_screen() to fbcon_resize().

Link: https://syzkaller.appspot.com/bug?extid=1f29e126cf461c4de3b3 [1]
Reported-by: syzbot <syzbot+1f29e126cf461c4de3b3@syzkaller.appspotmail.com>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Tested-by: syzbot <syzbot+1f29e126cf461c4de3b3@syzkaller.appspotmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-05-15 08:12:12 -07:00
Christophe Leroy
86d0c16427 mm/ioremap: fix iomap_max_page_shift
iomap_max_page_shift is expected to contain a page shift, so it can't be a
'bool', has to be an 'unsigned int'

And fix the default values: P4D_SHIFT is when huge iomap is allowed.

However, on some architectures (eg: powerpc book3s/64), P4D_SHIFT is not a
constant so it can't be used to initialise a static variable.  So,
initialise iomap_max_page_shift with a maximum shift supported by the
architecture, it is gated by P4D_SHIFT in vmap_try_huge_p4d() anyway.

Link: https://lkml.kernel.org/r/ad2d366015794a9f21320dcbdd0a8eb98979e9df.1620898113.git.christophe.leroy@csgroup.eu
Fixes: bbc180a5ad ("mm: HUGE_VMAP arch support cleanup")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-05-14 19:41:32 -07:00
Rasmus Villemoes
f4d3f25ace docs: admin-guide: update description for kernel.modprobe sysctl
When I added CONFIG_MODPROBE_PATH, I neglected to update Documentation/.
It's still true that this defaults to /sbin/modprobe, but now via a level
of indirection.  So document that the kernel might have been built with
something other than /sbin/modprobe as the initial value.

Link: https://lkml.kernel.org/r/20210420125324.1246826-1-linux@rasmusvillemoes.dk
Fixes: 17652f4240 ("modules: add CONFIG_MODPROBE_PATH")
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jessica Yu <jeyu@kernel.org>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-05-14 19:41:32 -07:00
Jouni Roivas
c3187cf322 hfsplus: prevent corruption in shrinking truncate
I believe there are some issues introduced by commit 31651c6071
("hfsplus: avoid deadlock on file truncation")

HFS+ has extent records which always contains 8 extents.  In case the
first extent record in catalog file gets full, new ones are allocated from
extents overflow file.

In case shrinking truncate happens to middle of an extent record which
locates in extents overflow file, the logic in hfsplus_file_truncate() was
changed so that call to hfs_brec_remove() is not guarded any more.

Right action would be just freeing the extents that exceed the new size
inside extent record by calling hfsplus_free_extents(), and then check if
the whole extent record should be removed.  However since the guard
(blk_cnt > start) is now after the call to hfs_brec_remove(), this has
unfortunate effect that the last matching extent record is removed
unconditionally.

To reproduce this issue, create a file which has at least 10 extents, and
then perform shrinking truncate into middle of the last extent record, so
that the number of remaining extents is not under or divisible by 8.  This
causes the last extent record (8 extents) to be removed totally instead of
truncating into middle of it.  Thus this causes corruption, and lost data.

Fix for this is simply checking if the new truncated end is below the
start of this extent record, making it safe to remove the full extent
record.  However call to hfs_brec_remove() can't be moved to it's previous
place since we're dropping ->tree_lock and it can cause a race condition
and the cached info being invalidated possibly corrupting the node data.

Another issue is related to this one.  When entering into the block
(blk_cnt > start) we are not holding the ->tree_lock.  We break out from
the loop not holding the lock, but hfs_find_exit() does unlock it.  Not
sure if it's possible for someone else to take the lock under our feet,
but it can cause hard to debug errors and premature unlocking.  Even if
there's no real risk of it, the locking should still always be kept in
balance.  Thus taking the lock now just before the check.

Link: https://lkml.kernel.org/r/20210429165139.3082828-1-jouni.roivas@tuxera.com
Fixes: 31651c6071 ("hfsplus: avoid deadlock on file truncation")
Signed-off-by: Jouni Roivas <jouni.roivas@tuxera.com>
Reviewed-by: Anton Altaparmakov <anton@tuxera.com>
Cc: Anatoly Trosinenko <anatoly.trosinenko@gmail.com>
Cc: Viacheslav Dubeyko <slava@dubeyko.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-05-14 19:41:32 -07:00
Matthew Wilcox (Oracle)
076171a677 mm/filemap: fix readahead return types
A readahead request will not allocate more memory than can be represented
by a size_t, even on systems that have HIGHMEM available.  Change the
length functions from returning an loff_t to a size_t.

Link: https://lkml.kernel.org/r/20210510201201.1558972-1-willy@infradead.org
Fixes: 32c0a6bcaa ("btrfs: add and use readahead_batch_length")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-05-14 19:41:32 -07:00
Peter Collingbourne
f649dc0e0d kasan: fix unit tests with CONFIG_UBSAN_LOCAL_BOUNDS enabled
These tests deliberately access these arrays out of bounds, which will
cause the dynamic local bounds checks inserted by
CONFIG_UBSAN_LOCAL_BOUNDS to fail and panic the kernel.  To avoid this
problem, access the arrays via volatile pointers, which will prevent the
compiler from being able to determine the array bounds.

These accesses use volatile pointers to char (char *volatile) rather than
the more conventional pointers to volatile char (volatile char *) because
we want to prevent the compiler from making inferences about the pointer
itself (i.e.  its array bounds), not the data that it refers to.

Link: https://lkml.kernel.org/r/20210507025915.1464056-1-pcc@google.com
Link: https://linux-review.googlesource.com/id/I90b1713fbfa1bf68ff895aef099ea77b98a7c3b9
Signed-off-by: Peter Collingbourne <pcc@google.com>
Tested-by: Alexander Potapenko <glider@google.com>
Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Peter Collingbourne <pcc@google.com>
Cc: George Popescu <georgepope@android.com>
Cc: Elena Petrova <lenaptr@google.com>
Cc: Evgenii Stepanov <eugenis@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-05-14 19:41:32 -07:00