Skip to contentSkip to conversation

5.5.8-stable review

PATCH In review Greg Kroah-Hartman 11 participants 201 messages Mar 3, 2020 – Mar 4, 2020 Page 2 of 2

Subsystems (5)
lore
Share & tools
lore
author maintainer
#96 lore raw

PATCH 94/176 drm/radeon: Inline drm_get_pci_dev

In reply to Greg Kroah-Hartman

From: Daniel Vetter <[email protected]>

commit eb12c957735b582607e5842a06d1f4c62e185c1d upstream.

It's the last user, and more importantly, it's the last non-legacy user of anything in drm_pci.c.

The only tricky bit is the agp initialization. But a close look shows that radeon does not use the drm_agp midlayer (the main use of that is drm_bufs for legacy drivers), and instead could use the agp subsystem directly (like nouveau does already). Hence we can just pull this in too.

A further step would be to entirely drop the use of drm_device->agp, but feels like too much churn just for this patch.

---
 drivers/gpu/drm/radeon/radeon_drv.c |   43 ++++++++++++++++++++++++++++++++++--
 drivers/gpu/drm/radeon/radeon_kms.c |    6 +++++
 2 files changed, 47 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/radeon_drv.c +41 -2
@@ -37,6 +37,7 @@
 #include <linux/vga_switcheroo.h>
 #include <linux/mmu_notifier.h>
 
+#include <drm/drm_agpsupport.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_drv.h>
 #include <drm/drm_fb_helper.h>
@@ -325,6 +326,7 @@ static int radeon_pci_probe(struct pci_d
 			    const struct pci_device_id *ent)
 {
 	unsigned long flags = 0;
+	struct drm_device *dev;
 	int ret;
 
 	if (!ent)
@@ -365,7 +367,44 @@ static int radeon_pci_probe(struct pci_d
 	if (ret)
 		return ret;
 
-	return drm_get_pci_dev(pdev, ent, &kms_driver);
+	dev = drm_dev_alloc(&kms_driver, &pdev->dev);
+	if (IS_ERR(dev))
+		return PTR_ERR(dev);
+
+	ret = pci_enable_device(pdev);
+	if (ret)
+		goto err_free;
+
+	dev->pdev = pdev;
+#ifdef __alpha__
+	dev->hose = pdev->sysdata;
+#endif
+
+	pci_set_drvdata(pdev, dev);
+
+	if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP))
+		dev->agp = drm_agp_init(dev);
+	if (dev->agp) {
+		dev->agp->agp_mtrr = arch_phys_wc_add(
+			dev->agp->agp_info.aper_base,
+			dev->agp->agp_info.aper_size *
+			1024 * 1024);
+	}
+
+	ret = drm_dev_register(dev, ent->driver_data);
+	if (ret)
+		goto err_agp;
+
+	return 0;
+
+err_agp:
+	if (dev->agp)
+		arch_phys_wc_del(dev->agp->agp_mtrr);
+	kfree(dev->agp);
+	pci_disable_device(pdev);
+err_free:
+	drm_dev_put(dev);
+	return ret;
 }
 
 static void
