Linux 4.14.243
Greg Kroah-Hartman
maintainerI'm announcing the release of the 4.14.243 kernel.
All users of the 4.14 kernel series must upgrade.
The updated 4.14.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.14.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
------------
Makefile | 2 - drivers/net/ethernet/qlogic/qed/qed_mcp.c | 23 ++++++++++++++----- drivers/net/usb/r8152.c | 3 +- drivers/spi/spi-mt65xx.c | 19 ++++----------- drivers/watchdog/iTCO_wdt.c | 12 ++-------- fs/btrfs/compression.c | 2 - include/linux/mfd/rt5033-private.h | 4 +-- net/bluetooth/hci_core.c | 16 ++++++------- net/core/skbuff.c | 5 +++- virt/kvm/kvm_main.c | 36 +++++++++++++++++++++++++----- 10 files changed, 73 insertions(+), 49 deletions(-)
Axel Lin (1):
regulator: rt5033: Fix n_voltages settings for BUCK and LDO
Goldwyn Rodrigues (1):
btrfs: mark compressed range uptodate only if all bio succeed
Greg Kroah-Hartman (3):
Revert "Bluetooth: Shutdown controller after workqueues are flushed or cancelled" Revert "watchdog: iTCO_wdt: Account for rebooting on second timeout" Linux 4.14.243
Guenter Roeck (1):
spi: mediatek: Fix fifo transfer
Jia He (1):
qed: fix possible unpaired spin_{un}lock_bh in _qed_mcp_cmd_and_union()
Nicholas Piggin (1):
KVM: do not allow mapping valid but non-reference-counted pages
Paolo Bonzini (1):
KVM: do not assume PTE is writable after follow_pfn
Pravin B Shelar (1):
net: Fix zero-copy head len calculation.
Sean Christopherson (1):
KVM: Use kvm_pfn_t for local PFN variable in hva_to_pfn_remapped()
Takashi Iwai (1):
r8152: Fix potential PM refcount imbalance
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 14 -SUBLEVEL = 242 +SUBLEVEL = 243 EXTRAVERSION = NAME = Petit Gorille
drivers/net/ethernet/qlogic/qed/qed_mcp.c +17 -6
@@ -497,14 +497,18 @@ _qed_mcp_cmd_and_union(struct qed_hwfn *p_hwfn,spin_lock_bh (&p_hwfn->mcp_info->cmd_lock); -if (!qed_mcp_has_pending_cmd (p_hwfn)) +if (!qed_mcp_has_pending_cmd (p_hwfn)) { +spin_unlock_bh (&p_hwfn->mcp_info->cmd_lock);break ; + } rc =qed_mcp_update_pending_cmd (p_hwfn, p_ptt); -if (!rc) +if (!rc) { +spin_unlock_bh (&p_hwfn->mcp_info->cmd_lock);break ; -else if (rc != -EAGAIN ) + }else if (rc != -EAGAIN ) { goto err; + }spin_unlock_bh (&p_hwfn->mcp_info->cmd_lock);
@@ -521,6 +525,8 @@ _qed_mcp_cmd_and_union(struct qed_hwfn *p_hwfn,return -EAGAIN ; } +spin_lock_bh (&p_hwfn->mcp_info->cmd_lock); +/* Send the mailbox command */ qed_mcp_reread_offsets (p_hwfn, p_ptt); seq_num = ++p_hwfn->mcp_info->drv_mb_seq;
@@ -547,14 +553,18 @@ _qed_mcp_cmd_and_union(struct qed_hwfn *p_hwfn,spin_lock_bh (&p_hwfn->mcp_info->cmd_lock); -if (p_cmd_elem->b_is_completed) +if (p_cmd_elem->b_is_completed) { +spin_unlock_bh (&p_hwfn->mcp_info->cmd_lock);break ; + } rc =qed_mcp_update_pending_cmd (p_hwfn, p_ptt); -if (!rc) +if (!rc) { +spin_unlock_bh (&p_hwfn->mcp_info->cmd_lock);break ; -else if (rc != -EAGAIN ) + }else if (rc != -EAGAIN ) { goto err; + }spin_unlock_bh (&p_hwfn->mcp_info->cmd_lock); }while (++cnt < max_retries);
@@ -575,6 +585,7 @@ _qed_mcp_cmd_and_union(struct qed_hwfn *p_hwfn,return -EAGAIN ; } +spin_lock_bh (&p_hwfn->mcp_info->cmd_lock);qed_mcp_cmd_del_elem (p_hwfn, p_cmd_elem);spin_unlock_bh (&p_hwfn->mcp_info->cmd_lock);
drivers/net/usb/r8152.c +2 -1
@@ -3953,9 +3953,10 @@ static int rtl8152_close(struct net_device *netdev) tp->rtl_ops.down (tp);mutex_unlock (&tp->control); + } +if (!res)usb_autopm_put_interface (tp->intf); - }free_all_mem (tp);
drivers/spi/spi-mt65xx.c +5 -14
@@ -391,24 +391,15 @@ static int mtk_spi_fifo_transfer(struct spi_master *master,mtk_spi_prepare_transfer (master, xfer);mtk_spi_setup_packet (master); - cnt = xfer->len /4 ; -if (xfer->tx_buf) +if (xfer->tx_buf) { + cnt = xfer->len /4 ;iowrite32_rep (mdata->base +SPI_TX_DATA_REG , xfer->tx_buf, cnt); - -if (xfer->rx_buf) -ioread32_rep (mdata->base +SPI_RX_DATA_REG , xfer->rx_buf, cnt); - - remainder = xfer->len %4 ; -if (remainder >0 ) { - reg_val =0 ; -if (xfer->tx_buf) { + remainder = xfer->len %4 ; +if (remainder >0 ) { + reg_val =0 ;memcpy (®_val, xfer->tx_buf + (cnt *4 ), remainder);writel (reg_val, mdata->base +SPI_TX_DATA_REG ); } -if (xfer->rx_buf) { - reg_val =readl (mdata->base +SPI_RX_DATA_REG ); -memcpy (xfer->rx_buf + (cnt *4 ), ®_val, remainder); - } }mtk_spi_enable_transfer (master);
drivers/watchdog/iTCO_wdt.c +3 -9
@@ -75,8 +75,6 @@#define TCOBASE (p) ((p)->tco_res->start)/* SMI Control and Enable Register */ #define SMI_EN (p) ((p)->smi_res->start) -#define TCO_EN (1 << 13) -#define GBL_SMI_EN (1 << 0)#define TCO_RLD (p) (TCOBASE(p) + 0x00)/* TCO Timer Reload/Curr. Value */ #define TCOv1_TMR (p) (TCOBASE(p) + 0x01)/* TCOv1 Timer Initial Value*/
@@ -332,12 +330,8 @@ static int iTCO_wdt_set_timeout(struct watchdog_device *wd_dev, unsigned int t) tmrval =seconds_to_ticks (p, t); -/* -* If TCO SMIs are off, the timer counts down twice before rebooting. -* Otherwise, the BIOS generally reboots when the SMI triggers. -*/ -if (p->smi_res && - (SMI_EN (p) & (TCO_EN |GBL_SMI_EN )) != (TCO_EN |GBL_SMI_EN )) +/* For TCO v1 the timer counts down twice before rebooting */ +if (p->iTCO_version ==1 ) tmrval /=2 ;/* from the specs: */
@@ -499,7 +493,7 @@ static int iTCO_wdt_probe(struct platform_device *pdev)* Disables TCO logic generating an SMI# */ val32 =inl (SMI_EN (p)); - val32 &= ~TCO_EN ;/* Turn off SMI clearing watchdog */ + val32 &=0xffffdfff ;/* Turn off SMI clearing watchdog */ outl (val32,SMI_EN (p)); }
fs/btrfs/compression.c +1 -1
@@ -286,7 +286,7 @@ static void end_compressed_bio_write(struct bio *bio) cb->start, cb->start + cb->len -1 ,NULL , - bio->bi_status ? 0 : 1); + !cb->errors); cb->compressed_pages[0 ]->mapping =NULL ;end_compressed_writeback (inode, cb);
include/linux/mfd/rt5033-private.h +2 -2
@@ -203,13 +203,13 @@ enum rt5033_reg {#define RT5033_REGULATOR_BUCK_VOLTAGE_MIN 1000000U#define RT5033_REGULATOR_BUCK_VOLTAGE_MAX 3000000U#define RT5033_REGULATOR_BUCK_VOLTAGE_STEP 100000U -#define RT5033_REGULATOR_BUCK_VOLTAGE_STEP_NUM 32 +#define RT5033_REGULATOR_BUCK_VOLTAGE_STEP_NUM 21/* RT5033 regulator LDO output voltage uV */ #define RT5033_REGULATOR_LDO_VOLTAGE_MIN 1200000U#define RT5033_REGULATOR_LDO_VOLTAGE_MAX 3000000U#define RT5033_REGULATOR_LDO_VOLTAGE_STEP 100000U -#define RT5033_REGULATOR_LDO_VOLTAGE_STEP_NUM 32 +#define RT5033_REGULATOR_LDO_VOLTAGE_STEP_NUM 19/* RT5033 regulator SAFE LDO output voltage uV */ #define RT5033_REGULATOR_SAFE_LDO_VOLTAGE 4900000U
net/bluetooth/hci_core.c +8 -8
@@ -1569,6 +1569,14 @@ int hci_dev_do_close(struct hci_dev *hdev)BT_DBG ("%s %p" , hdev->name, hdev); +if (!hci_dev_test_flag (hdev,HCI_UNREGISTER ) && + !hci_dev_test_flag (hdev,HCI_USER_CHANNEL ) && +test_bit (HCI_UP , &hdev->flags)) { +/* Execute vendor specific shutdown routine */ +if (hdev->shutdown) + hdev->shutdown (hdev); + } +cancel_delayed_work (&hdev->power_off);hci_request_cancel_all (hdev);
@@ -1636,14 +1644,6 @@ int hci_dev_do_close(struct hci_dev *hdev)clear_bit (HCI_INIT , &hdev->flags); } -if (!hci_dev_test_flag (hdev,HCI_UNREGISTER ) && - !hci_dev_test_flag (hdev,HCI_USER_CHANNEL ) && -test_bit (HCI_UP , &hdev->flags)) { -/* Execute vendor specific shutdown routine */ -if (hdev->shutdown) - hdev->shutdown (hdev); - } -/* flush cmd work */ flush_work (&hdev->cmd_work);
net/core/skbuff.c +4 -1
@@ -2702,8 +2702,11 @@ skb_zerocopy_headlen(const struct sk_buff *from)if (!from->head_frag ||skb_headlen (from) <L1_CACHE_BYTES || -skb_shinfo (from)->nr_frags >=MAX_SKB_FRAGS ) +skb_shinfo (from)->nr_frags >=MAX_SKB_FRAGS ) { hlen =skb_headlen (from); +if (!hlen) + hlen = from->len; + }if (skb_has_frag_list (from)) hlen = from->len;
virt/kvm/kvm_main.c +30 -6
@@ -1485,15 +1485,24 @@ static bool vma_is_valid(struct vm_area_struct *vma, bool write_fault)return true; } +static int kvm_try_get_pfn (kvm_pfn_t pfn) +{ +if (kvm_is_reserved_pfn (pfn)) +return 1 ; +return get_page_unless_zero (pfn_to_page (pfn)); +} +static int hva_to_pfn_remapped (struct vm_area_struct *vma,unsigned long addr,bool *async,bool write_fault,bool *writable,kvm_pfn_t *p_pfn) { -unsigned long pfn; +kvm_pfn_t pfn; +pte_t *ptep; +spinlock_t *ptl;int r; - r =follow_pfn (vma, addr, &pfn); + r =follow_pte_pmd (vma->vm_mm, addr,NULL ,NULL , &ptep,NULL , &ptl);if (r) {/* * get_user_pages fails for VM_IO and VM_PFNMAP vmas and does
@@ -1508,14 +1517,19 @@ static int hva_to_pfn_remapped(struct vm_area_struct *vma,if (r)return r; - r =follow_pfn (vma, addr, &pfn); + r =follow_pte_pmd (vma->vm_mm, addr,NULL ,NULL , &ptep,NULL , &ptl);if (r)return r; + } +if (write_fault && !pte_write (*ptep)) { + pfn =KVM_PFN_ERR_RO_FAULT ; + goto out; }if (writable) - *writable = true; + *writable =pte_write (*ptep); + pfn =pte_pfn (*ptep);/* * Get a reference here because callers of *hva_to_pfn* and
@@ -1527,11 +1541,21 @@ static int hva_to_pfn_remapped(struct vm_area_struct *vma,* Whoever called remap_pfn_range is also going to call e.g. * unmap_mapping_range before the underlying pages are freed, * causing a call to our MMU notifier. +* +* Certain IO or PFNMAP mappings can be backed with valid +* struct pages, but be allocated without refcounting e.g., +* tail pages of non-compound higher order allocations, which +* would then underflow the refcount when the caller does the +* required put_page. Don't allow those pages here. */ -kvm_get_pfn (pfn); +if (!kvm_try_get_pfn (pfn)) + r = -EFAULT ; +out: +pte_unmap_unlock (ptep, ptl); *p_pfn = pfn; -return 0 ; + +return r; }/*