Linux 5.4.277
Greg Kroah-Hartman
maintainerI'm announcing the release of the 5.4.277 kernel.
All users of the 5.4 kernel series must upgrade.
The updated 5.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.4.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Documentation/sphinx/kernel_include.py | 1 Makefile | 2 arch/arm64/boot/dts/qcom/msm8998.dtsi | 8 +- drivers/firmware/arm_scmi/reset.c | 6 + drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 3 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 22 ++++- drivers/net/ethernet/broadcom/genet/bcmgenet.h | 2 drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c | 12 ++- drivers/net/ethernet/broadcom/genet/bcmmii.c | 43 ++--------- drivers/pinctrl/core.c | 14 ++- drivers/tty/serial/kgdboc.c | 30 +++++++ drivers/usb/typec/ucsi/displayport.c | 4 - fs/btrfs/volumes.c | 1 fs/cifs/smb2ops.c | 4 - fs/cifs/smb2pdu.c | 81 +++++++++++++-------- fs/cifs/smb2proto.h | 10 +- fs/ext4/extents.c | 10 +- tools/testing/selftests/vm/map_hugetlb.c | 7 - 18 files changed, 161 insertions(+), 99 deletions(-)
Akira Yokosawa (1):
docs: kernel_include.py: Cope with docutils 0.21
Baokun Li (1):
ext4: fix bug_on in __es_tree_search
Cristian Marussi (1):
firmware: arm_scmi: Harden accesses to the reset domains
Daniel Thompson (1):
serial: kgdboc: Fix NMI-safety problems from keyboard reset code
Dominique Martinet (1):
btrfs: add missing mutex_unlock in btrfs_relocate_sys_chunks()
Doug Berger (5):
Revert "net: bcmgenet: use RGMII loopback for MAC reset"
net: bcmgenet: keep MAC in reset until PHY is up
net: bcmgenet: synchronize EXT_RGMII_OOB_CTRL access
net: bcmgenet: synchronize use of bcmgenet_set_rx_mode()
net: bcmgenet: synchronize UMAC_CMD access
Greg Kroah-Hartman (1):
Linux 5.4.277
Harshit Mogalapalli (1):
Revert "selftests: mm: fix map_hugetlb failure on 64K page size systems"
Heikki Krogerus (1):
usb: typec: ucsi: displayport: Fix potential deadlock
Paulo Alcantara (1):
smb: client: fix potential OOBs in smb2_parse_contexts()
Rob Herring (1):
arm64: dts: qcom: Fix 'interrupt-map' parent address cells
Sergey Shtylyov (1):
pinctrl: core: handle radix_tree_insert() errors in pinctrl_register_one_pin()
Srinivasan Shanmugam (1):
drm/amdgpu: Fix possible NULL dereference in amdgpu_ras_query_error_status_helper()
Greg Kroah-Hartman
maintainerDocumentation/sphinx/kernel_include.py +0 -1
@@ -94,7 +94,6 @@ class KernelInclude(Include): # HINT: this is the only line I had to change / commented out: #path = utils.relative_path(None, path) - path = nodes.reprunicode(path) encoding = self.options.get( 'encoding', self.state.document.settings.input_encoding) e_handler=self.state.document.settings.input_encoding_error_handler
Makefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 4 -SUBLEVEL = 276 +SUBLEVEL = 277 EXTRAVERSION = NAME = Kleptomaniac Octopus
arch/arm64/boot/dts/qcom/msm8998.dtsi +4 -4
@@ -872,10 +872,10 @@ interrupts = <GIC_SPI 405 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi"; interrupt-map-mask = <0 0 0 0x7>; - interrupt-map = <0 0 0 1 &intc 0 135 IRQ_TYPE_LEVEL_HIGH>, - <0 0 0 2 &intc 0 136 IRQ_TYPE_LEVEL_HIGH>, - <0 0 0 3 &intc 0 138 IRQ_TYPE_LEVEL_HIGH>, - <0 0 0 4 &intc 0 139 IRQ_TYPE_LEVEL_HIGH>; + interrupt-map = <0 0 0 1 &intc 0 0 135 IRQ_TYPE_LEVEL_HIGH>, + <0 0 0 2 &intc 0 0 136 IRQ_TYPE_LEVEL_HIGH>, + <0 0 0 3 &intc 0 0 138 IRQ_TYPE_LEVEL_HIGH>, + <0 0 0 4 &intc 0 0 139 IRQ_TYPE_LEVEL_HIGH>; clocks = <&gcc GCC_PCIE_0_PIPE_CLK>, <&gcc GCC_PCIE_0_MSTR_AXI_CLK>,
drivers/firmware/arm_scmi/reset.c +5 -1
@@ -135,8 +135,12 @@ static int scmi_domain_reset(const struct scmi_handle *handle, u32 domain,struct scmi_xfer *t;struct scmi_msg_reset_domain_reset *dom;struct scmi_reset_info *pi = handle->reset_priv; -struct reset_dom_info *rdom = pi->dom_info + domain; +struct reset_dom_info *rdom; +if (domain >= pi->num_domains) +return -EINVAL ; + + rdom = pi->dom_info + domain;if (rdom->async_reset) flags |=ASYNCHRONOUS_RESET ;
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +3 -0
@@ -594,6 +594,9 @@ int amdgpu_ras_error_query(struct amdgpu_device *adev,if (!obj)return -EINVAL ; +if (!info || info->head.block ==AMDGPU_RAS_BLOCK_COUNT ) +return -EINVAL ; +switch (info->head.block) {case AMDGPU_RAS_BLOCK__UMC :if (adev->umc.funcs->query_ras_error_count)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +17 -5
@@ -1990,12 +1990,18 @@ static void umac_enable_set(struct bcmgenet_priv *priv, u32 mask, bool enable) {u32 reg; +spin_lock_bh (&priv->reg_lock); reg =bcmgenet_umac_readl (priv,UMAC_CMD ); +if (reg &CMD_SW_RESET ) { +spin_unlock_bh (&priv->reg_lock); +return ; + }if (enable) reg |= mask;else reg &= ~mask;bcmgenet_umac_writel (priv, reg,UMAC_CMD ); +spin_unlock_bh (&priv->reg_lock);/* UniMAC stops on a packet boundary, wait for a full-size packet * to be processed
@@ -2010,11 +2016,11 @@ static void reset_umac(struct bcmgenet_priv *priv)bcmgenet_rbuf_ctrl_set (priv,0 );udelay (10 ); -/* disable MAC while updating its registers */ -bcmgenet_umac_writel (priv,0 ,UMAC_CMD ); - -/* issue soft reset with (rg)mii loopback to ensure a stable rxclk */ -bcmgenet_umac_writel (priv,CMD_SW_RESET |CMD_LCL_LOOP_EN ,UMAC_CMD ); +/* issue soft reset and disable MAC while updating its registers */ +spin_lock_bh (&priv->reg_lock); +bcmgenet_umac_writel (priv,CMD_SW_RESET ,UMAC_CMD ); +udelay (2 ); +spin_unlock_bh (&priv->reg_lock); }static void bcmgenet_intr_disable (struct bcmgenet_priv *priv)
@@ -2882,7 +2888,9 @@ static void bcmgenet_netif_start(struct net_device *dev)struct bcmgenet_priv *priv =netdev_priv (dev);/* Start the network engine */ +netif_addr_lock_bh (dev);bcmgenet_set_rx_mode (dev); +netif_addr_unlock_bh (dev);bcmgenet_enable_rx_napi (priv);umac_enable_set (priv,CMD_TX_EN |CMD_RX_EN , true);
@@ -3146,16 +3154,19 @@ static void bcmgenet_set_rx_mode(struct net_device *dev)* 3. The number of filters needed exceeds the number filters * supported by the hardware. */ +spin_lock (&priv->reg_lock); reg =bcmgenet_umac_readl (priv,UMAC_CMD );if ((dev->flags & (IFF_PROMISC |IFF_ALLMULTI )) || (nfilter >MAX_MDF_FILTER )) { reg |=CMD_PROMISC ;bcmgenet_umac_writel (priv, reg,UMAC_CMD ); +spin_unlock (&priv->reg_lock);bcmgenet_umac_writel (priv,0 ,UMAC_MDF_CTRL );return ; }else { reg &= ~CMD_PROMISC ;bcmgenet_umac_writel (priv, reg,UMAC_CMD ); +spin_unlock (&priv->reg_lock); }/* update MDF filter */
@@ -3513,6 +3524,7 @@ static int bcmgenet_probe(struct platform_device *pdev) goto err; } +spin_lock_init (&priv->reg_lock);spin_lock_init (&priv->lock);SET_NETDEV_DEV (dev, &pdev->dev);
drivers/net/ethernet/broadcom/genet/bcmgenet.h +2 -0
@@ -608,6 +608,8 @@ struct bcmgenet_rx_ring {/* device context */ struct bcmgenet_priv {void __iomem *base; +/* reg_lock: lock to serialize access to shared registers */ +spinlock_t reg_lock;enum bcmgenet_version version;struct net_device *dev;
drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c +11 -1
@@ -132,10 +132,16 @@ int bcmgenet_wol_power_down_cfg(struct bcmgenet_priv *priv,return -EINVAL ; } -/* disable RX */ +/* Can't suspend with WoL if MAC is still in reset */ +spin_lock_bh (&priv->reg_lock); reg =bcmgenet_umac_readl (priv,UMAC_CMD ); +if (reg &CMD_SW_RESET ) + reg &= ~CMD_SW_RESET ; + +/* disable RX */ reg &= ~CMD_RX_EN ;bcmgenet_umac_writel (priv, reg,UMAC_CMD ); +spin_unlock_bh (&priv->reg_lock);mdelay (10 ); reg =bcmgenet_umac_readl (priv,UMAC_MPD_CTRL );
@@ -159,6 +165,7 @@ int bcmgenet_wol_power_down_cfg(struct bcmgenet_priv *priv, retries);/* Enable CRC forward */ +spin_lock_bh (&priv->reg_lock); reg =bcmgenet_umac_readl (priv,UMAC_CMD ); priv->crc_fwd_en =1 ; reg |=CMD_CRC_FWD ;
@@ -166,6 +173,7 @@ int bcmgenet_wol_power_down_cfg(struct bcmgenet_priv *priv,/* Receiver must be enabled for WOL MP detection */ reg |=CMD_RX_EN ;bcmgenet_umac_writel (priv, reg,UMAC_CMD ); +spin_unlock_bh (&priv->reg_lock);return 0 ; }
@@ -187,8 +195,10 @@ void bcmgenet_wol_power_up_cfg(struct bcmgenet_priv *priv,bcmgenet_umac_writel (priv, reg,UMAC_MPD_CTRL );/* Disable CRC Forward */ +spin_lock_bh (&priv->reg_lock); reg =bcmgenet_umac_readl (priv,UMAC_CMD ); reg &= ~CMD_CRC_FWD ;bcmgenet_umac_writel (priv, reg,UMAC_CMD ); +spin_unlock_bh (&priv->reg_lock); priv->crc_fwd_en =0 ; }
drivers/net/ethernet/broadcom/genet/bcmmii.c +10 -33
81 lines not on this page · raw message
drivers/pinctrl/core.c +11 -3
@@ -203,6 +203,7 @@ static int pinctrl_register_one_pin(struct pinctrl_dev *pctldev, const struct pinctrl_pin_desc *pin) {struct pin_desc *pindesc; +int error; pindesc =pin_desc_get (pctldev, pin->number);if (pindesc) {
@@ -224,18 +225,25 @@ static int pinctrl_register_one_pin(struct pinctrl_dev *pctldev, }else { pindesc->name =kasprintf (GFP_KERNEL ,"PIN%u" , pin->number);if (!pindesc->name) { -kfree (pindesc); -return -ENOMEM ; + error = -ENOMEM ; + goto failed; } pindesc->dynamic_name = true; } pindesc->drv_data = pin->drv_data; -radix_tree_insert (&pctldev->pin_desc_tree, pin->number, pindesc); + error =radix_tree_insert (&pctldev->pin_desc_tree, pin->number, pindesc); +if (error) + goto failed; +pr_debug ("registered pin %d (%s) on %s\n" , pin->number, pindesc->name, pctldev->desc->name);return 0 ; + +failed: +kfree (pindesc); +return error; } static int pinctrl_register_pins(struct pinctrl_dev *pctldev,
drivers/tty/serial/kgdboc.c +29 -1
@@ -19,6 +19,7 @@#include <linux/console.h> #include <linux/vt_kern.h> #include <linux/input.h> +#include <linux/irq_work.h> #include <linux/module.h> #include <linux/platform_device.h>
@@ -42,6 +43,25 @@ static int kgdb_tty_line;static struct platform_device *kgdboc_pdev; +/* +* When we leave the debug trap handler we need to reset the keyboard status +* (since the original keyboard state gets partially clobbered by kdb use of +* the keyboard). +* +* The path to deliver the reset is somewhat circuitous. +* +* To deliver the reset we register an input handler, reset the keyboard and +* then deregister the input handler. However, to get this done right, we do +* have to carefully manage the calling context because we can only register +* input handlers from task context. +* +* In particular we need to trigger the action from the debug trap handler with +* all its NMI and/or NMI-like oddities. To solve this the kgdboc trap exit code +* (the "post_exception" callback) uses irq_work_queue(), which is NMI-safe, to +* schedule a callback from a hardirq context. From there we have to defer the +* work again, this time using schedule_work(), to get a callback using the +* system workqueue, which runs in task context. +*/ #ifdef CONFIG_KDB_KEYBOARD static int kgdboc_reset_connect(struct input_handler *handler, struct input_dev *dev,
@@ -93,10 +113,17 @@ static void kgdboc_restore_input_helper(struct work_struct *dummy) static DECLARE_WORK(kgdboc_restore_input_work, kgdboc_restore_input_helper); +static void kgdboc_queue_restore_input_helper (struct irq_work *unused) +{ +schedule_work (&kgdboc_restore_input_work); +} + +static DEFINE_IRQ_WORK(kgdboc_restore_input_irq_work, kgdboc_queue_restore_input_helper); +static void kgdboc_restore_input (void ) {if (likely (system_state ==SYSTEM_RUNNING )) -schedule_work (&kgdboc_restore_input_work); +irq_work_queue (&kgdboc_restore_input_irq_work); }static int kgdboc_register_kbd (char **cptr)
@@ -127,6 +154,7 @@ static void kgdboc_unregister_kbd(void) i--; } } +irq_work_sync (&kgdboc_restore_input_irq_work);flush_work (&kgdboc_restore_input_work); }#else /* ! CONFIG_KDB_KEYBOARD */
drivers/usb/typec/ucsi/displayport.c +0 -4
@@ -251,8 +251,6 @@ static void ucsi_displayport_work(struct work_struct *work) struct ucsi_dp *dp = container_of(work, struct ucsi_dp, work);int ret; -mutex_lock (&dp->con->lock); - ret =typec_altmode_vdm (dp->alt, dp->header, dp->vdo_data, dp->vdo_size);if (ret)
@@ -261,8 +259,6 @@ static void ucsi_displayport_work(struct work_struct *work) dp->vdo_data =NULL ; dp->vdo_size =0 ; dp->header =0 ; - -mutex_unlock (&dp->con->lock); }void ucsi_displayport_remove_partner (struct typec_altmode *alt)
fs/btrfs/volumes.c +1 -0
@@ -3277,6 +3277,7 @@ static int btrfs_relocate_sys_chunks(struct btrfs_fs_info *fs_info)* alignment and size). */ ret = -EUCLEAN ; +mutex_unlock (&fs_info->delete_unused_bgs_mutex); goto error; }
fs/cifs/smb2ops.c +3 -1
@@ -787,9 +787,11 @@ int open_shroot(unsigned int xid, struct cifs_tcon *tcon,/* BB TBD check to see if oplock level check can be removed below */ if (o_rsp->OplockLevel ==SMB2_OPLOCK_LEVEL_LEASE ) {kref_get (&tcon->crfid.refcount); -smb2_parse_contexts (server, o_rsp, + rc =smb2_parse_contexts (server, rsp_iov, &oparms.fid->epoch, oparms.fid->lease_key, &oplock,NULL ); +if (rc) + goto oshr_exit; }else goto oshr_exit;
fs/cifs/smb2pdu.c +53 -28
109 lines not on this page · raw message
fs/cifs/smb2proto.h +6 -4
@@ -238,10 +238,12 @@ extern int smb3_validate_negotiate(const unsigned int, struct cifs_tcon *);extern enum securityEnum smb2_select_sectype (struct TCP_Server_Info *,enum securityEnum ); -extern void smb2_parse_contexts (struct TCP_Server_Info *server, -struct smb2_create_rsp *rsp, -unsigned int *epoch,char *lease_key, -__u8 *oplock,struct smb2_file_all_info *buf); +int smb2_parse_contexts (struct TCP_Server_Info *server, +struct kvec *rsp_iov, +unsigned int *epoch, +char *lease_key,__u8 *oplock, +struct smb2_file_all_info *buf); +extern int smb3_encryption_required (const struct cifs_tcon *tcon);extern int smb2_validate_iov (unsigned int offset,unsigned int buffer_length,struct kvec *iov,unsigned int min_buf_size);
fs/ext4/extents.c +5 -5
@@ -409,7 +409,7 @@ static int ext4_valid_extent_entries(struct inode *inode, {unsigned short entries;ext4_lblk_t lblock =0 ; -ext4_lblk_t prev =0 ; +ext4_lblk_t cur =0 ;if (eh->eh_entries ==0 )return 1 ;
@@ -435,12 +435,12 @@ static int ext4_valid_extent_entries(struct inode *inode,/* Check for overlapping extents */ lblock =le32_to_cpu (ext->ee_block); -if ((lblock <= prev) && prev) { +if (lblock < cur) { pblock =ext4_ext_pblock (ext); es->s_last_error_block =cpu_to_le64 (pblock);return 0 ; } - prev = lblock +ext4_ext_get_actual_len (ext) -1 ; + cur = lblock +ext4_ext_get_actual_len (ext); ext++; entries--; }
@@ -460,13 +460,13 @@ static int ext4_valid_extent_entries(struct inode *inode,/* Check for overlapping index extents */ lblock =le32_to_cpu (ext_idx->ei_block); -if ((lblock <= prev) && prev) { +if (lblock < cur) { *pblk =ext4_idx_pblock (ext_idx);return 0 ; } ext_idx++; entries--; - prev = lblock; + cur = lblock +1 ; } }return 1 ;
tools/testing/selftests/vm/map_hugetlb.c +0 -7
@@ -15,7 +15,6 @@#include <unistd.h> #include <sys/mman.h> #include <fcntl.h> -#include "vm_util.h" #define LENGTH (256UL*1024*1024)#define PROTECTION (PROT_READ | PROT_WRITE)
@@ -71,16 +70,10 @@ int main(int argc, char **argv) {void *addr;int ret; -size_t hugepage_size;size_t length =LENGTH ;int flags =FLAGS ;int shift =0 ; - hugepage_size =default_huge_page_size (); -/* munmap with fail if the length is not page aligned */ -if (hugepage_size > length) - length = hugepage_size; -if (argc >1 ) length =atol (argv[1 ]) <<20 ;if (argc >2 ) {