@@ -575,7 +614,7 @@ radeon_get_crtc_scanout_position(struct
 
 static struct drm_driver kms_driver = {
 	.driver_features =
-	    DRIVER_USE_AGP | DRIVER_GEM | DRIVER_RENDER,
+	    DRIVER_GEM | DRIVER_RENDER,
 	.load = radeon_driver_load_kms,
 	.open = radeon_driver_open_kms,
 	.postclose = radeon_driver_postclose_kms,
drivers/gpu/drm/radeon/radeon_kms.c +6 -0
@@ -31,6 +31,7 @@
 #include <linux/uaccess.h>
 #include <linux/vga_switcheroo.h>
 
+#include <drm/drm_agpsupport.h>
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_file.h>
 #include <drm/drm_ioctl.h>
@@ -77,6 +78,11 @@ void radeon_driver_unload_kms(struct drm
 	radeon_modeset_fini(rdev);
 	radeon_device_fini(rdev);
 
+	if (dev->agp)
+		arch_phys_wc_del(dev->agp->agp_mtrr);
+	kfree(dev->agp);
+	dev->agp = NULL;
+
 done_free:
 	kfree(rdev);
 	dev->dev_private = NULL;
author maintainer
#86 lore raw

PATCH 84/176 ext4: potential crash on allocation error in ext4_alloc_flex_bg_array()

In reply to Greg Kroah-Hartman

From: Dan Carpenter <[email protected]>

commit 37b0b6b8b99c0e1c1f11abbe7cf49b6d03795b3f upstream.

If sbi->s_flex_groups_allocated is zero and the first allocation fails then this code will crash. The problem is that "i--" will set "i" to -1 but when we compare "i >= sbi->s_flex_groups_allocated" then the -1 is type promoted to unsigned and becomes UINT_MAX. Since UINT_MAX is more than zero, the condition is true so we call kvfree(new_groups[-1]). The loop will carry on freeing invalid memory until it crashes.

Fixes 7c990728b99e ("ext4: fix potential race between s_flex_groups online resizing and access")
---
 fs/ext4/super.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
fs/ext4/super.c +3 -3
@@ -2346,7 +2346,7 @@ int ext4_alloc_flex_bg_array(struct supe
 {
 	struct ext4_sb_info *sbi = EXT4_SB(sb);
 	struct flex_groups **old_groups, **new_groups;
-	int size, i;
+	int size, i, j;
 
 	if (!sbi->s_log_groups_per_flex)
 		return 0;
@@ -2367,8 +2367,8 @@ int ext4_alloc_flex_bg_array(struct supe
 					 sizeof(struct flex_groups)),
 					 GFP_KERNEL);
 		if (!new_groups[i]) {
-			for (i--; i >= sbi->s_flex_groups_allocated; i--)
-				kvfree(new_groups[i]);
+			for (j = sbi->s_flex_groups_allocated; j < i; j++)
+				kvfree(new_groups[j]);
 			kvfree(new_groups);
 			ext4_msg(sb, KERN_ERR,
 				 "not enough memory for %d flex groups", size);
author maintainer
#46 lore raw

PATCH 46/176 RDMA/siw: Remove unwanted WARN_ON in siw_cm_llp_data_ready()

In reply to Greg Kroah-Hartman

From: Krishnamraju Eraparaju <[email protected]>

[ Upstream commit 663218a3e715fd9339d143a3e10088316b180f4f ]

Warnings like below can fill up the dmesg while disconnecting RDMA connections.
Hence, remove the unwanted WARN_ON.

  WARNING: CPU: 6 PID: 0 at drivers/infiniband/sw/siw/siw_cm.c:1229 siw_cm_llp_data_ready+0xc1/0xd0 [siw]
  RIP: 0010:siw_cm_llp_data_ready+0xc1/0xd0 [siw]
  Call Trace:
   <IRQ>
   tcp_data_queue+0x226/0xb40
   tcp_rcv_established+0x220/0x620
   tcp_v4_do_rcv+0x12a/0x1e0
   tcp_v4_rcv+0xb05/0xc00
   ip_local_deliver_finish+0x69/0x210
   ip_local_deliver+0x6b/0xe0
   ip_rcv+0x273/0x362
   __netif_receive_skb_core+0xb35/0xc30
   netif_receive_skb_internal+0x3d/0xb0
   napi_gro_frags+0x13b/0x200
   t4_ethrx_handler+0x433/0x7d0 [cxgb4]
   process_responses+0x318/0x580 [cxgb4]
   napi_rx_handler+0x14/0x100 [cxgb4]
   net_rx_action+0x149/0x3b0
   __do_softirq+0xe3/0x30a
   irq_exit+0x100/0x110
   do_IRQ+0x7f/0xe0
   common_interrupt+0xf/0xf
   </IRQ>
---
 drivers/infiniband/sw/siw/siw_cm.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/infiniband/sw/siw/siw_cm.c +2 -3
index 3bccfef40e7e1..ac86363ce1a24 100644
@@ -1225,10 +1225,9 @@ static void siw_cm_llp_data_ready(struct sock *sk)
 	read_lock(&sk->sk_callback_lock);
 
 	cep = sk_to_cep(sk);
-	if (!cep) {
-		WARN_ON(1);
+	if (!cep)
 		goto out;
-	}
+
 	siw_dbg_cep(cep, "state: %d\n", cep->state);
 
 	switch (cep->state) {
Signature · 1 line
2.20.1
author maintainer
#43 lore raw

PATCH 43/176 ceph: do not execute direct write in parallel if O_APPEND is specified

In reply to Greg Kroah-Hartman

From: Xiubo Li <[email protected]>

[ Upstream commit 8e4473bb50a1796c9c32b244e5dbc5ee24ead937 ]

In O_APPEND & O_DIRECT mode, the data from different writers will be possibly overlapping each other since they take the shared lock.

For example, both Writer1 and Writer2 are in O_APPEND and O_DIRECT mode:

          Writer1                         Writer2

     shared_lock()                   shared_lock()
     getattr(CAP_SIZE)               getattr(CAP_SIZE)
     iocb->ki_pos = EOF              iocb->ki_pos = EOF
     write(data1)
                                     write(data2)
     shared_unlock()                 shared_unlock()

The data2 will overlap the data1 from the same file offset, the old EOF.

Switch to exclusive lock instead when O_APPEND is specified.

---
 fs/ceph/file.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
fs/ceph/file.c +11 -6
index 11929d2bb594c..cd09e63d682b7 100644
@@ -1418,6 +1418,7 @@ static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from)
 	struct ceph_cap_flush *prealloc_cf;
 	ssize_t count, written = 0;
 	int err, want, got;
+	bool direct_lock = false;
 	loff_t pos;
 	loff_t limit = max(i_size_read(inode), fsc->max_file_size);
 
@@ -1428,8 +1429,11 @@ static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from)
 	if (!prealloc_cf)
 		return -ENOMEM;
 
+	if ((iocb->ki_flags & (IOCB_DIRECT | IOCB_APPEND)) == IOCB_DIRECT)
+		direct_lock = true;
+
 retry_snap:
-	if (iocb->ki_flags & IOCB_DIRECT)
+	if (direct_lock)
 		ceph_start_io_direct(inode);
 	else
 		ceph_start_io_write(inode);
@@ -1519,14 +1523,15 @@ static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from)
 
 		/* we might need to revert back to that point */
 		data = *from;
-		if (iocb->ki_flags & IOCB_DIRECT) {
+		if (iocb->ki_flags & IOCB_DIRECT)
 			written = ceph_direct_read_write(iocb, &data, snapc,
 							 &prealloc_cf);
-			ceph_end_io_direct(inode);
-		} else {
+		else
 			written = ceph_sync_write(iocb, &data, pos, snapc);
+		if (direct_lock)
+			ceph_end_io_direct(inode);
+		else
 			ceph_end_io_write(inode);
-		}
 		if (written > 0)
 			iov_iter_advance(from, written);
 		ceph_put_snap_context(snapc);
@@ -1577,7 +1582,7 @@ static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from)
 
 	goto out_unlocked;
 out:
-	if (iocb->ki_flags & IOCB_DIRECT)
+	if (direct_lock)
 		ceph_end_io_direct(inode);
 	else
 		ceph_end_io_write(inode);
Signature · 1 line
2.20.1
author maintainer
#69 lore raw

PATCH 69/176 ice: Use correct netif error function

In reply to Greg Kroah-Hartman

From: Ben Shelton <[email protected]>

[ Upstream commit 1d8bd9927234081db15a1d42a7f99505244e3703 ]

Use the correct netif_msg_[tx,rx]_error() function to determine whether to print the MDD event type.

---
 drivers/net/ethernet/intel/ice/ice_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_main.c +1 -1
index c9b35b202639d..7f71f06fa819c 100644
@@ -1235,7 +1235,7 @@ static void ice_handle_mdd_event(struct ice_pf *pf)
 		u16 queue = ((reg & GL_MDET_TX_TCLAN_QNUM_M) >>
 				GL_MDET_TX_TCLAN_QNUM_S);
 
-		if (netif_msg_rx_err(pf))
+		if (netif_msg_tx_err(pf))
 			dev_info(dev, "Malicious Driver Detection event %d on TX queue %d PF# %d VF# %d\n",
 				 event, queue, pf_num, vf_num);
 		wr32(hw, GL_MDET_TX_TCLAN, 0xffffffff);
Signature · 1 line
2.20.1
author maintainer
#41 lore raw

PATCH 41/176 perf/x86/cstate: Add Tremont support

In reply to Greg Kroah-Hartman

From: Kan Liang <[email protected]>

[ Upstream commit ecf71fbccb9ac5cb964eb7de59bb9da3755b7885 ]

Tremont is Intel's successor to Goldmont Plus. From the perspective of Intel cstate residency counters, there is nothing changed compared with Goldmont Plus and Goldmont.

Share glm_cstates with Goldmont Plus and Goldmont. Update the comments for Tremont.

---
 arch/x86/events/intel/cstate.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)
arch/x86/events/intel/cstate.c +13 -9
index e1daf4151e116..4814c964692cb 100644
@@ -40,17 +40,18 @@
  * Model specific counters:
  *	MSR_CORE_C1_RES: CORE C1 Residency Counter
  *			 perf code: 0x00
- *			 Available model: SLM,AMT,GLM,CNL
+ *			 Available model: SLM,AMT,GLM,CNL,TNT
  *			 Scope: Core (each processor core has a MSR)
  *	MSR_CORE_C3_RESIDENCY: CORE C3 Residency Counter
  *			       perf code: 0x01
  *			       Available model: NHM,WSM,SNB,IVB,HSW,BDW,SKL,GLM,
- *						CNL,KBL,CML
+ *						CNL,KBL,CML,TNT
  *			       Scope: Core
  *	MSR_CORE_C6_RESIDENCY: CORE C6 Residency Counter
  *			       perf code: 0x02
  *			       Available model: SLM,AMT,NHM,WSM,SNB,IVB,HSW,BDW,
- *						SKL,KNL,GLM,CNL,KBL,CML,ICL,TGL
+ *						SKL,KNL,GLM,CNL,KBL,CML,ICL,TGL,
+ *						TNT
  *			       Scope: Core
  *	MSR_CORE_C7_RESIDENCY: CORE C7 Residency Counter
  *			       perf code: 0x03
@@ -60,17 +61,18 @@
  *	MSR_PKG_C2_RESIDENCY:  Package C2 Residency Counter.
  *			       perf code: 0x00
  *			       Available model: SNB,IVB,HSW,BDW,SKL,KNL,GLM,CNL,
- *						KBL,CML,ICL,TGL
+ *						KBL,CML,ICL,TGL,TNT
  *			       Scope: Package (physical package)
  *	MSR_PKG_C3_RESIDENCY:  Package C3 Residency Counter.
  *			       perf code: 0x01
  *			       Available model: NHM,WSM,SNB,IVB,HSW,BDW,SKL,KNL,
- *						GLM,CNL,KBL,CML,ICL,TGL
+ *						GLM,CNL,KBL,CML,ICL,TGL,TNT
  *			       Scope: Package (physical package)
  *	MSR_PKG_C6_RESIDENCY:  Package C6 Residency Counter.
  *			       perf code: 0x02
- *			       Available model: SLM,AMT,NHM,WSM,SNB,IVB,HSW,BDW
- *						SKL,KNL,GLM,CNL,KBL,CML,ICL,TGL
+ *			       Available model: SLM,AMT,NHM,WSM,SNB,IVB,HSW,BDW,
+ *						SKL,KNL,GLM,CNL,KBL,CML,ICL,TGL,
+ *						TNT
  *			       Scope: Package (physical package)
  *	MSR_PKG_C7_RESIDENCY:  Package C7 Residency Counter.
  *			       perf code: 0x03
@@ -87,7 +89,8 @@
  *			       Scope: Package (physical package)
  *	MSR_PKG_C10_RESIDENCY: Package C10 Residency Counter.
  *			       perf code: 0x06
- *			       Available model: HSW ULT,KBL,GLM,CNL,CML,ICL,TGL
+ *			       Available model: HSW ULT,KBL,GLM,CNL,CML,ICL,TGL,
+ *						TNT
  *			       Scope: Package (physical package)
  *
  */
@@ -640,8 +643,9 @@ static const struct x86_cpu_id intel_cstates_match[] __initconst = {
 
 	X86_CSTATES_MODEL(INTEL_FAM6_ATOM_GOLDMONT,   glm_cstates),
 	X86_CSTATES_MODEL(INTEL_FAM6_ATOM_GOLDMONT_D, glm_cstates),
-
 	X86_CSTATES_MODEL(INTEL_FAM6_ATOM_GOLDMONT_PLUS, glm_cstates),
+	X86_CSTATES_MODEL(INTEL_FAM6_ATOM_TREMONT_D, glm_cstates),
+	X86_CSTATES_MODEL(INTEL_FAM6_ATOM_TREMONT, glm_cstates),
 
 	X86_CSTATES_MODEL(INTEL_FAM6_ICELAKE_L, icl_cstates),
 	X86_CSTATES_MODEL(INTEL_FAM6_ICELAKE,   icl_cstates),
Signature · 1 line
2.20.1
author maintainer
#63 lore raw

PATCH 63/176 net: ena: ena-com.c: prevent NULL pointer dereference

In reply to Greg Kroah-Hartman

From: Arthur Kiyanovski <[email protected]>

[ Upstream commit c207979f5ae10ed70aff1bb13f39f0736973de99 ]

comp_ctx can be NULL in a very rare case when an admin command is executed during the execution of ena_remove().

The bug scenario is as follows:

* ena_destroy_device() sets the comp_ctx to be NULL
* An admin command is executed before executing unregister_netdev(), this can still happen because our device can still receive callbacks from the netdev infrastructure such as ethtool commands.
* When attempting to access the comp_ctx, the bug occurs since it's set to NULL

Fix:
Added a check that comp_ctx is not NULL

Fixes 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
---
 drivers/net/ethernet/amazon/ena/ena_com.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/ethernet/amazon/ena/ena_com.c +5 -0
index 74743fd8a1e0a..304531332e70a 100644
@@ -200,6 +200,11 @@ static void comp_ctxt_release(struct ena_com_admin_queue *queue,
 static struct ena_comp_ctx *get_comp_ctxt(struct ena_com_admin_queue *queue,
 					  u16 command_id, bool capture)
 {
+	if (unlikely(!queue->comp_ctx)) {
+		pr_err("Completion context is NULL\n");
+		return NULL;
+	}
+
 	if (unlikely(command_id >= queue->q_depth)) {
 		pr_err("command id is larger than the queue size. cmd_id: %u queue size %d\n",
 		       command_id, queue->q_depth);
Signature · 1 line
2.20.1
author maintainer
#57 lore raw

PATCH 57/176 net: ena: rss: do not allocate key when not supported

In reply to Greg Kroah-Hartman

From: Sameeh Jubran <[email protected]>

[ Upstream commit 6a4f7dc82d1e3abd3feb0c60b5041056fcd9880c ]

Currently we allocate the key whether the device supports setting the key or not. This commit adds a check to the allocation function and handles the error accordingly.

Fixes 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
---
 drivers/net/ethernet/amazon/ena/ena_com.c | 24 ++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)
drivers/net/ethernet/amazon/ena/ena_com.c +21 -3
index d6b894b06fa30..6f758ece86f60 100644
@@ -1057,6 +1057,20 @@ static void ena_com_hash_key_fill_default_key(struct ena_com_dev *ena_dev)
 static int ena_com_hash_key_allocate(struct ena_com_dev *ena_dev)
 {
 	struct ena_rss *rss = &ena_dev->rss;
+	struct ena_admin_feature_rss_flow_hash_control *hash_key;
+	struct ena_admin_get_feat_resp get_resp;
+	int rc;
+
+	hash_key = (ena_dev->rss).hash_key;
+
+	rc = ena_com_get_feature_ex(ena_dev, &get_resp,
+				    ENA_ADMIN_RSS_HASH_FUNCTION,
+				    ena_dev->rss.hash_key_dma_addr,
+				    sizeof(ena_dev->rss.hash_key), 0);
+	if (unlikely(rc)) {
+		hash_key = NULL;
+		return -EOPNOTSUPP;
+	}
 
 	rss->hash_key =
 		dma_alloc_coherent(ena_dev->dmadev, sizeof(*rss->hash_key),
@@ -2640,11 +2654,15 @@ int ena_com_rss_init(struct ena_com_dev *ena_dev, u16 indr_tbl_log_size)
 	if (unlikely(rc))
 		goto err_indr_tbl;
 
+	/* The following function might return unsupported in case the
+	 * device doesn't support setting the key / hash function. We can safely
+	 * ignore this error and have indirection table support only.
+	 */
 	rc = ena_com_hash_key_allocate(ena_dev);
-	if (unlikely(rc))
+	if (unlikely(rc) && rc != -EOPNOTSUPP)
 		goto err_hash_key;
-
-	ena_com_hash_key_fill_default_key(ena_dev);
+	else if (rc != -EOPNOTSUPP)
+		ena_com_hash_key_fill_default_key(ena_dev);
 
 	rc = ena_com_hash_ctrl_init(ena_dev);
 	if (unlikely(rc))
Signature · 1 line
2.20.1
author maintainer
#56 lore raw

PATCH 56/176 net: ena: fix incorrect default RSS key

In reply to Greg Kroah-Hartman

From: Arthur Kiyanovski <[email protected]>

[ Upstream commit 0d1c3de7b8c78a5e44b74b62ede4a63629f5d811 ]

Bug description:
When running "ethtool -x <if_name>" the key shows up as all zeros.

When we use "ethtool -X <if_name> hfunc toeplitz hkey <some:random:key>" to set the key and then try to retrieve it using "ethtool -x <if_name>" then we return the correct key because we return the one we saved.

Bug cause:
We don't fetch the key from the device but instead return the key that we have saved internally which is by default set to zero upon allocation.

Fix:
This commit fixes the issue by initializing the key to a random value using netdev_rss_key_fill().

Fixes 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
---
 drivers/net/ethernet/amazon/ena/ena_com.c | 15 +++++++++++++++
 drivers/net/ethernet/amazon/ena/ena_com.h |  1 +
 2 files changed, 16 insertions(+)
drivers/net/ethernet/amazon/ena/ena_com.c +15 -0
index e54c44fdcaa73..d6b894b06fa30 100644
@@ -1041,6 +1041,19 @@ static int ena_com_get_feature(struct ena_com_dev *ena_dev,
 				      feature_ver);
 }
 
+static void ena_com_hash_key_fill_default_key(struct ena_com_dev *ena_dev)
+{
+	struct ena_admin_feature_rss_flow_hash_control *hash_key =
+		(ena_dev->rss).hash_key;
+
+	netdev_rss_key_fill(&hash_key->key, sizeof(hash_key->key));
+	/* The key is stored in the device in u32 array
+	 * as well as the API requires the key to be passed in this
+	 * format. Thus the size of our array should be divided by 4
+	 */
+	hash_key->keys_num = sizeof(hash_key->key) / sizeof(u32);
+}
+
 static int ena_com_hash_key_allocate(struct ena_com_dev *ena_dev)
 {
 	struct ena_rss *rss = &ena_dev->rss;
@@ -2631,6 +2644,8 @@ int ena_com_rss_init(struct ena_com_dev *ena_dev, u16 indr_tbl_log_size)
 	if (unlikely(rc))
 		goto err_hash_key;
 
+	ena_com_hash_key_fill_default_key(ena_dev);
+
 	rc = ena_com_hash_ctrl_init(ena_dev);
 	if (unlikely(rc))
 		goto err_hash_ctrl;
drivers/net/ethernet/amazon/ena/ena_com.h +1 -0
index 0ce37d54ed108..9b5bd28ed0ac6 100644
@@ -44,6 +44,7 @@
 #include <linux/spinlock.h>
 #include <linux/types.h>
 #include <linux/wait.h>
+#include <linux/netdevice.h>
 
 #include "ena_common_defs.h"
 #include "ena_admin_defs.h"
Signature · 1 line
2.20.1
author maintainer
#39 lore raw

PATCH 39/176 arm/ftrace: Fix BE text poking

In reply to Greg Kroah-Hartman

From: Peter Zijlstra <[email protected]>

[ Upstream commit be993e44badc448add6a18d6f12b20615692c4c3 ]

The __patch_text() function already applies __opcode_to_mem_*(), so when __opcode_to_mem_*() is not the identity (BE*), it is applied twice, wrecking the instruction.

---
 arch/arm/kernel/ftrace.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
arch/arm/kernel/ftrace.c +2 -5
index bda949fd84e8b..93caf757f1d5d 100644
@@ -81,13 +81,10 @@ static int ftrace_modify_code(unsigned long pc, unsigned long old,
 {
 	unsigned long replaced;
 
-	if (IS_ENABLED(CONFIG_THUMB2_KERNEL)) {
+	if (IS_ENABLED(CONFIG_THUMB2_KERNEL))
 		old = __opcode_to_mem_thumb32(old);
-		new = __opcode_to_mem_thumb32(new);
-	} else {
+	else
 		old = __opcode_to_mem_arm(old);
-		new = __opcode_to_mem_arm(new);
-	}
 
 	if (validate) {
 		if (probe_kernel_read(&replaced, (void *)pc, MCOUNT_INSN_SIZE))
Signature · 1 line
2.20.1

Greg Kroah-Hartman

author maintainer
#0 lore raw

cover 5.5.8-stable review

This is the start of the stable review cycle for the 5.5.8 release. There are 176 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Thu, 05 Mar 2020 17:42:06 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

	https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.5.8-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.5.y
and the diffstat can be found below.

thanks,

greg k-h

-------------
Pseudo-Shortlog of commits:

Greg Kroah-Hartman <[email protected]>

    Linux 5.5.8-rc1

Jim Mattson <[email protected]>
kvm: nVMX: VMWRITE checks unsupported field before read-only field

Jim Mattson <[email protected]>
kvm: nVMX: VMWRITE checks VMCS-link pointer before VMCS field

David Rientjes <[email protected]>
mm, thp: fix defrag setting if newline is not used

Wei Yang <[email protected]>
mm/huge_memory.c: use head to check huge zero page

John Hubbard <[email protected]>
mm/gup: allow FOLL_FORCE for get_user_pages_fast()

Vlastimil Babka <[email protected]>
mm/debug.c: always print flags in dump_page()

Waiman Long <[email protected]>
locking/lockdep: Fix lockdep_stats indentation problem

Daniel Jordan <[email protected]>

    padata: always acquire cpu_hotplug_lock before pinst->lock

Christoph Hellwig <[email protected]>
xfs: clear kernel only flags in XFS_IOC_ATTRMULTI_BY_HANDLE

Bjorn Andersson <[email protected]>
clk: qcom: rpmh: Sort OF match table

Sameer Pujar <[email protected]>
bus: tegra-aconnect: Remove PM_CLK dependency

Matteo Croce <[email protected]>
netfilter: nf_flowtable: fix documentation

Xin Long <[email protected]>
netfilter: nft_tunnel: no need to call htons() when dumping ports

Florian Fainelli <[email protected]>
thermal: brcmstb_thermal: Do not use DT coefficients

Linus Walleij <[email protected]>
thermal: db8500: Depromote debug print

Geert Uytterhoeven <[email protected]>
ubifs: Fix ino_t format warnings in orphan_delete()

Neeraj Upadhyay <[email protected]>
rcu: Allow only one expedited GP to run concurrently with wakeups

Sean Christopherson <[email protected]>
KVM: x86: Remove spurious clearing of async #PF MSR

Sean Christopherson <[email protected]>
KVM: x86: Remove spurious kvm_mmu_unload() from vcpu destruction path

Peter Xu <[email protected]>
KVM: X86: Fix kvm_bitmap_or_dest_vcpus() to use irq shorthand

Xiaochen Shen <[email protected]>
x86/resctrl: Check monitoring static key in the MBM overflow handler

Cengiz Can <[email protected]>
perf maps: Add missing unlock to maps__insert() error case

Jiri Olsa <[email protected]>
perf ui gtk: Add missing zalloc object

Arnaldo Carvalho de Melo <[email protected]>
perf hists browser: Restore ESC as "Zoom out" of DSO/thread/etc

Uwe Kleine-König <[email protected]>
pwm: omap-dmtimer: put_device() after of_find_device_by_node()

Thomas Gleixner <[email protected]>
lib/vdso: Update coarse timekeeper unconditionally

Thomas Gleixner <[email protected]>
lib/vdso: Make __arch_update_vdso_data() logic understandable

Masami Hiramatsu <[email protected]>
kprobes: Set unoptimized flag after unoptimizing code

Janne Karhunen <[email protected]>
ima: ima/lsm policy rule loading logic bug fixes

Christophe JAILLET <[email protected]>
drivers: net: xgene: Fix the order of the arguments of 'alloc_etherdev_mqs()'

Lijun Ou <[email protected]>
RDMA/hns: Bugfix for posting a wqe with sge

Yixian Liu <[email protected]>
RDMA/hns: Simplify the calculation and usage of wqe idx for post verbs

Chao Yu <[email protected]>
f2fs: fix to add swap extent correctly

Cheng Jian <[email protected]>
sched/fair: Optimize select_idle_cpu

Sean Christopherson <[email protected]>
KVM: Check for a bad hva before dropping into the ghc slow path

Tom Lendacky <[email protected]>
KVM: SVM: Override default MMIO mask if memory encryption is enabled

Jin Yao <[email protected]>
perf report: Fix no libunwind compiled warning break s390 issue

Brian Norris <[email protected]>
mwifiex: delete unused mwifiex_get_intf_num()

Brian Norris <[email protected]>
mwifiex: drop most magic numbers from mwifiex_process_tdls_action_frame()

Aleksa Sarai <[email protected]>
namei: only return -ECHILD from follow_dotdot_rcu()

Tuong Lien <[email protected]>
tipc: fix successful connect() but timed out

Arthur Kiyanovski <[email protected]>
net: ena: make ena rxfh support ETH_RSS_HASH_NO_CHANGE

Ursula Braun <[email protected]>
net/smc: no peer ID in CLC decline for SMCD

Michael Ellerman <[email protected]>
selftests: Install settings files to fix TIMEOUT failures

Dmitry Bogdanov <[email protected]>
net: atlantic: fix out of range usage of active_vlans array

Pavel Belous <[email protected]>
net: atlantic: possible fault in transition to hibernation

Pavel Belous <[email protected]>
net: atlantic: fix potential error handling

Pavel Belous <[email protected]>
net: atlantic: fix use after free kasan warn

Nikita Danilov <[email protected]>
net: atlantic: better loopback mode handling

Dmitry Bezrukov <[email protected]>
net: atlantic: checksum compat issue

Nikolay Aleksandrov <[email protected]>
net: netlink: cap max groups which will be considered in netlink_bind()

Julian Wiedmann <[email protected]>
s390/qeth: fix off-by-one in RX copybreak check

Alexandra Winter <[email protected]>
s390/qeth: vnicc Fix EOPNOTSUPP precedence

Bijan Mottahedeh <[email protected]>
nvme-pci: Hold cq_poll_lock while completing CQEs

Peter Chen <[email protected]>
usb: charger: assign specific number for enum value

Haiyang Zhang <[email protected]>
hv_netvsc: Fix unwanted wakeup in netvsc_attach()

Masahiro Yamada <[email protected]>
kbuild: fix DT binding schema rule to detect command line changes

Andrei Otcheretianski <[email protected]>
mac80211: Remove a redundant mutex unlock

Johannes Berg <[email protected]>
nl80211: fix potential leak in AP start

Tina Zhang <[email protected]>
drm/i915/gvt: Separate display reset from ALL_ENGINES reset

Chris Wilson <[email protected]>
drm/i915: Avoid recursing onto active vma from the shrinker

Tina Zhang <[email protected]>
drm/i915/gvt: Fix orphan vgpu dmabuf_objs' lifetime

Mark Tomlinson <[email protected]>
MIPS: cavium_octeon: Fix syncw generation.

Wolfram Sang <[email protected]>
i2c: jz4780: silence log flood on txabrt

Gustavo A. R. Silva <[email protected]>
i2c: altera: Fix potential integer overflow

Oliver Upton <[email protected]>
KVM: nVMX: Emulate MTF when performing instruction emulation

Christophe JAILLET <[email protected]>
MIPS: VPE: Fix a double free and a memory leak in 'release_vpe()'

Anup Patel <[email protected]>
RISC-V: Don't enable all interrupts in trap_init()

[email protected] <[email protected]>
HID: hiddev: Fix race in in hiddev_disconnect()

Christophe JAILLET <[email protected]>
HID: alps: Fix an error handling path in 'alps_input_configured()'

Cong Wang <[email protected]>
netfilter: xt_hashlimit: reduce hashlimit_mutex scope for htable_put()

Jozsef Kadlecsik <[email protected]>
netfilter: ipset: Fix forceadd evaluation path

Eugenio Pérez <[email protected]>
vhost: Check docket sk_family instead of call getname

Ursula Braun <[email protected]>
net/smc: transfer fasync_list in case of fallback

Jozsef Kadlecsik <[email protected]>
netfilter: ipset: Fix "INFO: rcu detected stall in hash_xxx" reports

Jens Axboe <[email protected]>
io_uring: fix 32-bit compatability with sendmsg/recvmsg

Rafael J. Wysocki <[email protected]>
cpufreq: Fix policy initialization for internal governor drivers

Shirish S <[email protected]>
amdgpu/gmc_v9: save/restore sdpif regs during S3

Orson Zhai <[email protected]>
Revert "PM / devfreq: Modify the device name as devfreq(X) for sysfs"

Steven Rostedt (VMware) <[email protected]>
tracing: Disable trace_printk() on post poned tests

Jan Kara <[email protected]>

    blktrace: Protect q->blk_trace with RCU

Wolfram Sang <[email protected]>
macintosh: therm_windtunnel: fix regression when instantiating devices

Daniel Vetter <[email protected]>
drm/radeon: Inline drm_get_pci_dev

Daniel Vetter <[email protected]>
drm/amdgpu: Drop DRIVER_USE_AGP

Johan Korsnes <[email protected]>
HID: core: increase HID report buffer size to 8KiB

Johan Korsnes <[email protected]>
HID: core: fix off-by-one memset in hid_report_raw_event()

Hans de Goede <[email protected]>
HID: ite: Only bind to keyboard USB interface on Acer SW5-012 keyboard dock

Oliver Upton <[email protected]>
KVM: VMX: check descriptor table exits on instruction emulation

Mika Westerberg <[email protected]>

    ACPI: watchdog: Fix gas->access_width usage

Mika Westerberg <[email protected]>
ACPICA: Introduce ACPI_ACCESS_BYTE_WIDTH() macro

Paul Moore <[email protected]>
audit: always check the netlink payload length in audit_receive_msg()

Paul Moore <[email protected]>
audit: fix error handling in audit_data_to_entry()

Dan Carpenter <[email protected]>
ext4: potential crash on allocation error in ext4_alloc_flex_bg_array()

Kees Cook <[email protected]>
docs: Fix empty parallelism argument

Benjamin Block <[email protected]>
scsi: zfcp: fix wrong data and display format of SFP+ temperature

Damien Le Moal <[email protected]>
scsi: sd_sbc: Fix sd_zbc_report_zones()

Keith Busch <[email protected]>
nvme/pci: move cqe check after device shutdown

Nigel Kirkland <[email protected]>
nvme: prevent warning triggered by nvme_stop_keep_alive

Anton Eidelman <[email protected]>
nvme/tcp: fix bug on double requeue when send fails

Guangbin Huang <[email protected]>
net: hns3: fix a copying IPv6 address error in hclge_fd_get_flow_tuples()

Yonglong Liu <[email protected]>
net: hns3: fix VF bandwidth does not take effect in some case

Yufeng Mo <[email protected]>
net: hns3: add management table after IMP reset

Shay Bar <[email protected]>

    mac80211: fix wrong 160/80+80 MHz setting

Sergey Matyukevich <[email protected]>
cfg80211: add missing policy for NL80211_ATTR_STATUS_CODE

Coly Li <[email protected]>
bcache: ignore pending signals when creating gc and allocator thread

Frank Sorenson <[email protected]>
cifs: Fix mode output in debugging statements

Jens Axboe <[email protected]>
io-wq: don't call kXalloc_node() with non-online node

Ben Shelton <[email protected]>
ice: Use correct netif error function

Anirudh Venkataramanan <[email protected]>
ice: Use ice_pf_to_dev

Bruce Allan <[email protected]>
ice: update Unit Load Status bitmask to check after reset

Bruce Allan <[email protected]>
ice: fix and consolidate logging of NVM/firmware version information

Brett Creeley <[email protected]>
ice: Don't allow same value for Rx tail to be written twice

Dave Ertman <[email protected]>
ice: Fix switch between FW and SW LLDP

Arthur Kiyanovski <[email protected]>
net: ena: ena-com.c: prevent NULL pointer dereference

Sameeh Jubran <[email protected]>
net: ena: ethtool: use correct value for crc32 hash

Arthur Kiyanovski <[email protected]>
net: ena: fix corruption of dev_idx_to_host_tbl

Arthur Kiyanovski <[email protected]>
net: ena: fix incorrectly saving queue numbers when setting RSS indirection table

Arthur Kiyanovski <[email protected]>
net: ena: rss: store hash function as values and not bits

Sameeh Jubran <[email protected]>
net: ena: rss: fix failure to get indirection table

Sameeh Jubran <[email protected]>
net: ena: rss: do not allocate key when not supported

Arthur Kiyanovski <[email protected]>
net: ena: fix incorrect default RSS key

Arthur Kiyanovski <[email protected]>
net: ena: add missing ethtool TX timestamping indication

Arthur Kiyanovski <[email protected]>
net: ena: fix uses of round_jiffies()

Arthur Kiyanovski <[email protected]>
net: ena: fix potential crash when rxfh key is NULL

Brett Creeley <[email protected]>
i40e: Fix the conditional for i40e_vc_validate_vqs_bitmaps

Thierry Reding <[email protected]>
soc/tegra: fuse: Fix build with Tegra194 configuration

Daniel Kolesa <[email protected]>
amdgpu: Prevent build errors regarding soft/hard-float FP ABI tags

Isabel Zhang <[email protected]>
drm/amd/display: Add initialitions for PLL2 clock source

Yongqiang Sun <[email protected]>
drm/amd/display: Limit minimum DPPCLK to 100MHz.

Aric Cyr <[email protected]>
drm/amd/display: Check engine is not NULL before acquiring

Krishnamraju Eraparaju <[email protected]>
RDMA/siw: Remove unwanted WARN_ON in siw_cm_llp_data_ready()

Sung Lee <[email protected]>
drm/amd/display: Do not set optimized_require to false after plane disable

Kuninori Morimoto <[email protected]>
ARM: dts: sti: fixup sound frame-inversion for stihxxx-b2120.dtsi

Xiubo Li <[email protected]>
ceph: do not execute direct write in parallel if O_APPEND is specified

Kan Liang <[email protected]>
perf/x86/msr: Add Tremont support

Kan Liang <[email protected]>
perf/x86/cstate: Add Tremont support

Kan Liang <[email protected]>
perf/x86/intel: Add Elkhart Lake support

Peter Zijlstra <[email protected]>
arm/ftrace: Fix BE text poking

John Garry <[email protected]>
perf/smmuv3: Use platform_get_irq_optional() for wired interrupt

Trond Myklebust <[email protected]>
NFSv4: Fix races between open and dentry revalidation

Bjørn Mork <[email protected]>
qmi_wwan: unconditionally reject 2 ep interfaces

Bjørn Mork <[email protected]>
qmi_wwan: re-add DW5821e pre-production variant

Harald Freudenberger <[email protected]>
s390/zcrypt: fix card and queue total counter wrap

Stefano Garzarella <[email protected]>
io_uring: flush overflowed CQ events in the io_uring_poll()

Sergey Matyukevich <[email protected]>
cfg80211: check wiphy driver existence for drvinfo report

Johannes Berg <[email protected]>
mac80211: consider more elements in parsing CRC

Jeff Moyer <[email protected]>
dax: pass NOWAIT flag to iomap_apply

Vincent Guittot <[email protected]>
sched/fair: Prevent unlimited runtime on throttled group

Peter Zijlstra (Intel) <[email protected]>
timers/nohz: Update NOHZ load in remote tick

Scott Wood <[email protected]>
sched/core: Don't skip remote tick for idle CPUs

Sean Paul <[email protected]>
drm/msm: Set dma maximum segment size for mdss

Corey Minyard <[email protected]>
ipmi:ssif: Handle a possible NULL pointer reference

Eric Dumazet <[email protected]>
net: rtnetlink: fix bugs in rtnl_alt_ifname()

Alexandre Belloni <[email protected]>
net: macb: Properly handle phylink on at91rm9200

Eric Dumazet <[email protected]>
net: add strict checks in netdev_name_node_alt_destroy()

Shannon Nelson <[email protected]>
ionic: fix fw_status read

Benjamin Poirier <[email protected]>
ipv6: Fix nlmsg_flags when splitting a multipath route

Benjamin Poirier <[email protected]>
ipv6: Fix route replacement with dev-only route

Taehee Yoo <[email protected]>
bonding: fix lockdep warning in bond_get_stats()

Taehee Yoo <[email protected]>
net: export netdev_next_lower_dev_rcu()

Taehee Yoo <[email protected]>
bonding: add missing netdev_update_lockdep_key()

Vasundhara Volam <[email protected]>
bnxt_en: Issue PCIe FLR in kdump kernel to cleanup pending DMAs.

Vasundhara Volam <[email protected]>
bnxt_en: Improve device shutdown method.

Xin Long <[email protected]>
sctp: move the format error check out of __sctp_sf_do_9_1_abort

Willem de Bruijn <[email protected]>
udp: rehash on disconnect

Paolo Abeni <[email protected]>
Revert "net: dev: introduce support for sch BYPASS for lockless qdisc"

Michal Kalderon <[email protected]>
qede: Fix race between rdma destroy workqueue and link change event

Dmitry Osipenko <[email protected]>
nfc: pn544: Fix occasional HW initialization failure

Rohit Maheshwari <[email protected]>
net/tls: Fix to avoid gettig invalid tls record

Jason Baron <[email protected]>
net: sched: correct flower port blocking

Arun Parameswaran <[email protected]>
net: phy: restore mdio regs in the iproc mdio driver

Horatiu Vultur <[email protected]>
net: mscc: fix in frame extraction

Alexandre Belloni <[email protected]>
net: macb: ensure interface is not suspended on at91rm9200

Jethro Beekman <[email protected]>
net: fib_rules: Correctly set table field when table number exceeds 8 bits

Florian Fainelli <[email protected]>
net: dsa: b53: Ensure the default VID is untagged

Aristeu Rozanski <[email protected]>
EDAC: skx_common: downgrade message importance on missing PCI device

-------------

Diffstat:

 Documentation/networking/nf_flowtable.txt          |   2 +-
 Documentation/sphinx/parallel-wrapper.sh           |   2 +-
 Makefile                                           |   4 +-
 arch/arm/boot/dts/stihxxx-b2120.dtsi               |   2 +-
 arch/arm/include/asm/vdso/vsyscall.h               |   4 +-
 arch/arm/kernel/ftrace.c                           |   7 +-
 arch/mips/include/asm/sync.h                       |   4 +-
 arch/mips/kernel/vpe.c                             |   2 +-
 arch/riscv/kernel/traps.c                          |   4 +-
 arch/x86/events/intel/core.c                       |   1 +
 arch/x86/events/intel/cstate.c                     |  22 +-
 arch/x86/events/msr.c                              |   3 +-
 arch/x86/include/asm/kvm_host.h                    |   1 +
 arch/x86/include/uapi/asm/kvm.h                    |   1 +
 arch/x86/kernel/cpu/resctrl/internal.h             |   1 +
 arch/x86/kernel/cpu/resctrl/monitor.c              |   4 +-
 arch/x86/kvm/lapic.c                               |   2 +-
 arch/x86/kvm/svm.c                                 |  44 ++
 arch/x86/kvm/vmx/nested.c                          | 105 ++--
 arch/x86/kvm/vmx/nested.h                          |   5 +
 arch/x86/kvm/vmx/vmx.c                             |  52 +-
 arch/x86/kvm/vmx/vmx.h                             |   3 +
 arch/x86/kvm/x86.c                                 |   8 +-
 drivers/acpi/acpi_watchdog.c                       |   3 +-
 drivers/bus/Kconfig                                |   1 -
 drivers/char/ipmi/ipmi_ssif.c                      |  10 +-
 drivers/clk/qcom/clk-rpmh.c                        |   2 +-
 drivers/cpufreq/cpufreq.c                          |  12 +-
 drivers/devfreq/devfreq.c                          |   4 +-
 drivers/edac/skx_common.c                          |   2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c            |   2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h            |   1 +
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c              |  37 +-
 drivers/gpu/drm/amd/display/dc/clk_mgr/Makefile    |   6 +
 .../drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c  |   6 +
 drivers/gpu/drm/amd/display/dc/dce/dce_aux.c       |   2 +-
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c |   1 -
 .../gpu/drm/amd/display/dc/dcn21/dcn21_resource.c  |   6 +
 .../drm/amd/include/asic_reg/dce/dce_12_0_offset.h |   2 +
 drivers/gpu/drm/i915/gem/i915_gem_shrinker.c       |   4 +-
 drivers/gpu/drm/i915/gvt/dmabuf.c                  |   2 +-
 drivers/gpu/drm/i915/gvt/vgpu.c                    |   2 +-
 drivers/gpu/drm/msm/msm_drv.c                      |   8 +
 drivers/gpu/drm/radeon/radeon_drv.c                |  43 +-
 drivers/gpu/drm/radeon/radeon_kms.c                |   6 +
 drivers/hid/hid-alps.c                             |   2 +-
 drivers/hid/hid-core.c                             |   4 +-
 drivers/hid/hid-ite.c                              |   5 +-
 drivers/hid/usbhid/hiddev.c                        |   2 +-
 drivers/i2c/busses/i2c-altera.c                    |   2 +-
 drivers/i2c/busses/i2c-jz4780.c                    |  36 +-
 drivers/infiniband/hw/hns/hns_roce_device.h        |   3 +-
 drivers/infiniband/hw/hns/hns_roce_hw_v1.c         |  37 +-
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c         |  80 +--
 drivers/infiniband/sw/siw/siw_cm.c                 |   5 +-
 drivers/macintosh/therm_windtunnel.c               |  52 +-
 drivers/md/bcache/alloc.c                          |  18 +-
 drivers/md/bcache/btree.c                          |  13 +
 drivers/net/bonding/bond_main.c                    |  55 +-
 drivers/net/bonding/bond_options.c                 |   2 +
 drivers/net/dsa/b53/b53_common.c                   |   3 +
 drivers/net/ethernet/amazon/ena/ena_com.c          |  96 ++--
 drivers/net/ethernet/amazon/ena/ena_com.h          |   9 +
 drivers/net/ethernet/amazon/ena/ena_ethtool.c      |  46 +-
 drivers/net/ethernet/amazon/ena/ena_netdev.c       |   6 +-
 drivers/net/ethernet/amazon/ena/ena_netdev.h       |   2 +
 drivers/net/ethernet/apm/xgene/xgene_enet_main.c   |   2 +-
 .../net/ethernet/aquantia/atlantic/aq_ethtool.c    |   5 +
 .../net/ethernet/aquantia/atlantic/aq_filters.c    |   2 +-
 drivers/net/ethernet/aquantia/atlantic/aq_nic.c    |   8 +-
 .../net/ethernet/aquantia/atlantic/aq_pci_func.c   |  13 +-
 drivers/net/ethernet/aquantia/atlantic/aq_ring.c   |  10 +-
 drivers/net/ethernet/aquantia/atlantic/aq_ring.h   |   3 +-
 .../ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c  |  18 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt.c          |  12 +-
 drivers/net/ethernet/cadence/macb.h                |   1 +
 drivers/net/ethernet/cadence/macb_main.c           |  66 ++-
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    |  22 +-
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c  |   2 +-
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |   4 +-
 drivers/net/ethernet/intel/ice/ice_base.c          |  12 +-
 drivers/net/ethernet/intel/ice/ice_common.c        |  17 +-
 drivers/net/ethernet/intel/ice/ice_dcb_nl.c        |  12 +-
 drivers/net/ethernet/intel/ice/ice_ethtool.c       |  17 +-
 drivers/net/ethernet/intel/ice/ice_hw_autogen.h    |   6 +
 drivers/net/ethernet/intel/ice/ice_lib.c           |  33 +-
 drivers/net/ethernet/intel/ice/ice_lib.h           |   2 -
 drivers/net/ethernet/intel/ice/ice_main.c          |  23 +-
 drivers/net/ethernet/intel/ice/ice_txrx_lib.c      |   2 +-
 drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c   |   8 +-
 drivers/net/ethernet/mscc/ocelot_board.c           |   8 +
 drivers/net/ethernet/pensando/ionic/ionic_dev.c    |  11 +-
 drivers/net/ethernet/pensando/ionic/ionic_if.h     |   1 +
 drivers/net/ethernet/qlogic/qede/qede.h            |   2 +
 drivers/net/ethernet/qlogic/qede/qede_rdma.c       |  29 +-
 drivers/net/hyperv/netvsc.c                        |   2 +-
 drivers/net/hyperv/netvsc_drv.c                    |   3 +
 drivers/net/phy/mdio-bcm-iproc.c                   |  20 +
 drivers/net/usb/qmi_wwan.c                         |  43 +-
 drivers/net/wireless/marvell/mwifiex/main.h        |  13 -
 drivers/net/wireless/marvell/mwifiex/tdls.c        |  75 +--
 drivers/nfc/pn544/i2c.c                            |   1 +
 drivers/nvme/host/core.c                           |  10 +-
 drivers/nvme/host/pci.c                            |  25 +-
 drivers/nvme/host/rdma.c                           |   2 +-
 drivers/nvme/host/tcp.c                            |   9 +-
 drivers/perf/arm_smmuv3_pmu.c                      |   2 +-
 drivers/pwm/pwm-omap-dmtimer.c                     |  21 +-
 drivers/s390/crypto/ap_bus.h                       |   4 +-
 drivers/s390/crypto/ap_card.c                      |   8 +-
 drivers/s390/crypto/ap_queue.c                     |   6 +-
 drivers/s390/crypto/zcrypt_api.c                   |  16 +-
 drivers/s390/net/qeth_core_main.c                  |   2 +-
 drivers/s390/net/qeth_l2_main.c                    |  29 +-
 drivers/s390/scsi/zfcp_fsf.h                       |   2 +-
 drivers/s390/scsi/zfcp_sysfs.c                     |   2 +-
 drivers/scsi/sd_zbc.c                              |   7 +-
 drivers/soc/tegra/fuse/fuse-tegra30.c              |   3 +-
 drivers/thermal/broadcom/brcmstb_thermal.c         |  31 +-
 drivers/thermal/db8500_thermal.c                   |   4 +-
 drivers/vhost/net.c                                |  10 +-
 drivers/watchdog/wdat_wdt.c                        |   2 +-
 fs/ceph/file.c                                     |  17 +-
 fs/cifs/cifsacl.c                                  |   4 +-
 fs/cifs/connect.c                                  |   2 +-
 fs/cifs/inode.c                                    |   2 +-
 fs/dax.c                                           |   3 +
 fs/ext4/super.c                                    |   6 +-
 fs/f2fs/data.c                                     |  32 +-
 fs/io-wq.c                                         |  22 +-
 fs/io_uring.c                                      |  12 +-
 fs/namei.c                                         |   2 +-
 fs/nfs/nfs4file.c                                  |   1 -
 fs/nfs/nfs4proc.c                                  |  18 +-
 fs/ubifs/orphan.c                                  |   4 +-
 fs/xfs/libxfs/xfs_attr.h                           |   7 +-
 fs/xfs/xfs_ioctl.c                                 |   2 +
 fs/xfs/xfs_ioctl32.c                               |   2 +
 include/acpi/actypes.h                             |   3 +-
 include/asm-generic/vdso/vsyscall.h                |   4 +-
 include/linux/blkdev.h                             |   2 +-
 include/linux/blktrace_api.h                       |  18 +-
 include/linux/hid.h                                |   2 +-
 include/linux/netdevice.h                          |   7 +-
 include/linux/netfilter/ipset/ip_set.h             |  11 +-
 include/linux/sched/nohz.h                         |   2 +
 include/net/flow_dissector.h                       |   9 +
 include/uapi/linux/usb/charger.h                   |  16 +-
 kernel/audit.c                                     |  40 +-
 kernel/auditfilter.c                               |  71 +--
 kernel/kprobes.c                                   |   4 +-
 kernel/locking/lockdep_proc.c                      |   4 +-
 kernel/padata.c                                    |   4 +-
 kernel/rcu/tree_exp.h                              |  11 +-
 kernel/sched/core.c                                |  31 +-
 kernel/sched/fair.c                                |   7 +-
 kernel/sched/loadavg.c                             |  33 +-
 kernel/time/vsyscall.c                             |  37 +-
 kernel/trace/blktrace.c                            | 114 +++-
 kernel/trace/trace.c                               |   2 +
 mm/debug.c                                         |   8 +-
 mm/gup.c                                           |   3 +-
 mm/huge_memory.c                                   |  26 +-
 net/core/dev.c                                     |  34 +-
 net/core/fib_rules.c                               |   2 +-
 net/core/rtnetlink.c                               |  26 +-
 net/ipv4/udp.c                                     |   6 +-
 net/ipv6/ip6_fib.c                                 |   7 +-
 net/ipv6/route.c                                   |   1 +
 net/mac80211/mlme.c                                |   6 +-
 net/mac80211/util.c                                |  34 +-
 net/netfilter/ipset/ip_set_core.c                  |  34 +-
 net/netfilter/ipset/ip_set_hash_gen.h              | 635 ++++++++++++++-------
 net/netfilter/nft_tunnel.c                         |   4 +-
 net/netfilter/xt_hashlimit.c                       |  12 +-
 net/netlink/af_netlink.c                           |   5 +-
 net/sched/cls_flower.c                             |   1 +
 net/sctp/sm_statefuns.c                            |  29 +-
 net/smc/af_smc.c                                   |   2 +
 net/smc/smc_clc.c                                  |   4 +-
 net/tipc/socket.c                                  |   2 +
 net/tls/tls_device.c                               |  20 +-
 net/wireless/ethtool.c                             |   8 +-
 net/wireless/nl80211.c                             |   5 +-
 scripts/Makefile.lib                               |   4 +-
 security/integrity/ima/ima_policy.c                |  44 +-
 tools/perf/builtin-report.c                        |   6 +-
 tools/perf/ui/browsers/hists.c                     |   1 +
 tools/perf/ui/gtk/Build                            |   5 +
 tools/perf/util/map.c                              |   1 +
 tools/testing/selftests/ftrace/Makefile            |   2 +-
 tools/testing/selftests/livepatch/Makefile         |   2 +
 tools/testing/selftests/net/fib_tests.sh           |   6 +
 tools/testing/selftests/rseq/Makefile              |   2 +
 tools/testing/selftests/rtc/Makefile               |   2 +
 virt/kvm/kvm_main.c                                |  12 +-
 196 files changed, 2077 insertions(+), 1118 deletions(-)
author maintainer
#4 lore raw

PATCH 4/176 net: macb: ensure interface is not suspended on at91rm9200

From: Alexandre Belloni <[email protected]>

[ Upstream commit e6a41c23df0d5da01540d2abef41591589c0b4be ]

Because of autosuspend, at91ether_start is called with clocks disabled. Ensure that pm_runtime doesn't suspend the interface as soon as it is opened as there is no pm_runtime support is the other relevant parts of the platform support for at91rm9200.

---
 drivers/net/ethernet/cadence/macb_main.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/ethernet/cadence/macb_main.c +5 -1
@@ -3751,6 +3751,10 @@ static int at91ether_open(struct net_dev
 	u32 ctl;
 	int ret;
 
+	ret = pm_runtime_get_sync(&lp->pdev->dev);
+	if (ret < 0)
+		return ret;
+
 	/* Clear internal statistics */
 	ctl = macb_readl(lp, NCR);
 	macb_writel(lp, NCR, ctl | MACB_BIT(CLRSTAT));
@@ -3815,7 +3819,7 @@ static int at91ether_close(struct net_de
 			  q->rx_buffers, q->rx_buffers_dma);
 	q->rx_buffers = NULL;
 
-	return 0;
+	return pm_runtime_put(&lp->pdev->dev);
 }
 
 /* Transmit packet */
author maintainer
#29 lore raw

PATCH 29/176 sched/fair: Prevent unlimited runtime on throttled group

In reply to Greg Kroah-Hartman

From: Vincent Guittot <[email protected]>

[ Upstream commit 2a4b03ffc69f2dedc6388e9a6438b5f4c133a40d ]

When a running task is moved on a throttled task group and there is no other task enqueued on the CPU, the task can keep running using 100% CPU whatever the allocated bandwidth for the group and although its cfs rq is throttled. Furthermore, the group entity of the cfs_rq and its parents are not enqueued but only set as curr on their respective cfs_rqs.

We have the following sequence:

sched_move_task
-dequeue_task: dequeue task and group_entities. -put_prev_task: put task and group entities. -sched_change_group: move task to new group.
-enqueue_task: enqueue only task but not group entities because cfs_rq is
throttled.
-set_next_task : set task and group_entities as current sched_entity of
their cfs_rq.

Another impact is that the root cfs_rq runnable_load_avg at root rq stays null because the group_entities are not enqueued. This situation will stay the same until an "external" event triggers a reschedule. Let trigger it immediately instead.

---
 kernel/sched/core.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
kernel/sched/core.c +8 -1
index 65ed821335dd5..9e7768dbd92d2 100644
@@ -7068,8 +7068,15 @@ void sched_move_task(struct task_struct *tsk)
 
 	if (queued)
 		enqueue_task(rq, tsk, queue_flags);
-	if (running)
+	if (running) {
 		set_next_task(rq, tsk);
+		/*
+		 * After changing group, the running task may have joined a
+		 * throttled one but it's still the running task. Trigger a
+		 * resched to make sure that task can still run.
+		 */
+		resched_curr(rq);
+	}
 
 	task_rq_unlock(rq, tsk, &rf);
 }
Signature · 1 line
2.20.1
author maintainer
#18 lore raw

PATCH 18/176 bonding: fix lockdep warning in bond_get_stats()

In reply to Greg Kroah-Hartman

From: Taehee Yoo <[email protected]>

[ Upstream commit b3e80d44f5b1b470dd9e2dbc6816e63a5c519709 ]

In the "struct bonding", there is stats_lock.
This lock protects "bond_stats" in the "struct bonding". bond_stats is updated in the bond_get_stats() and this function would be executed concurrently. So, the lock is needed.

Bonding interfaces would be nested.
So, either stats_lock should use dynamic lockdep class key or stats_lock should be used by spin_lock_nested(). In the current code, stats_lock is using a dynamic lockdep class key.
But there is no updating stats_lock_key routine So, lockdep warning will occur.

Test commands:
ip link add bond0 type bond
ip link add bond1 type bond
ip link set bond0 master bond1
ip link set bond0 nomaster
ip link set bond1 master bond0

Splat looks like:

[   38.420603][  T957] 5.5.0+ #394 Not tainted
[   38.421074][  T957] ------------------------------------------------------
[   38.421837][  T957] ip/957 is trying to acquire lock:
[   38.422399][  T957] ffff888063262cd8 (&bond->stats_lock_key#2){+.+.}, at: bond_get_stats+0x90/0x4d0 [bonding]
[   38.423528][  T957]
[   38.423528][  T957] but task is already holding lock:
[   38.424526][  T957] ffff888065fd2cd8 (&bond->stats_lock_key){+.+.}, at: bond_get_stats+0x90/0x4d0 [bonding]
[   38.426075][  T957]
[   38.426075][  T957] which lock already depends on the new lock.
[   38.426075][  T957]
[   38.428536][  T957]
[   38.428536][  T957] the existing dependency chain (in reverse order) is:
[   38.429475][  T957]
[   38.429475][  T957] -> #1 (&bond->stats_lock_key){+.+.}:
[   38.430273][  T957]        _raw_spin_lock+0x30/0x70
[   38.430812][  T957]        bond_get_stats+0x90/0x4d0 [bonding]
[   38.431451][  T957]        dev_get_stats+0x1ec/0x270
[   38.432088][  T957]        bond_get_stats+0x1a5/0x4d0 [bonding]
[   38.432767][  T957]        dev_get_stats+0x1ec/0x270
[   38.433322][  T957]        rtnl_fill_stats+0x44/0xbe0
[   38.433866][  T957]        rtnl_fill_ifinfo+0xeb2/0x3720
[   38.434474][  T957]        rtmsg_ifinfo_build_skb+0xca/0x170
[   38.435081][  T957]        rtmsg_ifinfo_event.part.33+0x1b/0xb0
[   38.436848][  T957]        rtnetlink_event+0xcd/0x120
[   38.437455][  T957]        notifier_call_chain+0x90/0x160
[   38.438067][  T957]        netdev_change_features+0x74/0xa0
[   38.438708][  T957]        bond_compute_features.isra.45+0x4e6/0x6f0 [bonding]
[   38.439522][  T957]        bond_enslave+0x3639/0x47b0 [bonding]
[   38.440225][  T957]        do_setlink+0xaab/0x2ef0
[   38.440786][  T957]        __rtnl_newlink+0x9c5/0x1270
[   38.441463][  T957]        rtnl_newlink+0x65/0x90
[   38.442075][  T957]        rtnetlink_rcv_msg+0x4a8/0x890
[   38.442774][  T957]        netlink_rcv_skb+0x121/0x350
[   38.443451][  T957]        netlink_unicast+0x42e/0x610
[   38.444282][  T957]        netlink_sendmsg+0x65a/0xb90
[   38.444992][  T957]        ____sys_sendmsg+0x5ce/0x7a0
[   38.445679][  T957]        ___sys_sendmsg+0x10f/0x1b0
[   38.446365][  T957]        __sys_sendmsg+0xc6/0x150
[   38.447007][  T957]        do_syscall_64+0x99/0x4f0
[   38.447668][  T957]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
[   38.448538][  T957]
[   38.448538][  T957] -> #0 (&bond->stats_lock_key#2){+.+.}:
[   38.449554][  T957]        __lock_acquire+0x2d8d/0x3de0
[   38.450148][  T957]        lock_acquire+0x164/0x3b0
[   38.450711][  T957]        _raw_spin_lock+0x30/0x70
[   38.451292][  T957]        bond_get_stats+0x90/0x4d0 [bonding]
[   38.451950][  T957]        dev_get_stats+0x1ec/0x270
[   38.452425][  T957]        bond_get_stats+0x1a5/0x4d0 [bonding]
[   38.453362][  T957]        dev_get_stats+0x1ec/0x270
[   38.453825][  T957]        rtnl_fill_stats+0x44/0xbe0
[   38.454390][  T957]        rtnl_fill_ifinfo+0xeb2/0x3720
[   38.456257][  T957]        rtmsg_ifinfo_build_skb+0xca/0x170
[   38.456998][  T957]        rtmsg_ifinfo_event.part.33+0x1b/0xb0
[   38.459351][  T957]        rtnetlink_event+0xcd/0x120
[   38.460086][  T957]        notifier_call_chain+0x90/0x160
[   38.460829][  T957]        netdev_change_features+0x74/0xa0
[   38.461752][  T957]        bond_compute_features.isra.45+0x4e6/0x6f0 [bonding]
[   38.462705][  T957]        bond_enslave+0x3639/0x47b0 [bonding]
[   38.463476][  T957]        do_setlink+0xaab/0x2ef0
[   38.464141][  T957]        __rtnl_newlink+0x9c5/0x1270
[   38.464897][  T957]        rtnl_newlink+0x65/0x90
[   38.465522][  T957]        rtnetlink_rcv_msg+0x4a8/0x890
[   38.466215][  T957]        netlink_rcv_skb+0x121/0x350
[   38.466895][  T957]        netlink_unicast+0x42e/0x610
[   38.467583][  T957]        netlink_sendmsg+0x65a/0xb90
[   38.468285][  T957]        ____sys_sendmsg+0x5ce/0x7a0
[   38.469202][  T957]        ___sys_sendmsg+0x10f/0x1b0
[   38.469884][  T957]        __sys_sendmsg+0xc6/0x150
[   38.470587][  T957]        do_syscall_64+0x99/0x4f0
[   38.471245][  T957]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
[   38.472093][  T957]
[   38.472093][  T957] other info that might help us debug this:
[   38.472093][  T957]
[   38.473438][  T957]  Possible unsafe locking scenario:
[   38.473438][  T957]
[   38.474898][  T957]        CPU0                    CPU1
[   38.476234][  T957]        ----                    ----
[   38.480171][  T957]   lock(&bond->stats_lock_key);
[   38.480808][  T957]                                lock(&bond->stats_lock_key#2);
[   38.481791][  T957]                                lock(&bond->stats_lock_key);
[   38.482754][  T957]   lock(&bond->stats_lock_key#2);
[   38.483416][  T957]
[   38.483416][  T957]  *** DEADLOCK ***
[   38.483416][  T957]
[   38.484505][  T957] 3 locks held by ip/957:
[   38.485048][  T957]  #0: ffffffffbccf6230 (rtnl_mutex){+.+.}, at: rtnetlink_rcv_msg+0x457/0x890
[   38.486198][  T957]  #1: ffff888065fd2cd8 (&bond->stats_lock_key){+.+.}, at: bond_get_stats+0x90/0x4d0 [bonding]
[   38.487625][  T957]  #2: ffffffffbc9254c0 (rcu_read_lock){....}, at: bond_get_stats+0x5/0x4d0 [bonding]
[   38.488897][  T957]
[   38.488897][  T957] stack backtrace:
[   38.489646][  T957] CPU: 1 PID: 957 Comm: ip Not tainted 5.5.0+ #394
[   38.490497][  T957] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
[   38.492810][  T957] Call Trace:
[   38.493219][  T957]  dump_stack+0x96/0xdb
[   38.493709][  T957]  check_noncircular+0x371/0x450
[   38.494344][  T957]  ? lookup_address+0x60/0x60
[   38.494923][  T957]  ? print_circular_bug.isra.35+0x310/0x310
[   38.495699][  T957]  ? hlock_class+0x130/0x130
[   38.496334][  T957]  ? __lock_acquire+0x2d8d/0x3de0
[   38.496979][  T957]  __lock_acquire+0x2d8d/0x3de0
[   38.497607][  T957]  ? register_lock_class+0x14d0/0x14d0
[   38.498333][  T957]  ? check_chain_key+0x236/0x5d0
[   38.499003][  T957]  lock_acquire+0x164/0x3b0
[   38.499800][  T957]  ? bond_get_stats+0x90/0x4d0 [bonding]
[   38.500706][  T957]  _raw_spin_lock+0x30/0x70
[   38.501435][  T957]  ? bond_get_stats+0x90/0x4d0 [bonding]
[   38.502311][  T957]  bond_get_stats+0x90/0x4d0 [bonding]

[ ... ]

But, there is another problem.
The dynamic lockdep class key is protected by RTNL, but bond_get_stats() would be called outside of RTNL.
So, it would use an invalid dynamic lockdep class key.

In order to fix this issue, stats_lock uses spin_lock_nested() instead of a dynamic lockdep key.
The bond_get_stats() calls bond_get_lowest_level_rcu() to get the correct nest level value, which will be used by spin_lock_nested(). The "dev->lower_level" indicates lower nest level value, but this value is invalid outside of RTNL.
So, bond_get_lowest_level_rcu() returns valid lower nest level value in the RCU critical section.
bond_get_lowest_level_rcu() will be work only when LOCKDEP is enabled.

Fixes 089bca2caed0 ("bonding: use dynamic lockdep key instead of subclass")
---
 drivers/net/bonding/bond_main.c |   53 +++++++++++++++++++++++++++++++++++++---
 1 file changed, 50 insertions(+), 3 deletions(-)
drivers/net/bonding/bond_main.c +50 -3
@@ -3526,6 +3526,47 @@ static void bond_fold_stats(struct rtnl_
 	}
 }
 
+#ifdef CONFIG_LOCKDEP
+static int bond_get_lowest_level_rcu(struct net_device *dev)
+{
+	struct net_device *ldev, *next, *now, *dev_stack[MAX_NEST_DEV + 1];
+	struct list_head *niter, *iter, *iter_stack[MAX_NEST_DEV + 1];
+	int cur = 0, max = 0;
+
+	now = dev;
+	iter = &dev->adj_list.lower;
+
+	while (1) {
+		next = NULL;
+		while (1) {
+			ldev = netdev_next_lower_dev_rcu(now, &iter);
+			if (!ldev)
+				break;
+
+			next = ldev;
+			niter = &ldev->adj_list.lower;
+			dev_stack[cur] = now;
+			iter_stack[cur++] = iter;
+			if (max <= cur)
+				max = cur;
+			break;
+		}
+
+		if (!next) {
+			if (!cur)
+				return max;
+			next = dev_stack[--cur];
+			niter = iter_stack[cur];
+		}
+
+		now = next;
+		iter = niter;
+	}
+
+	return max;
+}
+#endif
+
 static void bond_get_stats(struct net_device *bond_dev,
 			   struct rtnl_link_stats64 *stats)
 {
@@ -3533,11 +3574,17 @@ static void bond_get_stats(struct net_de
 	struct rtnl_link_stats64 temp;
 	struct list_head *iter;
 	struct slave *slave;
+	int nest_level = 0;
 
-	spin_lock(&bond->stats_lock);
-	memcpy(stats, &bond->bond_stats, sizeof(*stats));
 
 	rcu_read_lock();
+#ifdef CONFIG_LOCKDEP
+	nest_level = bond_get_lowest_level_rcu(bond_dev);
+#endif
+
+	spin_lock_nested(&bond->stats_lock, nest_level);
+	memcpy(stats, &bond->bond_stats, sizeof(*stats));
+
 	bond_for_each_slave_rcu(bond, slave, iter) {
 		const struct rtnl_link_stats64 *new =
 			dev_get_stats(slave->dev, &temp);
@@ -3547,10 +3594,10 @@ static void bond_get_stats(struct net_de
 		/* save off the slave stats for the next run */
 		memcpy(&slave->slave_stats, new, sizeof(*new));
 	}
-	rcu_read_unlock();
 
 	memcpy(&bond->bond_stats, stats, sizeof(*stats));
 	spin_unlock(&bond->stats_lock);
+	rcu_read_unlock();
 }
 
 static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd)
author maintainer
#2 lore raw

PATCH 2/176 net: dsa: b53: Ensure the default VID is untagged

In reply to Greg Kroah-Hartman

From: Florian Fainelli <[email protected]>

[ Upstream commit d965a5432d4c3e6b9c3d2bc1d4a800013bbf76f6 ]

We need to ensure that the default VID is untagged otherwise the switch will be sending tagged frames and the results can be problematic. This is especially true with b53 switches that use VID 0 as their default VLAN since VID 0 has a special meaning.

Fixes fea83353177a ("net: dsa: b53: Fix default VLAN ID")
Fixes 061f6a505ac3 ("net: dsa: Add ndo_vlan_rx_{add, kill}_vid implementation")
---
 drivers/net/dsa/b53/b53_common.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/net/dsa/b53/b53_common.c +3 -0
@@ -1353,6 +1353,9 @@ void b53_vlan_add(struct dsa_switch *ds,
 
 		b53_get_vlan_entry(dev, vid, vl);
 
+		if (vid == 0 && vid == b53_default_pvid(dev))
+			untagged = true;
+
 		vl->members |= BIT(port);
 		if (untagged && !dsa_is_cpu_port(ds, port))
 			vl->untag |= BIT(port);
author maintainer
#74 lore raw

Re: [PATCH 5.5 072/176] bcache: ignore pending signals when creating gc and allocator thread

In reply to Jens Axboe
Quoted 20 lines · Jens Axboe
Quoted 13 lines · Greg Kroah-Hartman

From: Coly Li <[email protected]>

[ Upstream commit 0b96da639a4874311e9b5156405f69ef9fc3bef8 ]

When run a cache set, all the bcache btree node of this cache set will be checked by bch_btree_check(). If the bcache btree is very large, iterating all the btree nodes will occupy too much system memory and the bcache registering process might be selected and killed by system OOM killer. kthread_run() will fail if current process has pending signal, therefore the kthread creating in run_cache_set() for gc and allocator kernel threads are very probably failed for a very large bcache btree.

Quoted 5 lines

Indeed such OOM is safe and the registering process will exit after the registration done. Therefore this patch flushes pending signals during the cache set start up, specificly in bch_cache_allocator_start() and bch_gc_thread_start(), to make sure run_cache_set() won't fail for large cahced data set.

Quoted 4 lines

Ditto this one, of course.

Did someone send this in for stable? It's not marked stable in the original commit.

I think the autobot grabbed it.

maintainer
#188 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.5.8 release. There are 176 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Thu, 05 Mar 2020 17:42:06 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
	https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.5.8-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.5.y
and the diffstat can be found below.

thanks,

greg k-h

All tests passing for Tegra ...

Test results for stable-v5.5:

    13 builds:	13 pass, 0 fail
    22 boots:	22 pass, 0 fail
    40 tests:	40 pass, 0 fail

Linux version: 5.5.8-rc1-g3517b32c0774
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,

                tegra194-p2972-0000, tegra20-ventana,
                tegra210-p2371-2180, tegra210-p3450-0000,
                tegra30-cardhu-a04

Cheers
Jon

Signature · 1 line
nvpublic
#190 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.5.8 release. There are 176 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Thu, 05 Mar 2020 17:42:06 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 9 lines
	https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.5.8-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.5.y
and the diffstat can be found below.

thanks,

greg k-h

Compiled and booted on my test system. No dmesg regressions.

thanks,
-- Shuah

author maintainer
#191 lore raw
Quoted 15 lines · shuah
Quoted 14 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.5.8 release. There are 176 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Thu, 05 Mar 2020 17:42:06 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

	https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.5.8-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.5.y
and the diffstat can be found below.

Quoted 6 lines
Quoted 4 lines

thanks,

greg k-h

Compiled and booted on my test system. No dmesg regressions.

Great, thanks for testing these and letting me know.

greg k-h

author maintainer
#189 lore raw
In reply to Jon Hunter
Quoted 27 lines · Jon Hunter
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.5.8 release. There are 176 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Thu, 05 Mar 2020 17:42:06 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
	https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.5.8-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.5.y
and the diffstat can be found below.

thanks,

greg k-h

All tests passing for Tegra ...

Test results for stable-v5.5:

    13 builds:	13 pass, 0 fail
    22 boots:	22 pass, 0 fail
    40 tests:	40 pass, 0 fail
Quoted 6 lines

Linux version: 5.5.8-rc1-g3517b32c0774
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,

                tegra194-p2972-0000, tegra20-ventana,
                tegra210-p2371-2180, tegra210-p3450-0000,
                tegra30-cardhu-a04

thanks for testing all of these and letting me know.

greg k-h

#192 lore raw
In reply to Greg Kroah-Hartman
Quoted 10 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.5.8 release. There are 176 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Thu, 05 Mar 2020 17:42:06 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 9 lines
        https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.5.8-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.5.y
and the diffstat can be found below.

thanks,

greg k-h

Results from Linaro’s test farm.
Regressions detected on x86_64 and i386.

Test failure output:
CVE-2017-5715: VULN (IBRS+IBPB or retpoline+IBPB+RSB filling, is needed to mitigate the vulnerability)

Test description:
CVE-2017-5715 branch target injection (Spectre Variant 2)

Impact: Kernel
Mitigation 1: new opcode via microcode update that should be used by up to date compilers to protect the BTB (by flushing indirect branch predictors)
Mitigation 2: introducing "retpoline" into compilers, and recompile software/OS with it
Performance impact of the mitigation: high for mitigation 1, medium for mitigation 2, depending on your CPU

ref:
https://github.com/speed47/spectre-meltdown-checker
https://qa-reports.linaro.org/lkft/linux-stable-rc-5.5-oe/tests/spectre-meltdown-checker-test/CVE-2017-5715
https://lkft.validation.linaro.org/scheduler/job/1264643#L21206

Summary
------------------------------------------------------------------------

kernel: 5.5.8-rc1
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-5.5.y
git commit: 3517b32c0774341d492140b2be08c4bf6d1a833e
git describe: v5.5.7-177-g3517b32c0774
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-5.5-oe/build/v5.5.7-177-g3517b32c0774

Regressions (compared to build v5.5.7)
------------------------------------------------------------------------

i386:
spectre-meltdown-checker-test:
* CVE-2017-5715

x86:
spectre-meltdown-checker-test:
* CVE-2017-5715

No fixes (compared to build v5.5.7)

Ran 25662 total tests in the following environments and test suites.

Environments
--------------
- dragonboard-410c
- hi6220-hikey
- i386
- juno-r2
- nxp-ls2088
- qemu_arm
- qemu_arm64
- qemu_i386
- qemu_x86_64
- x15
- x86

Test Suites
-----------
* build
* install-android-platform-tools-r2600
* kselftest
* libgpiod
* linux-log-parser
* perf
* ltp-cap_bounds-tests
* ltp-cpuhotplug-tests
* ltp-fcntl-locktests-tests
* ltp-fs-tests
* ltp-ipc-tests
* ltp-sched-tests
* network-basic-tests
* kvm-unit-tests
* libhugetlbfs
* ltp-commands-tests
* ltp-containers-tests
* ltp-crypto-tests
* ltp-cve-tests
* ltp-dio-tests
* ltp-filecaps-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-hugetlb-tests
* ltp-io-tests
* ltp-m[
* ltp-mm-tests
* ltp-nptl-tests
* ltp-pty-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* spectre-meltdown-checker-test
* v4l2-compliance
* ltp-cap_bounds-64k-page_size-tests
* ltp-cap_bounds-kasan-tests
* ltp-commands-64k-page_size-tests
* ltp-commands-kasan-tests
* ltp-containers-64k-page_size-tests
* ltp-containers-kasan-tests
* ltp-cpuhotplug-64k-page_size-tests
* ltp-cpuhotplug-kasan-tests
* ltp-crypto-64k-page_size-tests
* ltp-crypto-kasan-tests
* ltp-cve-64k-page_size-tests
* ltp-cve-kasan-tests
* ltp-dio-64k-page_size-tests
* ltp-dio-kasan-tests
* ltp-fcntl-locktests-64k-page_size-tests
* ltp-fcntl-locktests-kasan-tests
* ltp-filecaps-64k-page_size-tests
* ltp-filecaps-kasan-tests
* ltp-fs-64k-page_size-tests
* ltp-fs-kasan-tests
* ltp-fs_bind-64k-page_size-tests
* ltp-fs_bind-kasan-tests
* ltp-fs_perms_simple-64k-page_size-tests
* ltp-fs_perms_simple-kasan-tests
* ltp-fsx-64k-page_size-tests
* ltp-fsx-kasan-tests
* ltp-hugetlb-64k-page_size-tests
* ltp-hugetlb-kasan-tests
* ltp-io-64k-page_size-tests
* ltp-io-kasan-tests
* ltp-ipc-64k-page_size-tests
* ltp-ipc-kasan-tests
* ltp-math-64k-page_size-tests
* ltp-math-kasan-tests
* ltp-math-tests
* ltp-mm-64k-page_size-tests
* ltp-mm-kasan-tests
* ltp-nptl-64k-page_size-tests
* ltp-nptl-kasan-tests
* ltp-pty-64k-page_size-tests
* ltp-pty-kasan-tests
* ltp-sched-64k-page_size-tests
* ltp-sched-kasan-tests
* ltp-securebits-64k-page_size-tests
* ltp-securebits-kasan-tests
* ltp-syscalls-64k-page_size-tests
* ltp-syscalls-compat-tests
* ltp-syscalls-kasan-tests
* ltp-open-posix-tests
* ssuite
* kselftest-vsyscall-mode-native
* kselftest-vsyscall-mode-none

Signature · 2 lines
Linaro LKFT
https://lkft.linaro.org
#116 lore raw

Re: [PATCH 5.5 111/176] KVM: nVMX: Emulate MTF when performing instruction emulation

In reply to Greg Kroah-Hartman
Quoted 15 lines · Greg Kroah-Hartman

From: Oliver Upton <[email protected]>

commit 5ef8acbdd687c9d72582e2c05c0b9756efb37863 upstream.

Since commit 5f3d45e7f282 ("kvm/x86: add support for MONITOR_TRAP_FLAG"), KVM has allowed an L1 guest to use the monitor trap flag processor-based execution control for its L2 guest. KVM simply forwards any MTF VM-exits to the L1 guest, which works for normal instruction execution.

However, when KVM needs to emulate an instruction on the behalf of an L2 guest, the monitor trap flag is not emulated. Add the necessary logic to kvm_skip_emulated_instruction() to synthesize an MTF VM-exit to L1 upon instruction emulation for L2.

Quoted 4 lines
Fixes 5f3d45e7f282 ("kvm/x86: add support for MONITOR_TRAP_FLAG")

Why is this included in a stable release? It was part of a series of four patches and the prerequisites as far as I can see are not part of 5.5.

I have already said half a dozen times that I don't want any of the autopick stuff for KVM. Is a Fixes tag sufficient to get patches into stable now?

Paolo

Quoted 201 lines
---
 arch/x86/include/asm/kvm_host.h |    1 +
 arch/x86/include/uapi/asm/kvm.h |    1 +
 arch/x86/kvm/svm.c              |    1 +
 arch/x86/kvm/vmx/nested.c       |   35 ++++++++++++++++++++++++++++++++++-
 arch/x86/kvm/vmx/nested.h       |    5 +++++
 arch/x86/kvm/vmx/vmx.c          |   37 ++++++++++++++++++++++++++++++++++++-
 arch/x86/kvm/vmx/vmx.h          |    3 +++
 arch/x86/kvm/x86.c              |    2 ++
 8 files changed, 83 insertions(+), 2 deletions(-)
arch/x86/include/asm/kvm_host.h +1 -0
@@ -1092,6 +1092,7 @@ struct kvm_x86_ops {
 	void (*run)(struct kvm_vcpu *vcpu);
 	int (*handle_exit)(struct kvm_vcpu *vcpu);
 	int (*skip_emulated_instruction)(struct kvm_vcpu *vcpu);
+	void (*update_emulated_instruction)(struct kvm_vcpu *vcpu);
 	void (*set_interrupt_shadow)(struct kvm_vcpu *vcpu, int mask);
 	u32 (*get_interrupt_shadow)(struct kvm_vcpu *vcpu);
 	void (*patch_hypercall)(struct kvm_vcpu *vcpu,
arch/x86/include/uapi/asm/kvm.h +1 -0
@@ -390,6 +390,7 @@ struct kvm_sync_regs {
 #define KVM_STATE_NESTED_GUEST_MODE	0x00000001
 #define KVM_STATE_NESTED_RUN_PENDING	0x00000002
 #define KVM_STATE_NESTED_EVMCS		0x00000004
+#define KVM_STATE_NESTED_MTF_PENDING	0x00000008
 
 #define KVM_STATE_NESTED_SMM_GUEST_MODE	0x00000001
 #define KVM_STATE_NESTED_SMM_VMXON	0x00000002
arch/x86/kvm/svm.c +1 -0
@@ -7311,6 +7311,7 @@ static struct kvm_x86_ops svm_x86_ops __
 	.run = svm_vcpu_run,
 	.handle_exit = handle_exit,
 	.skip_emulated_instruction = skip_emulated_instruction,
+	.update_emulated_instruction = NULL,
 	.set_interrupt_shadow = svm_set_interrupt_shadow,
 	.get_interrupt_shadow = svm_get_interrupt_shadow,
 	.patch_hypercall = svm_patch_hypercall,
arch/x86/kvm/vmx/nested.c +34 -1
@@ -3616,8 +3616,15 @@ static int vmx_check_nested_events(struc
 	unsigned long exit_qual;
 	bool block_nested_events =
 	    vmx->nested.nested_run_pending || kvm_event_needs_reinjection(vcpu);
+	bool mtf_pending = vmx->nested.mtf_pending;
 	struct kvm_lapic *apic = vcpu->arch.apic;
 
+	/*
+	 * Clear the MTF state. If a higher priority VM-exit is delivered first,
+	 * this state is discarded.
+	 */
+	vmx->nested.mtf_pending = false;
+
 	if (lapic_in_kernel(vcpu) &&
 		test_bit(KVM_APIC_INIT, &apic->pending_events)) {
 		if (block_nested_events)
@@ -3628,8 +3635,28 @@ static int vmx_check_nested_events(struc
 		return 0;
 	}
 
+	/*
+	 * Process any exceptions that are not debug traps before MTF.
+	 */
+	if (vcpu->arch.exception.pending &&
+	    !vmx_pending_dbg_trap(vcpu) &&
+	    nested_vmx_check_exception(vcpu, &exit_qual)) {
+		if (block_nested_events)
+			return -EBUSY;
+		nested_vmx_inject_exception_vmexit(vcpu, exit_qual);
+		return 0;
+	}
+
+	if (mtf_pending) {
+		if (block_nested_events)
+			return -EBUSY;
+		nested_vmx_update_pending_dbg(vcpu);
+		nested_vmx_vmexit(vcpu, EXIT_REASON_MONITOR_TRAP_FLAG, 0, 0);
+		return 0;
+	}
+
 	if (vcpu->arch.exception.pending &&
-		nested_vmx_check_exception(vcpu, &exit_qual)) {
+	    nested_vmx_check_exception(vcpu, &exit_qual)) {
 		if (block_nested_events)
 			return -EBUSY;
 		nested_vmx_inject_exception_vmexit(vcpu, exit_qual);
@@ -5742,6 +5769,9 @@ static int vmx_get_nested_state(struct k
 
 			if (vmx->nested.nested_run_pending)
 				kvm_state.flags |= KVM_STATE_NESTED_RUN_PENDING;
+
+			if (vmx->nested.mtf_pending)
+				kvm_state.flags |= KVM_STATE_NESTED_MTF_PENDING;
 		}
 	}
 
@@ -5922,6 +5952,9 @@ static int vmx_set_nested_state(struct k
 	vmx->nested.nested_run_pending =
 		!!(kvm_state->flags & KVM_STATE_NESTED_RUN_PENDING);
 
+	vmx->nested.mtf_pending =
+		!!(kvm_state->flags & KVM_STATE_NESTED_MTF_PENDING);
+
 	ret = -EINVAL;
 	if (nested_cpu_has_shadow_vmcs(vmcs12) &&
 	    vmcs12->vmcs_link_pointer != -1ull) {
arch/x86/kvm/vmx/nested.h +5 -0
@@ -176,6 +176,11 @@ static inline bool nested_cpu_has_virtua
 	return vmcs12->pin_based_vm_exec_control & PIN_BASED_VIRTUAL_NMIS;
 }
 
+static inline int nested_cpu_has_mtf(struct vmcs12 *vmcs12)
+{
+	return nested_cpu_has(vmcs12, CPU_BASED_MONITOR_TRAP_FLAG);
+}
+
 static inline int nested_cpu_has_ept(struct vmcs12 *vmcs12)
 {
 	return nested_cpu_has2(vmcs12, SECONDARY_EXEC_ENABLE_EPT);
arch/x86/kvm/vmx/vmx.c +36 -1
@@ -1595,6 +1595,40 @@ static int skip_emulated_instruction(str
 	return 1;
 }
 
+
+/*
+ * Recognizes a pending MTF VM-exit and records the nested state for later
+ * delivery.
+ */
+static void vmx_update_emulated_instruction(struct kvm_vcpu *vcpu)
+{
+	struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
+	struct vcpu_vmx *vmx = to_vmx(vcpu);
+
+	if (!is_guest_mode(vcpu))
+		return;
+
+	/*
+	 * Per the SDM, MTF takes priority over debug-trap exceptions besides
+	 * T-bit traps. As instruction emulation is completed (i.e. at the
+	 * instruction boundary), any #DB exception pending delivery must be a
+	 * debug-trap. Record the pending MTF state to be delivered in
+	 * vmx_check_nested_events().
+	 */
+	if (nested_cpu_has_mtf(vmcs12) &&
+	    (!vcpu->arch.exception.pending ||
+	     vcpu->arch.exception.nr == DB_VECTOR))
+		vmx->nested.mtf_pending = true;
+	else
+		vmx->nested.mtf_pending = false;
+}
+
+static int vmx_skip_emulated_instruction(struct kvm_vcpu *vcpu)
+{
+	vmx_update_emulated_instruction(vcpu);
+	return skip_emulated_instruction(vcpu);
+}
+
 static void vmx_clear_hlt(struct kvm_vcpu *vcpu)
 {
 	/*
@@ -7886,7 +7920,8 @@ static struct kvm_x86_ops vmx_x86_ops __
 
 	.run = vmx_vcpu_run,
 	.handle_exit = vmx_handle_exit,
-	.skip_emulated_instruction = skip_emulated_instruction,
+	.skip_emulated_instruction = vmx_skip_emulated_instruction,
+	.update_emulated_instruction = vmx_update_emulated_instruction,
 	.set_interrupt_shadow = vmx_set_interrupt_shadow,
 	.get_interrupt_shadow = vmx_get_interrupt_shadow,
 	.patch_hypercall = vmx_patch_hypercall,
arch/x86/kvm/vmx/vmx.h +3 -0
@@ -150,6 +150,9 @@ struct nested_vmx {
 	/* L2 must run next, and mustn't decide to exit to L1. */
 	bool nested_run_pending;
 
+	/* Pending MTF VM-exit into L1.  */
+	bool mtf_pending;
+
 	struct loaded_vmcs vmcs02;
 
 	/*
arch/x86/kvm/x86.c +2 -0
@@ -6838,6 +6838,8 @@ restart:
 			kvm_rip_write(vcpu, ctxt->eip);
 			if (r && ctxt->tf)
 				r = kvm_vcpu_do_singlestep(vcpu);
+			if (kvm_x86_ops->update_emulated_instruction)
+				kvm_x86_ops->update_emulated_instruction(vcpu);
 			__kvm_set_rflags(vcpu, ctxt->eflags);
 		}
 
#117 lore raw

Re: [PATCH 5.5 111/176] KVM: nVMX: Emulate MTF when performing instruction emulation

Quoted 17 lines · Paolo Bonzini
Quoted 15 lines · Greg Kroah-Hartman

From: Oliver Upton <[email protected]>

commit 5ef8acbdd687c9d72582e2c05c0b9756efb37863 upstream.

Since commit 5f3d45e7f282 ("kvm/x86: add support for MONITOR_TRAP_FLAG"), KVM has allowed an L1 guest to use the monitor trap flag processor-based execution control for its L2 guest. KVM simply forwards any MTF VM-exits to the L1 guest, which works for normal instruction execution.

However, when KVM needs to emulate an instruction on the behalf of an L2 guest, the monitor trap flag is not emulated. Add the necessary logic to kvm_skip_emulated_instruction() to synthesize an MTF VM-exit to L1 upon instruction emulation for L2.

Quoted 7 lines
Quoted 4 lines
Fixes 5f3d45e7f282 ("kvm/x86: add support for MONITOR_TRAP_FLAG")

Why is this included in a stable release? It was part of a series of four patches and the prerequisites as far as I can see are not part of 5.5.

It looks like these commits were already picked from upstream:

684c0422da71 ("KVM: nVMX: Handle pending #DB when injecting INIT VM-exit") 307f1cfa2696 ("KVM: x86: Mask off reserved bit from #DB exception payload")

Which were bug fixes in their own right and were sensible for backporting (though I didn't cc stable if I'm not mistaken).

but not:

a06230b62b89 ("KVM: x86: Deliver exception payload on KVM_GET_VCPU_EVENTS")

which this patch absolutely depends on.

Otherwise, I'll defer discussions regarding the suitability of this patch for stable to Paolo.

--
Thanks,
Oliver

Quoted 208 lines

I have already said half a dozen times that I don't want any of the autopick stuff for KVM. Is a Fixes tag sufficient to get patches into stable now?

Paolo

Quoted 201 lines
---
 arch/x86/include/asm/kvm_host.h |    1 +
 arch/x86/include/uapi/asm/kvm.h |    1 +
 arch/x86/kvm/svm.c              |    1 +
 arch/x86/kvm/vmx/nested.c       |   35 ++++++++++++++++++++++++++++++++++-
 arch/x86/kvm/vmx/nested.h       |    5 +++++
 arch/x86/kvm/vmx/vmx.c          |   37 ++++++++++++++++++++++++++++++++++++-
 arch/x86/kvm/vmx/vmx.h          |    3 +++
 arch/x86/kvm/x86.c              |    2 ++
 8 files changed, 83 insertions(+), 2 deletions(-)
arch/x86/include/asm/kvm_host.h +1 -0
@@ -1092,6 +1092,7 @@ struct kvm_x86_ops {
      void (*run)(struct kvm_vcpu *vcpu);
      int (*handle_exit)(struct kvm_vcpu *vcpu);
      int (*skip_emulated_instruction)(struct kvm_vcpu *vcpu);
+     void (*update_emulated_instruction)(struct kvm_vcpu *vcpu);
      void (*set_interrupt_shadow)(struct kvm_vcpu *vcpu, int mask);
      u32 (*get_interrupt_shadow)(struct kvm_vcpu *vcpu);
      void (*patch_hypercall)(struct kvm_vcpu *vcpu,
arch/x86/include/uapi/asm/kvm.h +1 -0
@@ -390,6 +390,7 @@ struct kvm_sync_regs {
 #define KVM_STATE_NESTED_GUEST_MODE  0x00000001
 #define KVM_STATE_NESTED_RUN_PENDING 0x00000002
 #define KVM_STATE_NESTED_EVMCS               0x00000004
+#define KVM_STATE_NESTED_MTF_PENDING 0x00000008
 
 #define KVM_STATE_NESTED_SMM_GUEST_MODE      0x00000001
 #define KVM_STATE_NESTED_SMM_VMXON   0x00000002
arch/x86/kvm/svm.c +1 -0
@@ -7311,6 +7311,7 @@ static struct kvm_x86_ops svm_x86_ops __
      .run = svm_vcpu_run,
      .handle_exit = handle_exit,
      .skip_emulated_instruction = skip_emulated_instruction,
+     .update_emulated_instruction = NULL,
      .set_interrupt_shadow = svm_set_interrupt_shadow,
      .get_interrupt_shadow = svm_get_interrupt_shadow,
      .patch_hypercall = svm_patch_hypercall,
arch/x86/kvm/vmx/nested.c +34 -1
@@ -3616,8 +3616,15 @@ static int vmx_check_nested_events(struc
      unsigned long exit_qual;
      bool block_nested_events =
          vmx->nested.nested_run_pending || kvm_event_needs_reinjection(vcpu);
+     bool mtf_pending = vmx->nested.mtf_pending;
      struct kvm_lapic *apic = vcpu->arch.apic;
 
+     /*
+      * Clear the MTF state. If a higher priority VM-exit is delivered first,
+      * this state is discarded.
+      */
+     vmx->nested.mtf_pending = false;
+
      if (lapic_in_kernel(vcpu) &&
              test_bit(KVM_APIC_INIT, &apic->pending_events)) {
              if (block_nested_events)
@@ -3628,8 +3635,28 @@ static int vmx_check_nested_events(struc
              return 0;
      }
 
+     /*
+      * Process any exceptions that are not debug traps before MTF.
+      */
+     if (vcpu->arch.exception.pending &&
+         !vmx_pending_dbg_trap(vcpu) &&
+         nested_vmx_check_exception(vcpu, &exit_qual)) {
+             if (block_nested_events)
+                     return -EBUSY;
+             nested_vmx_inject_exception_vmexit(vcpu, exit_qual);
+             return 0;
+     }
+
+     if (mtf_pending) {
+             if (block_nested_events)
+                     return -EBUSY;
+             nested_vmx_update_pending_dbg(vcpu);
+             nested_vmx_vmexit(vcpu, EXIT_REASON_MONITOR_TRAP_FLAG, 0, 0);
+             return 0;
+     }
+
      if (vcpu->arch.exception.pending &&
-             nested_vmx_check_exception(vcpu, &exit_qual)) {
+         nested_vmx_check_exception(vcpu, &exit_qual)) {
              if (block_nested_events)
                      return -EBUSY;
              nested_vmx_inject_exception_vmexit(vcpu, exit_qual);
@@ -5742,6 +5769,9 @@ static int vmx_get_nested_state(struct k
 
                      if (vmx->nested.nested_run_pending)
                              kvm_state.flags |= KVM_STATE_NESTED_RUN_PENDING;
+
+                     if (vmx->nested.mtf_pending)
+                             kvm_state.flags |= KVM_STATE_NESTED_MTF_PENDING;
              }
      }
 
@@ -5922,6 +5952,9 @@ static int vmx_set_nested_state(struct k
      vmx->nested.nested_run_pending =
              !!(kvm_state->flags & KVM_STATE_NESTED_RUN_PENDING);
 
+     vmx->nested.mtf_pending =
+             !!(kvm_state->flags & KVM_STATE_NESTED_MTF_PENDING);
+
      ret = -EINVAL;
      if (nested_cpu_has_shadow_vmcs(vmcs12) &&
          vmcs12->vmcs_link_pointer != -1ull) {
arch/x86/kvm/vmx/nested.h +5 -0
@@ -176,6 +176,11 @@ static inline bool nested_cpu_has_virtua
      return vmcs12->pin_based_vm_exec_control & PIN_BASED_VIRTUAL_NMIS;
 }
 
+static inline int nested_cpu_has_mtf(struct vmcs12 *vmcs12)
+{
+     return nested_cpu_has(vmcs12, CPU_BASED_MONITOR_TRAP_FLAG);
+}
+
 static inline int nested_cpu_has_ept(struct vmcs12 *vmcs12)
 {
      return nested_cpu_has2(vmcs12, SECONDARY_EXEC_ENABLE_EPT);
arch/x86/kvm/vmx/vmx.c +36 -1
@@ -1595,6 +1595,40 @@ static int skip_emulated_instruction(str
      return 1;
 }
 
+
+/*
+ * Recognizes a pending MTF VM-exit and records the nested state for later
+ * delivery.
+ */
+static void vmx_update_emulated_instruction(struct kvm_vcpu *vcpu)
+{
+     struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
+     struct vcpu_vmx *vmx = to_vmx(vcpu);
+
+     if (!is_guest_mode(vcpu))
+             return;
+
+     /*
+      * Per the SDM, MTF takes priority over debug-trap exceptions besides
+      * T-bit traps. As instruction emulation is completed (i.e. at the
+      * instruction boundary), any #DB exception pending delivery must be a
+      * debug-trap. Record the pending MTF state to be delivered in
+      * vmx_check_nested_events().
+      */
+     if (nested_cpu_has_mtf(vmcs12) &&
+         (!vcpu->arch.exception.pending ||
+          vcpu->arch.exception.nr == DB_VECTOR))
+             vmx->nested.mtf_pending = true;
+     else
+             vmx->nested.mtf_pending = false;
+}
+
+static int vmx_skip_emulated_instruction(struct kvm_vcpu *vcpu)
+{
+     vmx_update_emulated_instruction(vcpu);
+     return skip_emulated_instruction(vcpu);
+}
+
 static void vmx_clear_hlt(struct kvm_vcpu *vcpu)
 {
      /*
@@ -7886,7 +7920,8 @@ static struct kvm_x86_ops vmx_x86_ops __
 
      .run = vmx_vcpu_run,
      .handle_exit = vmx_handle_exit,
-     .skip_emulated_instruction = skip_emulated_instruction,
+     .skip_emulated_instruction = vmx_skip_emulated_instruction,
+     .update_emulated_instruction = vmx_update_emulated_instruction,
      .set_interrupt_shadow = vmx_set_interrupt_shadow,
      .get_interrupt_shadow = vmx_get_interrupt_shadow,
      .patch_hypercall = vmx_patch_hypercall,
arch/x86/kvm/vmx/vmx.h +3 -0
@@ -150,6 +150,9 @@ struct nested_vmx {
      /* L2 must run next, and mustn't decide to exit to L1. */
      bool nested_run_pending;
 
+     /* Pending MTF VM-exit into L1.  */
+     bool mtf_pending;
+
      struct loaded_vmcs vmcs02;
 
      /*
arch/x86/kvm/x86.c +2 -0
@@ -6838,6 +6838,8 @@ restart:
                      kvm_rip_write(vcpu, ctxt->eip);
                      if (r && ctxt->tf)
                              r = kvm_vcpu_do_singlestep(vcpu);
+                     if (kvm_x86_ops->update_emulated_instruction)
+                             kvm_x86_ops->update_emulated_instruction(vcpu);
                      __kvm_set_rflags(vcpu, ctxt->eflags);
              }
 
author maintainer
#118 lore raw

Re: [PATCH 5.5 111/176] KVM: nVMX: Emulate MTF when performing instruction emulation

Quoted 34 lines · Oliver Upton
Quoted 17 lines · Paolo Bonzini
Quoted 15 lines · Greg Kroah-Hartman

From: Oliver Upton <[email protected]>

commit 5ef8acbdd687c9d72582e2c05c0b9756efb37863 upstream.

Since commit 5f3d45e7f282 ("kvm/x86: add support for MONITOR_TRAP_FLAG"), KVM has allowed an L1 guest to use the monitor trap flag processor-based execution control for its L2 guest. KVM simply forwards any MTF VM-exits to the L1 guest, which works for normal instruction execution.

However, when KVM needs to emulate an instruction on the behalf of an L2 guest, the monitor trap flag is not emulated. Add the necessary logic to kvm_skip_emulated_instruction() to synthesize an MTF VM-exit to L1 upon instruction emulation for L2.

Quoted 7 lines
Quoted 4 lines
Fixes 5f3d45e7f282 ("kvm/x86: add support for MONITOR_TRAP_FLAG")

Why is this included in a stable release? It was part of a series of four patches and the prerequisites as far as I can see are not part of 5.5.

It looks like these commits were already picked from upstream:

684c0422da71 ("KVM: nVMX: Handle pending #DB when injecting INIT VM-exit") 307f1cfa2696 ("KVM: x86: Mask off reserved bit from #DB exception payload")

Which were bug fixes in their own right and were sensible for backporting (though I didn't cc stable if I'm not mistaken).

Quoted 8 lines

but not:

a06230b62b89 ("KVM: x86: Deliver exception payload on KVM_GET_VCPU_EVENTS")

which this patch absolutely depends on.

Otherwise, I'll defer discussions regarding the suitability of this patch for stable to Paolo.

I picked this patch up solely because of the Fixes: tag showed that this ommit resolved something from a previous commit. The interdependancies were not obvious, especially as it all seemed to build just fine here.

Quoted 3 lines
Quoted 3 lines

I have already said half a dozen times that I don't want any of the autopick stuff for KVM. Is a Fixes tag sufficient to get patches into stable now?

Yes, it can happen that a Fixes tag does cause a patch to get into stable because I look out for that. I do that because a number of maintainers/developers only put that tag in there, and also to catch patches for when we backport stuff and then need to take a fix for that backport (not the case here though).

I'll be glad to just put KVM into the "never apply any patches to stable unless you explicitly mark it as such", but the sad fact is that many recent KVM fixes for reported CVEs never had any "Cc: stable@vger" markings. They only had "Fixes:" tags and so I have had to dig them out of the tree and backport them myself in order to resolve those very public issues.

So can I ask that you always properly tag things for stable? If so, I will be glad to ignore Fixes: tags for KVM patches in the future.

I'll go drop this patch as well. Note, there are other KVM patches in this release cycle also, can someone verify that I did not overreach for them as well?

thanks,

greg k-h

author maintainer
#193 lore raw
In reply to Naresh Kamboju
Quoted 32 lines · Naresh Kamboju
Quoted 10 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.5.8 release. There are 176 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Thu, 05 Mar 2020 17:42:06 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 9 lines
        https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.5.8-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.5.y
and the diffstat can be found below.

thanks,

greg k-h

Results from Linaro’s test farm.
Regressions detected on x86_64 and i386.

Test failure output:
CVE-2017-5715: VULN (IBRS+IBPB or retpoline+IBPB+RSB filling, is needed to mitigate the vulnerability)

Test description:
CVE-2017-5715 branch target injection (Spectre Variant 2)

Quoted 8 lines

Impact: Kernel
Mitigation 1: new opcode via microcode update that should be used by up to date compilers to protect the BTB (by flushing indirect branch predictors)
Mitigation 2: introducing "retpoline" into compilers, and recompile software/OS with it
Performance impact of the mitigation: high for mitigation 1, medium for mitigation 2, depending on your CPU

So these are regressions or just new tests?

If regressions, can you do 'git bisect' to find the offending commit?

Also, are you sure you have an updated microcode on these machines and a proper compiler for retpoline?

thanks,

greg k-h

#119 lore raw

Re: [PATCH 5.5 111/176] KVM: nVMX: Emulate MTF when performing instruction emulation

In reply to Greg Kroah-Hartman
Quoted 4 lines · Greg Kroah-Hartman

I'll be glad to just put KVM into the "never apply any patches to stable unless you explicitly mark it as such", but the sad fact is that many recent KVM fixes for reported CVEs never had any "Cc: stable@vger" markings.

Hmm, I did miss it in 433f4ba1904100da65a311033f17a9bf586b287e and acff78477b9b4f26ecdf65733a4ed77fe837e9dc, but that's going back to August 2018, so I can do better but it's not too shabby a record. :)

Quoted 10 lines

They only had "Fixes:" tags and so I have had to dig them out of the tree and backport them myself in order to resolve those very public issues.

So can I ask that you always properly tag things for stable? If so, I will be glad to ignore Fixes: tags for KVM patches in the future.

I'll go drop this patch as well. Note, there are other KVM patches in this release cycle also, can someone verify that I did not overreach for them as well?

I checked them and they are fine.

Paolo

author maintainer
#120 lore raw

Re: [PATCH 5.5 111/176] KVM: nVMX: Emulate MTF when performing instruction emulation

Quoted 9 lines · Paolo Bonzini
Quoted 4 lines · Greg Kroah-Hartman

I'll be glad to just put KVM into the "never apply any patches to stable unless you explicitly mark it as such", but the sad fact is that many recent KVM fixes for reported CVEs never had any "Cc: stable@vger" markings.

Hmm, I did miss it in 433f4ba1904100da65a311033f17a9bf586b287e and acff78477b9b4f26ecdf65733a4ed77fe837e9dc, but that's going back to August 2018, so I can do better but it's not too shabby a record. :)

35a571346a94 ("KVM: nVMX: Check IO instruction VM-exit conditions") e71237d3ff1a ("KVM: nVMX: Refactor IO bitmap checks into helper function")

Were both from a few weeks ago and needed to resolve CVE-2020-2732 :(

Quoted 4 lines
Quoted 4 lines

They only had "Fixes:" tags and so I have had to dig them out of the tree and backport them myself in order to resolve those very public issues.

Quoted 8 lines
Quoted 6 lines

So can I ask that you always properly tag things for stable? If so, I will be glad to ignore Fixes: tags for KVM patches in the future.

I'll go drop this patch as well. Note, there are other KVM patches in this release cycle also, can someone verify that I did not overreach for them as well?

I checked them and they are fine.

Thank you for that.

greg k-h

#121 lore raw

Re: [PATCH 5.5 111/176] KVM: nVMX: Emulate MTF when performing instruction emulation

Quoted 7 lines · Greg Kroah-Hartman
Quoted 6 lines · Paolo Bonzini
Quoted 4 lines · Greg Kroah-Hartman

I'll be glad to just put KVM into the "never apply any patches to stable unless you explicitly mark it as such", but the sad fact is that many recent KVM fixes for reported CVEs never had any "Cc: stable@vger" markings.

Quoted 8 lines
Quoted 3 lines

Hmm, I did miss it in 433f4ba1904100da65a311033f17a9bf586b287e and acff78477b9b4f26ecdf65733a4ed77fe837e9dc, but that's going back to August 2018, so I can do better but it's not too shabby a record. :)

35a571346a94 ("KVM: nVMX: Check IO instruction VM-exit conditions") e71237d3ff1a ("KVM: nVMX: Refactor IO bitmap checks into helper function")

Were both from a few weeks ago and needed to resolve CVE-2020-2732 :(

No, they weren't, only the patch that was CCed stable was needed to resolve the CVE.

Remember that at this point a lot of bugfixes or vulnerabilities in KVM exploit corner cases of the architecture and don't show up with the usual guests (Linux, Windows, BSDs). Since we didn't have full information on the impact on guests that people do run, we started with the bare minimum (the two patches above) but only for 5.6. The idea was to collect follow-up patches for 2-4 weeks, decide which subset was stable-worthy, and only then post them as stable backport subsets.

Paolo

author maintainer
#194 lore raw
In reply to Greg Kroah-Hartman
Quoted 42 lines · Greg Kroah-Hartman
Quoted 32 lines · Naresh Kamboju
Quoted 10 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.5.8 release. There are 176 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Thu, 05 Mar 2020 17:42:06 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 9 lines
        https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.5.8-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.5.y
and the diffstat can be found below.

thanks,

greg k-h

Results from Linaro’s test farm.
Regressions detected on x86_64 and i386.

Test failure output:
CVE-2017-5715: VULN (IBRS+IBPB or retpoline+IBPB+RSB filling, is needed to mitigate the vulnerability)

Test description:
CVE-2017-5715 branch target injection (Spectre Variant 2)

Quoted 8 lines

Impact: Kernel
Mitigation 1: new opcode via microcode update that should be used by up to date compilers to protect the BTB (by flushing indirect branch predictors)
Mitigation 2: introducing "retpoline" into compilers, and recompile software/OS with it
Performance impact of the mitigation: high for mitigation 1, medium for mitigation 2, depending on your CPU

Quoted 6 lines

So these are regressions or just new tests?

If regressions, can you do 'git bisect' to find the offending commit?

Also, are you sure you have an updated microcode on these machines and a proper compiler for retpoline?

As an example of just how crazy that script is, here's the output of my machine for that first CVE issue:

CVE-2017-5715 aka 'Spectre Variant 2, branch target injection'
* Mitigated according to the /sys interface: YES (Mitigation: Full generic retpoline, IBPB: conditional, IBRS_FW, STIBP: conditional, RSB filling)
* Mitigation 1
* Kernel is compiled with IBRS support: YES
* IBRS enabled and active: YES (for firmware code only)
* Kernel is compiled with IBPB support: YES
* IBPB enabled and active: YES
* Mitigation 2
* Kernel has branch predictor hardening (arm): NO
* Kernel compiled with retpoline option: YES
* Kernel compiled with a retpoline-aware compiler: YES (kernel reports full retpoline compilation)
* Kernel supports RSB filling: UNKNOWN (couldn't check (couldn't find your kernel image in /boot, if you used netboot, this is normal))

Quoted 1 line

STATUS: VULNERABLE (IBRS+IBPB or retpoline+IBPB+RSB filling, is needed to mitigate

So why is this "Vulnerable"? Because it didn't think it could find my kernel image for some odd reason, despite it really being in /boot/ (I don't use netboot)

So please verify that this really is a real issue, and not just the script doing foolish things.

thanks,

greg k-h

author maintainer
#195 lore raw
Quoted 65 lines · Greg Kroah-Hartman
Quoted 42 lines · Greg Kroah-Hartman
Quoted 32 lines · Naresh Kamboju
Quoted 10 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.5.8 release. There are 176 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Thu, 05 Mar 2020 17:42:06 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 9 lines
        https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.5.8-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.5.y
and the diffstat can be found below.

thanks,

greg k-h

Results from Linaro’s test farm.
Regressions detected on x86_64 and i386.

Test failure output:
CVE-2017-5715: VULN (IBRS+IBPB or retpoline+IBPB+RSB filling, is needed to mitigate the vulnerability)

Test description:
CVE-2017-5715 branch target injection (Spectre Variant 2)

Quoted 8 lines

Impact: Kernel
Mitigation 1: new opcode via microcode update that should be used by up to date compilers to protect the BTB (by flushing indirect branch predictors)
Mitigation 2: introducing "retpoline" into compilers, and recompile software/OS with it
Performance impact of the mitigation: high for mitigation 1, medium for mitigation 2, depending on your CPU

Quoted 6 lines

So these are regressions or just new tests?

If regressions, can you do 'git bisect' to find the offending commit?

Also, are you sure you have an updated microcode on these machines and a proper compiler for retpoline?

As an example of just how crazy that script is, here's the output of my machine for that first CVE issue:

CVE-2017-5715 aka 'Spectre Variant 2, branch target injection'
* Mitigated according to the /sys interface: YES (Mitigation: Full generic retpoline, IBPB: conditional, IBRS_FW, STIBP: conditional, RSB filling)
* Mitigation 1
* Kernel is compiled with IBRS support: YES
* IBRS enabled and active: YES (for firmware code only)
* Kernel is compiled with IBPB support: YES
* IBPB enabled and active: YES
* Mitigation 2
* Kernel has branch predictor hardening (arm): NO
* Kernel compiled with retpoline option: YES
* Kernel compiled with a retpoline-aware compiler: YES (kernel reports full retpoline compilation)
* Kernel supports RSB filling: UNKNOWN (couldn't check (couldn't find your kernel image in /boot, if you used netboot, this is normal))

Quoted 8 lines
Quoted 1 line

STATUS: VULNERABLE (IBRS+IBPB or retpoline+IBPB+RSB filling, is needed to mitigate

So why is this "Vulnerable"? Because it didn't think it could find my kernel image for some odd reason, despite it really being in /boot/ (I don't use netboot)

So please verify that this really is a real issue, and not just the script doing foolish things.

And, if I tell the script where my kernel image is, suddenly all is good:

CVE-2017-5715 aka 'Spectre Variant 2, branch target injection'
* Mitigation 1
* Kernel is compiled with IBRS support: YES
* IBRS enabled and active: N/A (not testable in offline mode)
* Kernel is compiled with IBPB support: YES
* IBPB enabled and active: N/A (not testable in offline mode)
* Mitigation 2
* Kernel has branch predictor hardening (arm): UNKNOWN
* Kernel compiled with retpoline option: UNKNOWN (couldn't read your kernel configuration)
* Kernel supports RSB filling: YES

Quoted 1 line

STATUS: NOT VULNERABLE (offline mode: kernel supports IBRS + IBPB to mitigate the vulnerability)

author maintainer
#122 lore raw

Re: [PATCH 5.5 111/176] KVM: nVMX: Emulate MTF when performing instruction emulation

In reply to Paolo Bonzini
Quoted 12 lines · Paolo Bonzini
Quoted 11 lines · Greg Kroah-Hartman
Quoted 9 lines · Paolo Bonzini
Quoted 4 lines · Greg Kroah-Hartman

I'll be glad to just put KVM into the "never apply any patches to stable unless you explicitly mark it as such", but the sad fact is that many recent KVM fixes for reported CVEs never had any "Cc: stable@vger" markings.

Hmm, I did miss it in 433f4ba1904100da65a311033f17a9bf586b287e and acff78477b9b4f26ecdf65733a4ed77fe837e9dc, but that's going back to August 2018, so I can do better but it's not too shabby a record. :)

Quoted 7 lines
Quoted 4 lines

35a571346a94 ("KVM: nVMX: Check IO instruction VM-exit conditions") e71237d3ff1a ("KVM: nVMX: Refactor IO bitmap checks into helper function")

Were both from a few weeks ago and needed to resolve CVE-2020-2732 :(

No, they weren't, only the patch that was CCed stable was needed to resolve the CVE.

Ah, that's not what was posted to oss-security :(

Quoted 7 lines

Remember that at this point a lot of bugfixes or vulnerabilities in KVM exploit corner cases of the architecture and don't show up with the usual guests (Linux, Windows, BSDs). Since we didn't have full information on the impact on guests that people do run, we started with the bare minimum (the two patches above) but only for 5.6. The idea was to collect follow-up patches for 2-4 weeks, decide which subset was stable-worthy, and only then post them as stable backport subsets.

Ok, that's fine, but it would be good if someone told me about this so that I knew what was going on when people asked me about this type of thing :)

thanks,

greg k-h

#196 lore raw
In reply to Greg Kroah-Hartman
Quoted 67 lines · Greg Kroah-Hartman
Quoted 65 lines · Greg Kroah-Hartman
Quoted 42 lines · Greg Kroah-Hartman
Quoted 32 lines · Naresh Kamboju
Quoted 10 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.5.8 release. There are 176 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Thu, 05 Mar 2020 17:42:06 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 9 lines
        https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.5.8-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.5.y
and the diffstat can be found below.

thanks,

greg k-h

Results from Linaro’s test farm.
Regressions detected on x86_64 and i386.

Test failure output:
CVE-2017-5715: VULN (IBRS+IBPB or retpoline+IBPB+RSB filling, is needed to mitigate the vulnerability)

Test description:
CVE-2017-5715 branch target injection (Spectre Variant 2)

Quoted 8 lines

Impact: Kernel
Mitigation 1: new opcode via microcode update that should be used by up to date compilers to protect the BTB (by flushing indirect branch predictors)
Mitigation 2: introducing "retpoline" into compilers, and recompile software/OS with it
Performance impact of the mitigation: high for mitigation 1, medium for mitigation 2, depending on your CPU

Quoted 6 lines

So these are regressions or just new tests?

If regressions, can you do 'git bisect' to find the offending commit?

Also, are you sure you have an updated microcode on these machines and a proper compiler for retpoline?

As an example of just how crazy that script is, here's the output of my machine for that first CVE issue:

CVE-2017-5715 aka 'Spectre Variant 2, branch target injection'
* Mitigated according to the /sys interface: YES (Mitigation: Full generic retpoline, IBPB: conditional, IBRS_FW, STIBP: conditional, RSB filling)
* Mitigation 1
* Kernel is compiled with IBRS support: YES
* IBRS enabled and active: YES (for firmware code only)
* Kernel is compiled with IBPB support: YES
* IBPB enabled and active: YES
* Mitigation 2
* Kernel has branch predictor hardening (arm): NO
* Kernel compiled with retpoline option: YES
* Kernel compiled with a retpoline-aware compiler: YES (kernel reports full retpoline compilation)
* Kernel supports RSB filling: UNKNOWN (couldn't check (couldn't find your kernel image in /boot, if you used netboot, this is normal))

Quoted 5 lines
Quoted 5 lines
Quoted 1 line

STATUS: VULNERABLE (IBRS+IBPB or retpoline+IBPB+RSB filling, is needed to mitigate

So why is this "Vulnerable"? Because it didn't think it could find my kernel image for some odd reason, despite it really being in /boot/ (I don't use netboot)

Now I know the real reason why this test failed. With this note we can conclude this is not a regression.

No regressions on arm64, arm, x86_64, and i386 for 4.19, 5.4 and 5.5 branches.

Sorry for the noise.

Signature · 2 lines
Linaro LKFT
https://lkft.linaro.org
author maintainer
#197 lore raw
Quoted 71 lines · Naresh Kamboju
Quoted 69 lines · Greg Kroah-Hartman
Quoted 67 lines · Greg Kroah-Hartman
Quoted 42 lines · Greg Kroah-Hartman
Quoted 32 lines · Naresh Kamboju
Quoted 10 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.5.8 release. There are 176 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Thu, 05 Mar 2020 17:42:06 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 9 lines
        https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.5.8-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.5.y
and the diffstat can be found below.

thanks,

greg k-h

Results from Linaro’s test farm.
Regressions detected on x86_64 and i386.

Test failure output:
CVE-2017-5715: VULN (IBRS+IBPB or retpoline+IBPB+RSB filling, is needed to mitigate the vulnerability)

Test description:
CVE-2017-5715 branch target injection (Spectre Variant 2)

Quoted 8 lines

Impact: Kernel
Mitigation 1: new opcode via microcode update that should be used by up to date compilers to protect the BTB (by flushing indirect branch predictors)
Mitigation 2: introducing "retpoline" into compilers, and recompile software/OS with it
Performance impact of the mitigation: high for mitigation 1, medium for mitigation 2, depending on your CPU

Quoted 6 lines

So these are regressions or just new tests?

If regressions, can you do 'git bisect' to find the offending commit?

Also, are you sure you have an updated microcode on these machines and a proper compiler for retpoline?

As an example of just how crazy that script is, here's the output of my machine for that first CVE issue:

CVE-2017-5715 aka 'Spectre Variant 2, branch target injection'
* Mitigated according to the /sys interface: YES (Mitigation: Full generic retpoline, IBPB: conditional, IBRS_FW, STIBP: conditional, RSB filling)
* Mitigation 1
* Kernel is compiled with IBRS support: YES
* IBRS enabled and active: YES (for firmware code only)
* Kernel is compiled with IBPB support: YES
* IBPB enabled and active: YES
* Mitigation 2
* Kernel has branch predictor hardening (arm): NO
* Kernel compiled with retpoline option: YES
* Kernel compiled with a retpoline-aware compiler: YES (kernel reports full retpoline compilation)
* Kernel supports RSB filling: UNKNOWN (couldn't check (couldn't find your kernel image in /boot, if you used netboot, this is normal))

Quoted 1 line

STATUS: VULNERABLE (IBRS+IBPB or retpoline+IBPB+RSB filling, is needed to mitigate

Quoted 8 lines
Quoted 3 lines
Quoted 3 lines

So why is this "Vulnerable"? Because it didn't think it could find my kernel image for some odd reason, despite it really being in /boot/ (I don't use netboot)

Now I know the real reason why this test failed. With this note we can conclude this is not a regression.

No regressions on arm64, arm, x86_64, and i386 for 4.19, 5.4 and 5.5 branches.

Great, thanks for confirming and for testing all of these.

greg k-h

#198 lore raw
Quoted 11 lines · Greg Kroah-Hartman
Quoted 8 lines · Naresh Kamboju
Quoted 3 lines
Quoted 3 lines

So why is this "Vulnerable"? Because it didn't think it could find my kernel image for some odd reason, despite it really being in /boot/ (I don't use netboot)

Now I know the real reason why this test failed. With this note we can conclude this is not a regression.

No regressions on arm64, arm, x86_64, and i386 for 4.19, 5.4 and 5.5 branches.

Great, thanks for confirming and for testing all of these.

We originally added spectre-meltdown-checker to lkft for informational purposes, so that we could compare its report to any actual tests that produce spectre/meltdown related failures (and help determine if the problem is hardware/firmware or kernel). In practice, it's never been helpful (because it's not an actual test) and so we'll be removing it from LKFT.

Dan

Quoted 2 lines

greg k-h

Signature · 2 lines
Linaro LKFT
https://lkft.linaro.org
#199 lore raw
In reply to Greg Kroah-Hartman
Quoted 8 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.5.8 release. There are 176 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Thu, 05 Mar 2020 17:42:06 +0000. Anything received after that time might be too late.

Build results:

	total: 157 pass: 157 fail: 0
Qemu test results:
	total: 423 pass: 423 fail: 0

Guenter

author maintainer
#200 lore raw
Quoted 6 lines · Guenter Roeck
Quoted 5 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.5.8 release. There are 176 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Quoted 8 lines
Quoted 3 lines

Responses should be made by Thu, 05 Mar 2020 17:42:06 +0000. Anything received after that time might be too late.

Build results:

	total: 157 pass: 157 fail: 0
Qemu test results:
	total: 423 pass: 423 fail: 0

Wonderful, thanks for testing these and letting me konw.

greg k-h

#113 lore raw

AW: [PATCH 5.5 110/176] MIPS: VPE: Fix a double free and a memory leak in release_vpe()

In reply to Greg Kroah-Hartman

________________________________________
Von: [email protected] <[email protected]> im Auftrag von Greg Kroah-Hartman <[email protected]>
Gesendet: Dienstag, 3. März 2020 18:42
An: [email protected]
Cc: Greg Kroah-Hartman; [email protected]; Christophe JAILLET; Paul Burton; [email protected]; [email protected]; [email protected]
Betreff: [PATCH 5.5 110/176] MIPS: VPE: Fix a double free and a memory leak in release_vpe()

From: Christophe JAILLET <[email protected]>

commit bef8e2dfceed6daeb6ca3e8d33f9c9d43b926580 upstream.

Pointer on the memory allocated by 'alloc_progmem()' is stored in 'v->load_addr'. So this is this memory that should be freed by 'release_progmem()'.

'release_progmem()' is only a call to 'kfree()'.

With the current code, there is both a double free and a memory leak. Fix it by passing the correct pointer to 'release_progmem()'.

Fixes e01402b115ccc ("More AP / SP bits for the 34K, the Malta bits and things. Still wants")
---
 arch/mips/kernel/vpe.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/kernel/vpe.c +1 -1
@@ -134,7 +134,7 @@ void release_vpe(struct vpe *v)
 {
        list_del(&v->list);
        if (v->load_addr)
-               release_progmem(v);
+               release_progmem(v->load_addr);
        kfree(v);
 }
 

since release_progmem() is kfree() it is also possible to drop "if (v->load_addr)"

jm2c

re,
wh

#114 lore raw

Re: AW: [PATCH 5.5 110/176] MIPS: VPE: Fix a double free and a memory leak in release_vpe()

Le 04/03/2020 à 22:28, Walter Harms a écrit :

Quoted 45 lines

________________________________________
Von: [email protected] <[email protected]> im Auftrag von Greg Kroah-Hartman <[email protected]>
Gesendet: Dienstag, 3. März 2020 18:42
An: [email protected]
Cc: Greg Kroah-Hartman; [email protected]; Christophe JAILLET; Paul Burton; [email protected]; [email protected]; [email protected]
Betreff: [PATCH 5.5 110/176] MIPS: VPE: Fix a double free and a memory leak in release_vpe()

From: Christophe JAILLET <[email protected]>

commit bef8e2dfceed6daeb6ca3e8d33f9c9d43b926580 upstream.

Pointer on the memory allocated by 'alloc_progmem()' is stored in 'v->load_addr'. So this is this memory that should be freed by 'release_progmem()'.

'release_progmem()' is only a call to 'kfree()'.

With the current code, there is both a double free and a memory leak. Fix it by passing the correct pointer to 'release_progmem()'.

Fixes e01402b115ccc ("More AP / SP bits for the 34K, the Malta bits and things. Still wants")
---
  arch/mips/kernel/vpe.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/kernel/vpe.c +1 -1
@@ -134,7 +134,7 @@ void release_vpe(struct vpe *v)
  {
         list_del(&v->list);
         if (v->load_addr)
-               release_progmem(v);
+               release_progmem(v->load_addr);
         kfree(v);
  }
 
Quoted 6 lines

since release_progmem() is kfree() it is also possible to drop "if (v->load_addr)"

jm2c

re,
wh

Agreed.

My patch had the following comment after the patch description:
---
The 'if (v->load_addr)' looks also redundant, but, well, the code is old and I feel lazy tonight to send another patch for only that.
---

git log shows nearly no update since end of 2015, so I kept my proposal as minimal :)

CJ