linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 5.10 00/29] 5.10.18-rc1 review
@ 2021-02-22 12:12 Greg Kroah-Hartman
  2021-02-22 12:12 ` [PATCH 5.10 01/29] vdpa_sim: remove hard-coded virtq count Greg Kroah-Hartman
                   ` (34 more replies)
  0 siblings, 35 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, torvalds, akpm, linux, shuah, patches,
	lkft-triage, pavel, jonathanh, stable

This is the start of the stable review cycle for the 5.10.18 release.
There are 29 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 Wed, 24 Feb 2021 12:07:46 +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.10.18-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.10.y
and the diffstat can be found below.

thanks,

greg k-h

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

Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Linux 5.10.18-rc1

Matwey V. Kornilov <matwey@sai.msu.ru>
    media: pwc: Use correct device for DMA

Filipe Manana <fdmanana@suse.com>
    btrfs: fix crash after non-aligned direct IO write with O_DSYNC

David Sterba <dsterba@suse.com>
    btrfs: fix backport of 2175bf57dc952 in 5.10.13

Trent Piepho <tpiepho@gmail.com>
    Bluetooth: btusb: Always fallback to alt 1 for WBS

Linus Torvalds <torvalds@linux-foundation.org>
    tty: protect tty_write from odd low-level tty disciplines

Jan Beulich <jbeulich@suse.com>
    xen-blkback: fix error handling in xen_blkbk_map()

Jan Beulich <jbeulich@suse.com>
    xen-scsiback: don't "handle" error by BUG()

Jan Beulich <jbeulich@suse.com>
    xen-netback: don't "handle" error by BUG()

Jan Beulich <jbeulich@suse.com>
    xen-blkback: don't "handle" error by BUG()

Stefano Stabellini <stefano.stabellini@xilinx.com>
    xen/arm: don't ignore return errors from set_phys_to_machine

Jan Beulich <jbeulich@suse.com>
    Xen/gntdev: correct error checking in gntdev_map_grant_pages()

Jan Beulich <jbeulich@suse.com>
    Xen/gntdev: correct dev_bus_addr handling in gntdev_map_grant_pages()

Jan Beulich <jbeulich@suse.com>
    Xen/x86: also check kernel mapping in set_foreign_p2m_mapping()

Jan Beulich <jbeulich@suse.com>
    Xen/x86: don't bail early from clear_foreign_p2m_mapping()

Yonatan Linik <yonatanlinik@gmail.com>
    net: fix proc_fs init handling in af_packet and tls

Wang Hai <wanghai38@huawei.com>
    net: bridge: Fix a warning when del bridge sysfs

Eelco Chaudron <echaudro@redhat.com>
    net: openvswitch: fix TTL decrement exception action execution

Pablo Neira Ayuso <pablo@netfilter.org>
    net: sched: incorrect Kconfig dependencies on Netfilter modules

Lorenzo Bianconi <lorenzo@kernel.org>
    mt76: mt7615: fix rdd mcu cmd endianness

Felix Fietkau <nbd@nbd.name>
    mt76: mt7915: fix endian issues

wenxu <wenxu@ucloud.cn>
    net/sched: fix miss init the mru in qdisc_skb_cb

Florian Westphal <fw@strlen.de>
    mptcp: skip to next candidate if subflow has unacked data

Loic Poulain <loic.poulain@linaro.org>
    net: qrtr: Fix port ID for control messages

Max Gurtovoy <mgurtovoy@nvidia.com>
    IB/isert: add module param to set sg_tablesize for IO cmd

Stefano Garzarella <sgarzare@redhat.com>
    vdpa_sim: add get_config callback in vdpasim_dev_attr

Stefano Garzarella <sgarzare@redhat.com>
    vdpa_sim: make 'config' generic and usable for any device type

Stefano Garzarella <sgarzare@redhat.com>
    vdpa_sim: store parsed MAC address in a buffer

Stefano Garzarella <sgarzare@redhat.com>
    vdpa_sim: add struct vdpasim_dev_attr for device attributes

Max Gurtovoy <mgurtovoy@nvidia.com>
    vdpa_sim: remove hard-coded virtq count


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

Diffstat:

 Makefile                                        |  4 +-
 arch/arm/xen/p2m.c                              |  6 +-
 arch/x86/xen/p2m.c                              | 15 ++---
 drivers/block/xen-blkback/blkback.c             | 32 +++++----
 drivers/bluetooth/btusb.c                       | 20 ++----
 drivers/infiniband/ulp/isert/ib_isert.c         | 27 +++++++-
 drivers/infiniband/ulp/isert/ib_isert.h         |  6 ++
 drivers/media/usb/pwc/pwc-if.c                  | 22 +++---
 drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 89 ++++++++++++++++++-------
 drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 87 ++++++++++++++++++------
 drivers/net/xen-netback/netback.c               |  4 +-
 drivers/tty/tty_io.c                            |  5 +-
 drivers/vdpa/vdpa_sim/vdpa_sim.c                | 83 ++++++++++++++++-------
 drivers/xen/gntdev.c                            | 37 +++++-----
 drivers/xen/xen-scsiback.c                      |  4 +-
 fs/btrfs/ctree.h                                |  6 +-
 fs/btrfs/inode.c                                |  6 +-
 include/xen/grant_table.h                       |  1 +
 net/bridge/br.c                                 |  5 +-
 net/core/dev.c                                  |  2 +
 net/mptcp/protocol.c                            |  5 +-
 net/openvswitch/actions.c                       | 15 ++---
 net/packet/af_packet.c                          |  2 +
 net/qrtr/qrtr.c                                 |  2 +-
 net/sched/Kconfig                               |  6 +-
 net/tls/tls_proc.c                              |  3 +
 26 files changed, 337 insertions(+), 157 deletions(-)



^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH 5.10 01/29] vdpa_sim: remove hard-coded virtq count
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
@ 2021-02-22 12:12 ` Greg Kroah-Hartman
  2021-02-22 12:12 ` [PATCH 5.10 02/29] vdpa_sim: add struct vdpasim_dev_attr for device attributes Greg Kroah-Hartman
                   ` (33 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Max Gurtovoy, Jason Wang,
	Stefano Garzarella, Michael S. Tsirkin

From: Max Gurtovoy <mgurtovoy@nvidia.com>

commit 423248d60d2b655321fc49eca1545f95a1bc9d6c upstream.

Add a new attribute that will define the number of virt queues to be
created for the vdpasim device.

Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
[sgarzare: replace kmalloc_array() with kcalloc()]
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/20201215144256.155342-4-sgarzare@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/vdpa/vdpa_sim/vdpa_sim.c |   18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

--- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
+++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
@@ -70,7 +70,7 @@ static u64 vdpasim_features = (1ULL << V
 /* State of each vdpasim device */
 struct vdpasim {
 	struct vdpa_device vdpa;
-	struct vdpasim_virtqueue vqs[VDPASIM_VQ_NUM];
+	struct vdpasim_virtqueue *vqs;
 	struct work_struct work;
 	/* spinlock to synchronize virtqueue state */
 	spinlock_t lock;
@@ -80,6 +80,7 @@ struct vdpasim {
 	u32 status;
 	u32 generation;
 	u64 features;
+	int nvqs;
 	/* spinlock to synchronize iommu table */
 	spinlock_t iommu_lock;
 };
@@ -144,7 +145,7 @@ static void vdpasim_reset(struct vdpasim
 {
 	int i;
 
-	for (i = 0; i < VDPASIM_VQ_NUM; i++)
+	for (i = 0; i < vdpasim->nvqs; i++)
 		vdpasim_vq_reset(&vdpasim->vqs[i]);
 
 	spin_lock(&vdpasim->iommu_lock);
@@ -350,7 +351,7 @@ static struct vdpasim *vdpasim_create(vo
 	const struct vdpa_config_ops *ops;
 	struct vdpasim *vdpasim;
 	struct device *dev;
-	int ret = -ENOMEM;
+	int i, ret = -ENOMEM;
 
 	if (batch_mapping)
 		ops = &vdpasim_net_batch_config_ops;
@@ -361,6 +362,7 @@ static struct vdpasim *vdpasim_create(vo
 	if (!vdpasim)
 		goto err_alloc;
 
+	vdpasim->nvqs = VDPASIM_VQ_NUM;
 	INIT_WORK(&vdpasim->work, vdpasim_work);
 	spin_lock_init(&vdpasim->lock);
 	spin_lock_init(&vdpasim->iommu_lock);
@@ -371,6 +373,11 @@ static struct vdpasim *vdpasim_create(vo
 		goto err_iommu;
 	set_dma_ops(dev, &vdpasim_dma_ops);
 
+	vdpasim->vqs = kcalloc(vdpasim->nvqs, sizeof(struct vdpasim_virtqueue),
+			       GFP_KERNEL);
+	if (!vdpasim->vqs)
+		goto err_iommu;
+
 	vdpasim->iommu = vhost_iotlb_alloc(2048, 0);
 	if (!vdpasim->iommu)
 		goto err_iommu;
@@ -389,8 +396,8 @@ static struct vdpasim *vdpasim_create(vo
 		eth_random_addr(vdpasim->config.mac);
 	}
 
-	vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu);
-	vringh_set_iotlb(&vdpasim->vqs[1].vring, vdpasim->iommu);
+	for (i = 0; i < vdpasim->nvqs; i++)
+		vringh_set_iotlb(&vdpasim->vqs[i].vring, vdpasim->iommu);
 
 	vdpasim->vdpa.dma_dev = dev;
 	ret = vdpa_register_device(&vdpasim->vdpa);
@@ -659,6 +666,7 @@ static void vdpasim_free(struct vdpa_dev
 	kfree(vdpasim->buffer);
 	if (vdpasim->iommu)
 		vhost_iotlb_free(vdpasim->iommu);
+	kfree(vdpasim->vqs);
 }
 
 static const struct vdpa_config_ops vdpasim_net_config_ops = {



^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH 5.10 02/29] vdpa_sim: add struct vdpasim_dev_attr for device attributes
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
  2021-02-22 12:12 ` [PATCH 5.10 01/29] vdpa_sim: remove hard-coded virtq count Greg Kroah-Hartman
@ 2021-02-22 12:12 ` Greg Kroah-Hartman
  2021-02-22 12:12 ` [PATCH 5.10 03/29] vdpa_sim: store parsed MAC address in a buffer Greg Kroah-Hartman
                   ` (32 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Max Gurtovoy, Jason Wang,
	Stefano Garzarella, Michael S. Tsirkin

From: Stefano Garzarella <sgarzare@redhat.com>

commit 6c6e28fe45794054410ad8cd2770af69fbe0338d upstream.

vdpasim_dev_attr will contain device specific attributes. We starting
moving the number of virtqueues (i.e. nvqs) to vdpasim_dev_attr.

vdpasim_create() creates a new vDPA simulator following the device
attributes defined in the vdpasim_dev_attr parameter.

Co-developed-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/20201215144256.155342-7-sgarzare@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/vdpa/vdpa_sim/vdpa_sim.c |   25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

--- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
+++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
@@ -67,11 +67,16 @@ static u64 vdpasim_features = (1ULL << V
 			      (1ULL << VIRTIO_F_ACCESS_PLATFORM) |
 			      (1ULL << VIRTIO_NET_F_MAC);
 
+struct vdpasim_dev_attr {
+	int nvqs;
+};
+
 /* State of each vdpasim device */
 struct vdpasim {
 	struct vdpa_device vdpa;
 	struct vdpasim_virtqueue *vqs;
 	struct work_struct work;
+	struct vdpasim_dev_attr dev_attr;
 	/* spinlock to synchronize virtqueue state */
 	spinlock_t lock;
 	struct virtio_net_config config;
@@ -80,7 +85,6 @@ struct vdpasim {
 	u32 status;
 	u32 generation;
 	u64 features;
-	int nvqs;
 	/* spinlock to synchronize iommu table */
 	spinlock_t iommu_lock;
 };
@@ -145,7 +149,7 @@ static void vdpasim_reset(struct vdpasim
 {
 	int i;
 
-	for (i = 0; i < vdpasim->nvqs; i++)
+	for (i = 0; i < vdpasim->dev_attr.nvqs; i++)
 		vdpasim_vq_reset(&vdpasim->vqs[i]);
 
 	spin_lock(&vdpasim->iommu_lock);
@@ -346,7 +350,7 @@ static const struct dma_map_ops vdpasim_
 static const struct vdpa_config_ops vdpasim_net_config_ops;
 static const struct vdpa_config_ops vdpasim_net_batch_config_ops;
 
-static struct vdpasim *vdpasim_create(void)
+static struct vdpasim *vdpasim_create(struct vdpasim_dev_attr *dev_attr)
 {
 	const struct vdpa_config_ops *ops;
 	struct vdpasim *vdpasim;
@@ -358,11 +362,12 @@ static struct vdpasim *vdpasim_create(vo
 	else
 		ops = &vdpasim_net_config_ops;
 
-	vdpasim = vdpa_alloc_device(struct vdpasim, vdpa, NULL, ops, VDPASIM_VQ_NUM);
+	vdpasim = vdpa_alloc_device(struct vdpasim, vdpa, NULL, ops,
+				    dev_attr->nvqs);
 	if (!vdpasim)
 		goto err_alloc;
 
-	vdpasim->nvqs = VDPASIM_VQ_NUM;
+	vdpasim->dev_attr = *dev_attr;
 	INIT_WORK(&vdpasim->work, vdpasim_work);
 	spin_lock_init(&vdpasim->lock);
 	spin_lock_init(&vdpasim->iommu_lock);
@@ -373,7 +378,7 @@ static struct vdpasim *vdpasim_create(vo
 		goto err_iommu;
 	set_dma_ops(dev, &vdpasim_dma_ops);
 
-	vdpasim->vqs = kcalloc(vdpasim->nvqs, sizeof(struct vdpasim_virtqueue),
+	vdpasim->vqs = kcalloc(dev_attr->nvqs, sizeof(struct vdpasim_virtqueue),
 			       GFP_KERNEL);
 	if (!vdpasim->vqs)
 		goto err_iommu;
@@ -396,7 +401,7 @@ static struct vdpasim *vdpasim_create(vo
 		eth_random_addr(vdpasim->config.mac);
 	}
 
-	for (i = 0; i < vdpasim->nvqs; i++)
+	for (i = 0; i < dev_attr->nvqs; i++)
 		vringh_set_iotlb(&vdpasim->vqs[i].vring, vdpasim->iommu);
 
 	vdpasim->vdpa.dma_dev = dev;
@@ -724,7 +729,11 @@ static const struct vdpa_config_ops vdpa
 
 static int __init vdpasim_dev_init(void)
 {
-	vdpasim_dev = vdpasim_create();
+	struct vdpasim_dev_attr dev_attr = {};
+
+	dev_attr.nvqs = VDPASIM_VQ_NUM;
+
+	vdpasim_dev = vdpasim_create(&dev_attr);
 
 	if (!IS_ERR(vdpasim_dev))
 		return 0;



^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH 5.10 03/29] vdpa_sim: store parsed MAC address in a buffer
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
  2021-02-22 12:12 ` [PATCH 5.10 01/29] vdpa_sim: remove hard-coded virtq count Greg Kroah-Hartman
  2021-02-22 12:12 ` [PATCH 5.10 02/29] vdpa_sim: add struct vdpasim_dev_attr for device attributes Greg Kroah-Hartman
@ 2021-02-22 12:12 ` Greg Kroah-Hartman
  2021-02-22 19:54   ` Pavel Machek
  2021-02-22 12:12 ` [PATCH 5.10 04/29] vdpa_sim: make config generic and usable for any device type Greg Kroah-Hartman
                   ` (31 subsequent siblings)
  34 siblings, 1 reply; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Jason Wang, Stefano Garzarella,
	Michael S. Tsirkin

From: Stefano Garzarella <sgarzare@redhat.com>

commit cf1a3b35382c10ce315c32bd2b3d7789897fbe13 upstream.

As preparation for the next patches, we store the MAC address,
parsed during the vdpasim_create(), in a buffer that will be used
to fill 'config' together with other configurations.

Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/20201215144256.155342-11-sgarzare@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/vdpa/vdpa_sim/vdpa_sim.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

--- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
+++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
@@ -42,6 +42,8 @@ static char *macaddr;
 module_param(macaddr, charp, 0);
 MODULE_PARM_DESC(macaddr, "Ethernet MAC address");
 
+u8 macaddr_buf[ETH_ALEN];
+
 struct vdpasim_virtqueue {
 	struct vringh vring;
 	struct vringh_kiov iov;
@@ -392,13 +394,13 @@ static struct vdpasim *vdpasim_create(st
 		goto err_iommu;
 
 	if (macaddr) {
-		mac_pton(macaddr, vdpasim->config.mac);
-		if (!is_valid_ether_addr(vdpasim->config.mac)) {
+		mac_pton(macaddr, macaddr_buf);
+		if (!is_valid_ether_addr(macaddr_buf)) {
 			ret = -EADDRNOTAVAIL;
 			goto err_iommu;
 		}
 	} else {
-		eth_random_addr(vdpasim->config.mac);
+		eth_random_addr(macaddr_buf);
 	}
 
 	for (i = 0; i < dev_attr->nvqs; i++)
@@ -532,6 +534,8 @@ static int vdpasim_set_features(struct v
 
 	config->mtu = cpu_to_vdpasim16(vdpasim, 1500);
 	config->status = cpu_to_vdpasim16(vdpasim, VIRTIO_NET_S_LINK_UP);
+	memcpy(config->mac, macaddr_buf, ETH_ALEN);
+
 	return 0;
 }
 



^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH 5.10 04/29] vdpa_sim: make config generic and usable for any device type
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (2 preceding siblings ...)
  2021-02-22 12:12 ` [PATCH 5.10 03/29] vdpa_sim: store parsed MAC address in a buffer Greg Kroah-Hartman
@ 2021-02-22 12:12 ` Greg Kroah-Hartman
  2021-02-22 12:12 ` [PATCH 5.10 05/29] vdpa_sim: add get_config callback in vdpasim_dev_attr Greg Kroah-Hartman
                   ` (30 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Jason Wang, Stefano Garzarella,
	Michael S. Tsirkin

From: Stefano Garzarella <sgarzare@redhat.com>

commit f37cbbc65178e0a45823d281d290c4c02da9631c upstream.

Add new 'config_size' attribute in 'vdpasim_dev_attr' and allocates
'config' dynamically to support any device types.

Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/20201215144256.155342-12-sgarzare@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/vdpa/vdpa_sim/vdpa_sim.c |   17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

--- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
+++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
@@ -70,6 +70,7 @@ static u64 vdpasim_features = (1ULL << V
 			      (1ULL << VIRTIO_NET_F_MAC);
 
 struct vdpasim_dev_attr {
+	size_t config_size;
 	int nvqs;
 };
 
@@ -81,7 +82,8 @@ struct vdpasim {
 	struct vdpasim_dev_attr dev_attr;
 	/* spinlock to synchronize virtqueue state */
 	spinlock_t lock;
-	struct virtio_net_config config;
+	/* virtio config according to device type */
+	void *config;
 	struct vhost_iotlb *iommu;
 	void *buffer;
 	u32 status;
@@ -380,6 +382,10 @@ static struct vdpasim *vdpasim_create(st
 		goto err_iommu;
 	set_dma_ops(dev, &vdpasim_dma_ops);
 
+	vdpasim->config = kzalloc(dev_attr->config_size, GFP_KERNEL);
+	if (!vdpasim->config)
+		goto err_iommu;
+
 	vdpasim->vqs = kcalloc(dev_attr->nvqs, sizeof(struct vdpasim_virtqueue),
 			       GFP_KERNEL);
 	if (!vdpasim->vqs)
@@ -518,7 +524,8 @@ static u64 vdpasim_get_features(struct v
 static int vdpasim_set_features(struct vdpa_device *vdpa, u64 features)
 {
 	struct vdpasim *vdpasim = vdpa_to_sim(vdpa);
-	struct virtio_net_config *config = &vdpasim->config;
+	struct virtio_net_config *config =
+		(struct virtio_net_config *)vdpasim->config;
 
 	/* DMA mapping must be done by driver */
 	if (!(features & (1ULL << VIRTIO_F_ACCESS_PLATFORM)))
@@ -588,8 +595,8 @@ static void vdpasim_get_config(struct vd
 {
 	struct vdpasim *vdpasim = vdpa_to_sim(vdpa);
 
-	if (offset + len < sizeof(struct virtio_net_config))
-		memcpy(buf, (u8 *)&vdpasim->config + offset, len);
+	if (offset + len < vdpasim->dev_attr.config_size)
+		memcpy(buf, vdpasim->config + offset, len);
 }
 
 static void vdpasim_set_config(struct vdpa_device *vdpa, unsigned int offset,
@@ -676,6 +683,7 @@ static void vdpasim_free(struct vdpa_dev
 	if (vdpasim->iommu)
 		vhost_iotlb_free(vdpasim->iommu);
 	kfree(vdpasim->vqs);
+	kfree(vdpasim->config);
 }
 
 static const struct vdpa_config_ops vdpasim_net_config_ops = {
@@ -736,6 +744,7 @@ static int __init vdpasim_dev_init(void)
 	struct vdpasim_dev_attr dev_attr = {};
 
 	dev_attr.nvqs = VDPASIM_VQ_NUM;
+	dev_attr.config_size = sizeof(struct virtio_net_config);
 
 	vdpasim_dev = vdpasim_create(&dev_attr);
 



^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH 5.10 05/29] vdpa_sim: add get_config callback in vdpasim_dev_attr
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (3 preceding siblings ...)
  2021-02-22 12:12 ` [PATCH 5.10 04/29] vdpa_sim: make config generic and usable for any device type Greg Kroah-Hartman
@ 2021-02-22 12:12 ` Greg Kroah-Hartman
  2021-02-22 12:13 ` [PATCH 5.10 06/29] IB/isert: add module param to set sg_tablesize for IO cmd Greg Kroah-Hartman
                   ` (29 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Stefano Garzarella, Michael S. Tsirkin

From: Stefano Garzarella <sgarzare@redhat.com>

commit 65b709586e222fa6ffd4166ac7fdb5d5dad113ee upstream.

The get_config callback can be used by the device to fill the
config structure.
The callback will be invoked in vdpasim_get_config() before copying
bytes into caller buffer.

Move vDPA-net config updates from vdpasim_set_features() in the
new vdpasim_net_get_config() callback.
This is safe since in vdpa_get_config() we already check that
.set_features() callback is called before .get_config().

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/20201215144256.155342-13-sgarzare@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/vdpa/vdpa_sim/vdpa_sim.c |   35 +++++++++++++++++++++--------------
 1 file changed, 21 insertions(+), 14 deletions(-)

--- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
+++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
@@ -69,9 +69,12 @@ static u64 vdpasim_features = (1ULL << V
 			      (1ULL << VIRTIO_F_ACCESS_PLATFORM) |
 			      (1ULL << VIRTIO_NET_F_MAC);
 
+struct vdpasim;
+
 struct vdpasim_dev_attr {
 	size_t config_size;
 	int nvqs;
+	void (*get_config)(struct vdpasim *vdpasim, void *config);
 };
 
 /* State of each vdpasim device */
@@ -524,8 +527,6 @@ static u64 vdpasim_get_features(struct v
 static int vdpasim_set_features(struct vdpa_device *vdpa, u64 features)
 {
 	struct vdpasim *vdpasim = vdpa_to_sim(vdpa);
-	struct virtio_net_config *config =
-		(struct virtio_net_config *)vdpasim->config;
 
 	/* DMA mapping must be done by driver */
 	if (!(features & (1ULL << VIRTIO_F_ACCESS_PLATFORM)))
@@ -533,16 +534,6 @@ static int vdpasim_set_features(struct v
 
 	vdpasim->features = features & vdpasim_features;
 
-	/* We generally only know whether guest is using the legacy interface
-	 * here, so generally that's the earliest we can set config fields.
-	 * Note: We actually require VIRTIO_F_ACCESS_PLATFORM above which
-	 * implies VIRTIO_F_VERSION_1, but let's not try to be clever here.
-	 */
-
-	config->mtu = cpu_to_vdpasim16(vdpasim, 1500);
-	config->status = cpu_to_vdpasim16(vdpasim, VIRTIO_NET_S_LINK_UP);
-	memcpy(config->mac, macaddr_buf, ETH_ALEN);
-
 	return 0;
 }
 
@@ -595,8 +586,13 @@ static void vdpasim_get_config(struct vd
 {
 	struct vdpasim *vdpasim = vdpa_to_sim(vdpa);
 
-	if (offset + len < vdpasim->dev_attr.config_size)
-		memcpy(buf, vdpasim->config + offset, len);
+	if (offset + len > vdpasim->dev_attr.config_size)
+		return;
+
+	if (vdpasim->dev_attr.get_config)
+		vdpasim->dev_attr.get_config(vdpasim, vdpasim->config);
+
+	memcpy(buf, vdpasim->config + offset, len);
 }
 
 static void vdpasim_set_config(struct vdpa_device *vdpa, unsigned int offset,
@@ -739,12 +735,23 @@ static const struct vdpa_config_ops vdpa
 	.free                   = vdpasim_free,
 };
 
+static void vdpasim_net_get_config(struct vdpasim *vdpasim, void *config)
+{
+	struct virtio_net_config *net_config =
+		(struct virtio_net_config *)config;
+
+	net_config->mtu = cpu_to_vdpasim16(vdpasim, 1500);
+	net_config->status = cpu_to_vdpasim16(vdpasim, VIRTIO_NET_S_LINK_UP);
+	memcpy(net_config->mac, macaddr_buf, ETH_ALEN);
+}
+
 static int __init vdpasim_dev_init(void)
 {
 	struct vdpasim_dev_attr dev_attr = {};
 
 	dev_attr.nvqs = VDPASIM_VQ_NUM;
 	dev_attr.config_size = sizeof(struct virtio_net_config);
+	dev_attr.get_config = vdpasim_net_get_config;
 
 	vdpasim_dev = vdpasim_create(&dev_attr);
 



^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH 5.10 06/29] IB/isert: add module param to set sg_tablesize for IO cmd
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (4 preceding siblings ...)
  2021-02-22 12:12 ` [PATCH 5.10 05/29] vdpa_sim: add get_config callback in vdpasim_dev_attr Greg Kroah-Hartman
@ 2021-02-22 12:13 ` Greg Kroah-Hartman
  2021-02-22 12:13 ` [PATCH 5.10 07/29] net: qrtr: Fix port ID for control messages Greg Kroah-Hartman
                   ` (28 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Krishnamraju Eraparaju,
	Sagi Grimberg, Max Gurtovoy, Jason Gunthorpe, Sasha Levin

From: Max Gurtovoy <mgurtovoy@nvidia.com>

[ Upstream commit dae7a75f1f19bffb579daf148f8d8addd2726772 ]

Currently, iser target support max IO size of 16MiB by default. For some
adapters, allocating this amount of resources might reduce the total
number of possible connections that can be created. For those adapters,
it's preferred to reduce the max IO size to be able to create more
connections. Since there is no handshake procedure for max IO size in iser
protocol, set the default max IO size to 1MiB and add a module parameter
for enabling the option to control it for suitable adapters.

Fixes: 317000b926b0 ("IB/isert: allocate RW ctxs according to max IO size")
Link: https://lore.kernel.org/r/20201019094628.17202-1-mgurtovoy@nvidia.com
Reported-by: Krishnamraju Eraparaju <krishna2@chelsio.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/infiniband/ulp/isert/ib_isert.c | 27 ++++++++++++++++++++++++-
 drivers/infiniband/ulp/isert/ib_isert.h |  6 ++++++
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 436e17f1d0e53..bd478947b93a5 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -28,6 +28,18 @@ static int isert_debug_level;
 module_param_named(debug_level, isert_debug_level, int, 0644);
 MODULE_PARM_DESC(debug_level, "Enable debug tracing if > 0 (default:0)");
 
+static int isert_sg_tablesize_set(const char *val,
+				  const struct kernel_param *kp);
+static const struct kernel_param_ops sg_tablesize_ops = {
+	.set = isert_sg_tablesize_set,
+	.get = param_get_int,
+};
+
+static int isert_sg_tablesize = ISCSI_ISER_DEF_SG_TABLESIZE;
+module_param_cb(sg_tablesize, &sg_tablesize_ops, &isert_sg_tablesize, 0644);
+MODULE_PARM_DESC(sg_tablesize,
+		 "Number of gather/scatter entries in a single scsi command, should >= 128 (default: 256, max: 4096)");
+
 static DEFINE_MUTEX(device_list_mutex);
 static LIST_HEAD(device_list);
 static struct workqueue_struct *isert_comp_wq;
@@ -47,6 +59,19 @@ static void isert_send_done(struct ib_cq *cq, struct ib_wc *wc);
 static void isert_login_recv_done(struct ib_cq *cq, struct ib_wc *wc);
 static void isert_login_send_done(struct ib_cq *cq, struct ib_wc *wc);
 
+static int isert_sg_tablesize_set(const char *val, const struct kernel_param *kp)
+{
+	int n = 0, ret;
+
+	ret = kstrtoint(val, 10, &n);
+	if (ret != 0 || n < ISCSI_ISER_MIN_SG_TABLESIZE ||
+	    n > ISCSI_ISER_MAX_SG_TABLESIZE)
+		return -EINVAL;
+
+	return param_set_int(val, kp);
+}
+
+
 static inline bool
 isert_prot_cmd(struct isert_conn *conn, struct se_cmd *cmd)
 {
@@ -101,7 +126,7 @@ isert_create_qp(struct isert_conn *isert_conn,
 	attr.cap.max_send_wr = ISERT_QP_MAX_REQ_DTOS + 1;
 	attr.cap.max_recv_wr = ISERT_QP_MAX_RECV_DTOS + 1;
 	factor = rdma_rw_mr_factor(device->ib_device, cma_id->port_num,
-				   ISCSI_ISER_MAX_SG_TABLESIZE);
+				   isert_sg_tablesize);
 	attr.cap.max_rdma_ctxs = ISCSI_DEF_XMIT_CMDS_MAX * factor;
 	attr.cap.max_send_sge = device->ib_device->attrs.max_send_sge;
 	attr.cap.max_recv_sge = 1;
diff --git a/drivers/infiniband/ulp/isert/ib_isert.h b/drivers/infiniband/ulp/isert/ib_isert.h
index 7fee4a65e181a..6c5af13db4e0d 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.h
+++ b/drivers/infiniband/ulp/isert/ib_isert.h
@@ -65,6 +65,12 @@
  */
 #define ISER_RX_SIZE		(ISCSI_DEF_MAX_RECV_SEG_LEN + 1024)
 
+/* Default I/O size is 1MB */
+#define ISCSI_ISER_DEF_SG_TABLESIZE 256
+
+/* Minimum I/O size is 512KB */
+#define ISCSI_ISER_MIN_SG_TABLESIZE 128
+
 /* Maximum support is 16MB I/O size */
 #define ISCSI_ISER_MAX_SG_TABLESIZE	4096
 
-- 
2.27.0




^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 5.10 07/29] net: qrtr: Fix port ID for control messages
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (5 preceding siblings ...)
  2021-02-22 12:13 ` [PATCH 5.10 06/29] IB/isert: add module param to set sg_tablesize for IO cmd Greg Kroah-Hartman
@ 2021-02-22 12:13 ` Greg Kroah-Hartman
  2021-02-22 12:13 ` [PATCH 5.10 08/29] mptcp: skip to next candidate if subflow has unacked data Greg Kroah-Hartman
                   ` (27 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Loic Poulain, Jakub Kicinski, Sasha Levin

From: Loic Poulain <loic.poulain@linaro.org>

[ Upstream commit ae068f561baa003d260475c3e441ca454b186726 ]

The port ID for control messages was uncorrectly set with broadcast
node ID value, causing message to be dropped on remote side since
not passing packet filtering (cb->dst_port != QRTR_PORT_CTRL).

Fixes: d27e77a3de28 ("net: qrtr: Reset the node and port ID of broadcast messages")
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/qrtr/qrtr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c
index 957aa9263ba4c..d7134c558993c 100644
--- a/net/qrtr/qrtr.c
+++ b/net/qrtr/qrtr.c
@@ -347,7 +347,7 @@ static int qrtr_node_enqueue(struct qrtr_node *node, struct sk_buff *skb,
 	hdr->src_port_id = cpu_to_le32(from->sq_port);
 	if (to->sq_port == QRTR_PORT_CTRL) {
 		hdr->dst_node_id = cpu_to_le32(node->nid);
-		hdr->dst_port_id = cpu_to_le32(QRTR_NODE_BCAST);
+		hdr->dst_port_id = cpu_to_le32(QRTR_PORT_CTRL);
 	} else {
 		hdr->dst_node_id = cpu_to_le32(to->sq_node);
 		hdr->dst_port_id = cpu_to_le32(to->sq_port);
-- 
2.27.0




^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 5.10 08/29] mptcp: skip to next candidate if subflow has unacked data
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (6 preceding siblings ...)
  2021-02-22 12:13 ` [PATCH 5.10 07/29] net: qrtr: Fix port ID for control messages Greg Kroah-Hartman
@ 2021-02-22 12:13 ` Greg Kroah-Hartman
  2021-02-22 12:13 ` [PATCH 5.10 09/29] net/sched: fix miss init the mru in qdisc_skb_cb Greg Kroah-Hartman
                   ` (26 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Florian Westphal, Mat Martineau,
	Jakub Kicinski, Sasha Levin

From: Florian Westphal <fw@strlen.de>

[ Upstream commit 860975c6f80adae9d2c7654bde04a99dd28bc94f ]

In case a subflow path is blocked, MPTCP-level retransmit may not take
place anymore because such subflow is likely to have unacked data left
in its write queue.

Ignore subflows that have experienced loss and test next candidate.

Fixes: 3b1d6210a95773691 ("mptcp: implement and use MPTCP-level retransmission")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/mptcp/protocol.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 967ce9ccfc0da..f56b2e331bb6b 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1648,8 +1648,11 @@ static struct sock *mptcp_subflow_get_retrans(const struct mptcp_sock *msk)
 			continue;
 
 		/* still data outstanding at TCP level?  Don't retransmit. */
-		if (!tcp_write_queue_empty(ssk))
+		if (!tcp_write_queue_empty(ssk)) {
+			if (inet_csk(ssk)->icsk_ca_state >= TCP_CA_Loss)
+				continue;
 			return NULL;
+		}
 
 		if (subflow->backup) {
 			if (!backup)
-- 
2.27.0




^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 5.10 09/29] net/sched: fix miss init the mru in qdisc_skb_cb
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (7 preceding siblings ...)
  2021-02-22 12:13 ` [PATCH 5.10 08/29] mptcp: skip to next candidate if subflow has unacked data Greg Kroah-Hartman
@ 2021-02-22 12:13 ` Greg Kroah-Hartman
  2021-02-22 12:13 ` [PATCH 5.10 10/29] mt76: mt7915: fix endian issues Greg Kroah-Hartman
                   ` (25 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, wenxu, Jakub Kicinski, Sasha Levin

From: wenxu <wenxu@ucloud.cn>

[ Upstream commit aadaca9e7c392dbf877af8cefb156199f1a67bbe ]

The mru in the qdisc_skb_cb should be init as 0. Only defrag packets in the
act_ct will set the value.

Fixes: 038ebb1a713d ("net/sched: act_ct: fix miss set mru for ovs after defrag in act_ct")
Signed-off-by: wenxu <wenxu@ucloud.cn>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/core/dev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/core/dev.c b/net/core/dev.c
index da85cb9398693..210d0fce58e17 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3867,6 +3867,7 @@ sch_handle_egress(struct sk_buff *skb, int *ret, struct net_device *dev)
 		return skb;
 
 	/* qdisc_skb_cb(skb)->pkt_len was already set by the caller. */
+	qdisc_skb_cb(skb)->mru = 0;
 	mini_qdisc_bstats_cpu_update(miniq, skb);
 
 	switch (tcf_classify(skb, miniq->filter_list, &cl_res, false)) {
@@ -4950,6 +4951,7 @@ sch_handle_ingress(struct sk_buff *skb, struct packet_type **pt_prev, int *ret,
 	}
 
 	qdisc_skb_cb(skb)->pkt_len = skb->len;
+	qdisc_skb_cb(skb)->mru = 0;
 	skb->tc_at_ingress = 1;
 	mini_qdisc_bstats_cpu_update(miniq, skb);
 
-- 
2.27.0




^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 5.10 10/29] mt76: mt7915: fix endian issues
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (8 preceding siblings ...)
  2021-02-22 12:13 ` [PATCH 5.10 09/29] net/sched: fix miss init the mru in qdisc_skb_cb Greg Kroah-Hartman
@ 2021-02-22 12:13 ` Greg Kroah-Hartman
  2021-02-22 12:13 ` [PATCH 5.10 11/29] mt76: mt7615: fix rdd mcu cmd endianness Greg Kroah-Hartman
                   ` (24 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Felix Fietkau, Sasha Levin

From: Felix Fietkau <nbd@nbd.name>

[ Upstream commit cee236e1489ecca9d23d6ce6f60d126cc651a5ba ]

Multiple MCU messages were using u16/u32 fields without endian annotations
or conversions

Fixes: e57b7901469f ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets")
Fixes: 5517f78b0063 ("mt76: mt7915: enable firmware module debug support")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../net/wireless/mediatek/mt76/mt7915/mcu.c   | 87 +++++++++++++++----
 1 file changed, 68 insertions(+), 19 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
index a3ccc17856615..ea71409751519 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
@@ -2835,7 +2835,7 @@ int mt7915_mcu_fw_dbg_ctrl(struct mt7915_dev *dev, u32 module, u8 level)
 	struct {
 		u8 ver;
 		u8 pad;
-		u16 len;
+		__le16 len;
 		u8 level;
 		u8 rsv[3];
 		__le32 module_idx;
@@ -3070,12 +3070,12 @@ int mt7915_mcu_rdd_cmd(struct mt7915_dev *dev,
 int mt7915_mcu_set_fcc5_lpn(struct mt7915_dev *dev, int val)
 {
 	struct {
-		u32 tag;
-		u16 min_lpn;
+		__le32 tag;
+		__le16 min_lpn;
 		u8 rsv[2];
 	} __packed req = {
-		.tag = 0x1,
-		.min_lpn = val,
+		.tag = cpu_to_le32(0x1),
+		.min_lpn = cpu_to_le16(val),
 	};
 
 	return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_RDD_TH,
@@ -3086,14 +3086,29 @@ int mt7915_mcu_set_pulse_th(struct mt7915_dev *dev,
 			    const struct mt7915_dfs_pulse *pulse)
 {
 	struct {
-		u32 tag;
-		struct mt7915_dfs_pulse pulse;
+		__le32 tag;
+
+		__le32 max_width;		/* us */
+		__le32 max_pwr;			/* dbm */
+		__le32 min_pwr;			/* dbm */
+		__le32 min_stgr_pri;		/* us */
+		__le32 max_stgr_pri;		/* us */
+		__le32 min_cr_pri;		/* us */
+		__le32 max_cr_pri;		/* us */
 	} __packed req = {
-		.tag = 0x3,
+		.tag = cpu_to_le32(0x3),
+
+#define __req_field(field) .field = cpu_to_le32(pulse->field)
+		__req_field(max_width),
+		__req_field(max_pwr),
+		__req_field(min_pwr),
+		__req_field(min_stgr_pri),
+		__req_field(max_stgr_pri),
+		__req_field(min_cr_pri),
+		__req_field(max_cr_pri),
+#undef __req_field
 	};
 
-	memcpy(&req.pulse, pulse, sizeof(*pulse));
-
 	return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_RDD_TH,
 				   &req, sizeof(req), true);
 }
@@ -3102,16 +3117,50 @@ int mt7915_mcu_set_radar_th(struct mt7915_dev *dev, int index,
 			    const struct mt7915_dfs_pattern *pattern)
 {
 	struct {
-		u32 tag;
-		u16 radar_type;
-		struct mt7915_dfs_pattern pattern;
+		__le32 tag;
+		__le16 radar_type;
+
+		u8 enb;
+		u8 stgr;
+		u8 min_crpn;
+		u8 max_crpn;
+		u8 min_crpr;
+		u8 min_pw;
+		u32 min_pri;
+		u32 max_pri;
+		u8 max_pw;
+		u8 min_crbn;
+		u8 max_crbn;
+		u8 min_stgpn;
+		u8 max_stgpn;
+		u8 min_stgpr;
+		u8 rsv[2];
+		u32 min_stgpr_diff;
 	} __packed req = {
-		.tag = 0x2,
-		.radar_type = index,
+		.tag = cpu_to_le32(0x2),
+		.radar_type = cpu_to_le16(index),
+
+#define __req_field_u8(field) .field = pattern->field
+#define __req_field_u32(field) .field = cpu_to_le32(pattern->field)
+		__req_field_u8(enb),
+		__req_field_u8(stgr),
+		__req_field_u8(min_crpn),
+		__req_field_u8(max_crpn),
+		__req_field_u8(min_crpr),
+		__req_field_u8(min_pw),
+		__req_field_u32(min_pri),
+		__req_field_u32(max_pri),
+		__req_field_u8(max_pw),
+		__req_field_u8(min_crbn),
+		__req_field_u8(max_crbn),
+		__req_field_u8(min_stgpn),
+		__req_field_u8(max_stgpn),
+		__req_field_u8(min_stgpr),
+		__req_field_u32(min_stgpr_diff),
+#undef __req_field_u8
+#undef __req_field_u32
 	};
 
-	memcpy(&req.pattern, pattern, sizeof(*pattern));
-
 	return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_RDD_TH,
 				   &req, sizeof(req), true);
 }
@@ -3342,12 +3391,12 @@ int mt7915_mcu_add_obss_spr(struct mt7915_dev *dev, struct ieee80211_vif *vif,
 		u8 drop_tx_idx;
 		u8 sta_idx;	/* 256 sta */
 		u8 rsv[2];
-		u32 val;
+		__le32 val;
 	} __packed req = {
 		.action = MT_SPR_ENABLE,
 		.arg_num = 1,
 		.band_idx = mvif->band_idx,
-		.val = enable,
+		.val = cpu_to_le32(enable),
 	};
 
 	return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_SPR,
-- 
2.27.0




^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 5.10 11/29] mt76: mt7615: fix rdd mcu cmd endianness
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (9 preceding siblings ...)
  2021-02-22 12:13 ` [PATCH 5.10 10/29] mt76: mt7915: fix endian issues Greg Kroah-Hartman
@ 2021-02-22 12:13 ` Greg Kroah-Hartman
  2021-02-22 12:13 ` [PATCH 5.10 12/29] net: sched: incorrect Kconfig dependencies on Netfilter modules Greg Kroah-Hartman
                   ` (23 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Lorenzo Bianconi, Felix Fietkau, Sasha Levin

From: Lorenzo Bianconi <lorenzo@kernel.org>

[ Upstream commit 0211c282bc8aaa15343aadbc6e23043e7057f77d ]

Similar to mt7915 driver, fix mt7615 radar mcu command endianness

Fixes: 2ce73efe0f8e5 ("mt76: mt7615: initialize radar specs from host driver")
Fixes: 70911d9638069 ("mt76: mt7615: add radar pattern test knob to debugfs")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../net/wireless/mediatek/mt76/mt7615/mcu.c   | 89 ++++++++++++++-----
 1 file changed, 66 insertions(+), 23 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
index 31b40fb83f6c1..c31036f57aef8 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
@@ -2718,11 +2718,11 @@ int mt7615_mcu_rdd_cmd(struct mt7615_dev *dev,
 int mt7615_mcu_set_fcc5_lpn(struct mt7615_dev *dev, int val)
 {
 	struct {
-		u16 tag;
-		u16 min_lpn;
+		__le16 tag;
+		__le16 min_lpn;
 	} req = {
-		.tag = 0x1,
-		.min_lpn = val,
+		.tag = cpu_to_le16(0x1),
+		.min_lpn = cpu_to_le16(val),
 	};
 
 	return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_RDD_TH,
@@ -2733,14 +2733,27 @@ int mt7615_mcu_set_pulse_th(struct mt7615_dev *dev,
 			    const struct mt7615_dfs_pulse *pulse)
 {
 	struct {
-		u16 tag;
-		struct mt7615_dfs_pulse pulse;
+		__le16 tag;
+		__le32 max_width;	/* us */
+		__le32 max_pwr;		/* dbm */
+		__le32 min_pwr;		/* dbm */
+		__le32 min_stgr_pri;	/* us */
+		__le32 max_stgr_pri;	/* us */
+		__le32 min_cr_pri;	/* us */
+		__le32 max_cr_pri;	/* us */
 	} req = {
-		.tag = 0x3,
+		.tag = cpu_to_le16(0x3),
+#define __req_field(field) .field = cpu_to_le32(pulse->field)
+		__req_field(max_width),
+		__req_field(max_pwr),
+		__req_field(min_pwr),
+		__req_field(min_stgr_pri),
+		__req_field(max_stgr_pri),
+		__req_field(min_cr_pri),
+		__req_field(max_cr_pri),
+#undef  __req_field
 	};
 
-	memcpy(&req.pulse, pulse, sizeof(*pulse));
-
 	return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_RDD_TH,
 				   &req, sizeof(req), true);
 }
@@ -2749,16 +2762,45 @@ int mt7615_mcu_set_radar_th(struct mt7615_dev *dev, int index,
 			    const struct mt7615_dfs_pattern *pattern)
 {
 	struct {
-		u16 tag;
-		u16 radar_type;
-		struct mt7615_dfs_pattern pattern;
+		__le16 tag;
+		__le16 radar_type;
+		u8 enb;
+		u8 stgr;
+		u8 min_crpn;
+		u8 max_crpn;
+		u8 min_crpr;
+		u8 min_pw;
+		u8 max_pw;
+		__le32 min_pri;
+		__le32 max_pri;
+		u8 min_crbn;
+		u8 max_crbn;
+		u8 min_stgpn;
+		u8 max_stgpn;
+		u8 min_stgpr;
 	} req = {
-		.tag = 0x2,
-		.radar_type = index,
+		.tag = cpu_to_le16(0x2),
+		.radar_type = cpu_to_le16(index),
+#define __req_field_u8(field) .field = pattern->field
+#define __req_field_u32(field) .field = cpu_to_le32(pattern->field)
+		__req_field_u8(enb),
+		__req_field_u8(stgr),
+		__req_field_u8(min_crpn),
+		__req_field_u8(max_crpn),
+		__req_field_u8(min_crpr),
+		__req_field_u8(min_pw),
+		__req_field_u8(max_pw),
+		__req_field_u32(min_pri),
+		__req_field_u32(max_pri),
+		__req_field_u8(min_crbn),
+		__req_field_u8(max_crbn),
+		__req_field_u8(min_stgpn),
+		__req_field_u8(max_stgpn),
+		__req_field_u8(min_stgpr),
+#undef __req_field_u8
+#undef __req_field_u32
 	};
 
-	memcpy(&req.pattern, pattern, sizeof(*pattern));
-
 	return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_RDD_TH,
 				   &req, sizeof(req), true);
 }
@@ -2769,9 +2811,9 @@ int mt7615_mcu_rdd_send_pattern(struct mt7615_dev *dev)
 		u8 pulse_num;
 		u8 rsv[3];
 		struct {
-			u32 start_time;
-			u16 width;
-			s16 power;
+			__le32 start_time;
+			__le16 width;
+			__le16 power;
 		} pattern[32];
 	} req = {
 		.pulse_num = dev->radar_pattern.n_pulses,
@@ -2784,10 +2826,11 @@ int mt7615_mcu_rdd_send_pattern(struct mt7615_dev *dev)
 
 	/* TODO: add some noise here */
 	for (i = 0; i < dev->radar_pattern.n_pulses; i++) {
-		req.pattern[i].width = dev->radar_pattern.width;
-		req.pattern[i].power = dev->radar_pattern.power;
-		req.pattern[i].start_time = start_time +
-					    i * dev->radar_pattern.period;
+		u32 ts = start_time + i * dev->radar_pattern.period;
+
+		req.pattern[i].width = cpu_to_le16(dev->radar_pattern.width);
+		req.pattern[i].power = cpu_to_le16(dev->radar_pattern.power);
+		req.pattern[i].start_time = cpu_to_le32(ts);
 	}
 
 	return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_RDD_PATTERN,
-- 
2.27.0




^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 5.10 12/29] net: sched: incorrect Kconfig dependencies on Netfilter modules
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (10 preceding siblings ...)
  2021-02-22 12:13 ` [PATCH 5.10 11/29] mt76: mt7615: fix rdd mcu cmd endianness Greg Kroah-Hartman
@ 2021-02-22 12:13 ` Greg Kroah-Hartman
  2021-02-22 12:13 ` [PATCH 5.10 13/29] net: openvswitch: fix TTL decrement exception action execution Greg Kroah-Hartman
                   ` (22 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Pablo Neira Ayuso, Jakub Kicinski,
	Sasha Levin

From: Pablo Neira Ayuso <pablo@netfilter.org>

[ Upstream commit 102e2c07239c07144d9c7338ec09b9d47f2e5f79 ]

- NET_ACT_CONNMARK and NET_ACT_CTINFO only require conntrack support.
- NET_ACT_IPT only requires NETFILTER_XTABLES symbols, not
  IP_NF_IPTABLES. After this patch, NET_ACT_IPT becomes consistent
  with NET_EMATCH_IPT. NET_ACT_IPT dependency on IP_NF_IPTABLES predates
  Linux-2.6.12-rc2 (initial git repository build).

Fixes: 22a5dc0e5e3e ("net: sched: Introduce connmark action")
Fixes: 24ec483cec98 ("net: sched: Introduce act_ctinfo action")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Link: https://lore.kernel.org/r/20201208204707.11268-1-pablo@netfilter.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/sched/Kconfig | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/sched/Kconfig b/net/sched/Kconfig
index a3b37d88800eb..d762e89ab74f7 100644
--- a/net/sched/Kconfig
+++ b/net/sched/Kconfig
@@ -813,7 +813,7 @@ config NET_ACT_SAMPLE
 
 config NET_ACT_IPT
 	tristate "IPtables targets"
-	depends on NET_CLS_ACT && NETFILTER && IP_NF_IPTABLES
+	depends on NET_CLS_ACT && NETFILTER && NETFILTER_XTABLES
 	help
 	  Say Y here to be able to invoke iptables targets after successful
 	  classification.
@@ -912,7 +912,7 @@ config NET_ACT_BPF
 
 config NET_ACT_CONNMARK
 	tristate "Netfilter Connection Mark Retriever"
-	depends on NET_CLS_ACT && NETFILTER && IP_NF_IPTABLES
+	depends on NET_CLS_ACT && NETFILTER
 	depends on NF_CONNTRACK && NF_CONNTRACK_MARK
 	help
 	  Say Y here to allow retrieving of conn mark
@@ -924,7 +924,7 @@ config NET_ACT_CONNMARK
 
 config NET_ACT_CTINFO
 	tristate "Netfilter Connection Mark Actions"
-	depends on NET_CLS_ACT && NETFILTER && IP_NF_IPTABLES
+	depends on NET_CLS_ACT && NETFILTER
 	depends on NF_CONNTRACK && NF_CONNTRACK_MARK
 	help
 	  Say Y here to allow transfer of a connmark stored information.
-- 
2.27.0




^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 5.10 13/29] net: openvswitch: fix TTL decrement exception action execution
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (11 preceding siblings ...)
  2021-02-22 12:13 ` [PATCH 5.10 12/29] net: sched: incorrect Kconfig dependencies on Netfilter modules Greg Kroah-Hartman
@ 2021-02-22 12:13 ` Greg Kroah-Hartman
  2021-02-22 12:13 ` [PATCH 5.10 14/29] net: bridge: Fix a warning when del bridge sysfs Greg Kroah-Hartman
                   ` (21 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Eelco Chaudron, Jakub Kicinski, Sasha Levin

From: Eelco Chaudron <echaudro@redhat.com>

[ Upstream commit 09d6217254c004f6237cc2c2bfe604af58e9a8c5 ]

Currently, the exception actions are not processed correctly as the wrong
dataset is passed. This change fixes this, including the misleading
comment.

In addition, a check was added to make sure we work on an IPv4 packet,
and not just assume if it's not IPv6 it's IPv4.

This was all tested using OVS with patch,
https://patchwork.ozlabs.org/project/openvswitch/list/?series=21639,
applied and sending packets with a TTL of 1 (and 0), both with IPv4
and IPv6.

Fixes: 69929d4c49e1 ("net: openvswitch: fix TTL decrement action netlink message format")
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Link: https://lore.kernel.org/r/160733569860.3007.12938188180387116741.stgit@wsfd-netdev64.ntdv.lab.eng.bos.redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/openvswitch/actions.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index c3a664871cb5a..e8902a7e60f24 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
@@ -959,16 +959,13 @@ static int dec_ttl_exception_handler(struct datapath *dp, struct sk_buff *skb,
 				     struct sw_flow_key *key,
 				     const struct nlattr *attr, bool last)
 {
-	/* The first action is always 'OVS_DEC_TTL_ATTR_ARG'. */
-	struct nlattr *dec_ttl_arg = nla_data(attr);
+	/* The first attribute is always 'OVS_DEC_TTL_ATTR_ACTION'. */
+	struct nlattr *actions = nla_data(attr);
 
-	if (nla_len(dec_ttl_arg)) {
-		struct nlattr *actions = nla_data(dec_ttl_arg);
+	if (nla_len(actions))
+		return clone_execute(dp, skb, key, 0, nla_data(actions),
+				     nla_len(actions), last, false);
 
-		if (actions)
-			return clone_execute(dp, skb, key, 0, nla_data(actions),
-					     nla_len(actions), last, false);
-	}
 	consume_skb(skb);
 	return 0;
 }
@@ -1212,7 +1209,7 @@ static int execute_dec_ttl(struct sk_buff *skb, struct sw_flow_key *key)
 			return -EHOSTUNREACH;
 
 		key->ip.ttl = --nh->hop_limit;
-	} else {
+	} else if (skb->protocol == htons(ETH_P_IP)) {
 		struct iphdr *nh;
 		u8 old_ttl;
 
-- 
2.27.0




^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 5.10 14/29] net: bridge: Fix a warning when del bridge sysfs
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (12 preceding siblings ...)
  2021-02-22 12:13 ` [PATCH 5.10 13/29] net: openvswitch: fix TTL decrement exception action execution Greg Kroah-Hartman
@ 2021-02-22 12:13 ` Greg Kroah-Hartman
  2021-02-22 12:13 ` [PATCH 5.10 15/29] net: fix proc_fs init handling in af_packet and tls Greg Kroah-Hartman
                   ` (20 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Hulk Robot, Wang Hai,
	Nikolay Aleksandrov, Jakub Kicinski, Sasha Levin

From: Wang Hai <wanghai38@huawei.com>

[ Upstream commit 989a1db06eb18ff605377eec87e18d795e0ec74b ]

I got a warining report:

br_sysfs_addbr: can't create group bridge4/bridge
------------[ cut here ]------------
sysfs group 'bridge' not found for kobject 'bridge4'
WARNING: CPU: 2 PID: 9004 at fs/sysfs/group.c:279 sysfs_remove_group fs/sysfs/group.c:279 [inline]
WARNING: CPU: 2 PID: 9004 at fs/sysfs/group.c:279 sysfs_remove_group+0x153/0x1b0 fs/sysfs/group.c:270
Modules linked in: iptable_nat
...
Call Trace:
  br_dev_delete+0x112/0x190 net/bridge/br_if.c:384
  br_dev_newlink net/bridge/br_netlink.c:1381 [inline]
  br_dev_newlink+0xdb/0x100 net/bridge/br_netlink.c:1362
  __rtnl_newlink+0xe11/0x13f0 net/core/rtnetlink.c:3441
  rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3500
  rtnetlink_rcv_msg+0x385/0x980 net/core/rtnetlink.c:5562
  netlink_rcv_skb+0x134/0x3d0 net/netlink/af_netlink.c:2494
  netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline]
  netlink_unicast+0x4a0/0x6a0 net/netlink/af_netlink.c:1330
  netlink_sendmsg+0x793/0xc80 net/netlink/af_netlink.c:1919
  sock_sendmsg_nosec net/socket.c:651 [inline]
  sock_sendmsg+0x139/0x170 net/socket.c:671
  ____sys_sendmsg+0x658/0x7d0 net/socket.c:2353
  ___sys_sendmsg+0xf8/0x170 net/socket.c:2407
  __sys_sendmsg+0xd3/0x190 net/socket.c:2440
  do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46
  entry_SYSCALL_64_after_hwframe+0x44/0xa9

In br_device_event(), if the bridge sysfs fails to be added,
br_device_event() should return error. This can prevent warining
when removing bridge sysfs that do not exist.

Fixes: bb900b27a2f4 ("bridge: allow creating bridge devices with netlink")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Hai <wanghai38@huawei.com>
Tested-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Acked-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Link: https://lore.kernel.org/r/20201211122921.40386-1-wanghai38@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bridge/br.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/bridge/br.c b/net/bridge/br.c
index 401eeb9142eb6..1b169f8e74919 100644
--- a/net/bridge/br.c
+++ b/net/bridge/br.c
@@ -43,7 +43,10 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v
 
 		if (event == NETDEV_REGISTER) {
 			/* register of bridge completed, add sysfs entries */
-			br_sysfs_addbr(dev);
+			err = br_sysfs_addbr(dev);
+			if (err)
+				return notifier_from_errno(err);
+
 			return NOTIFY_DONE;
 		}
 	}
-- 
2.27.0




^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 5.10 15/29] net: fix proc_fs init handling in af_packet and tls
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (13 preceding siblings ...)
  2021-02-22 12:13 ` [PATCH 5.10 14/29] net: bridge: Fix a warning when del bridge sysfs Greg Kroah-Hartman
@ 2021-02-22 12:13 ` Greg Kroah-Hartman
  2021-02-22 12:13 ` [PATCH 5.10 16/29] Xen/x86: dont bail early from clear_foreign_p2m_mapping() Greg Kroah-Hartman
                   ` (19 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Yonatan Linik, Jakub Kicinski, Sasha Levin

From: Yonatan Linik <yonatanlinik@gmail.com>

[ Upstream commit a268e0f2455c32653140775662b40c2b1f1b2efa ]

proc_fs was used, in af_packet, without a surrounding #ifdef,
although there is no hard dependency on proc_fs.
That caused the initialization of the af_packet module to fail
when CONFIG_PROC_FS=n.

Specifically, proc_create_net() was used in af_packet.c,
and when it fails, packet_net_init() returns -ENOMEM.
It will always fail when the kernel is compiled without proc_fs,
because, proc_create_net() for example always returns NULL.

The calling order that starts in af_packet.c is as follows:
packet_init()
register_pernet_subsys()
register_pernet_operations()
__register_pernet_operations()
ops_init()
ops->init() (packet_net_ops.init=packet_net_init())
proc_create_net()

It worked in the past because register_pernet_subsys()'s return value
wasn't checked before this Commit 36096f2f4fa0 ("packet: Fix error path in
packet_init.").
It always returned an error, but was not checked before, so everything
was working even when CONFIG_PROC_FS=n.

The fix here is simply to add the necessary #ifdef.

This also fixes a similar error in tls_proc.c, that was found by Jakub
Kicinski.

Fixes: d26b698dd3cd ("net/tls: add skeleton of MIB statistics")
Fixes: 36096f2f4fa0 ("packet: Fix error path in packet_init")
Signed-off-by: Yonatan Linik <yonatanlinik@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/packet/af_packet.c | 2 ++
 net/tls/tls_proc.c     | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 7a18ffff85514..a0121e7c98b14 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -4615,9 +4615,11 @@ static int __net_init packet_net_init(struct net *net)
 	mutex_init(&net->packet.sklist_lock);
 	INIT_HLIST_HEAD(&net->packet.sklist);
 
+#ifdef CONFIG_PROC_FS
 	if (!proc_create_net("packet", 0, net->proc_net, &packet_seq_ops,
 			sizeof(struct seq_net_private)))
 		return -ENOMEM;
+#endif /* CONFIG_PROC_FS */
 
 	return 0;
 }
diff --git a/net/tls/tls_proc.c b/net/tls/tls_proc.c
index 3a5dd1e072332..feeceb0e4cb48 100644
--- a/net/tls/tls_proc.c
+++ b/net/tls/tls_proc.c
@@ -37,9 +37,12 @@ static int tls_statistics_seq_show(struct seq_file *seq, void *v)
 
 int __net_init tls_proc_init(struct net *net)
 {
+#ifdef CONFIG_PROC_FS
 	if (!proc_create_net_single("tls_stat", 0444, net->proc_net,
 				    tls_statistics_seq_show, NULL))
 		return -ENOMEM;
+#endif /* CONFIG_PROC_FS */
+
 	return 0;
 }
 
-- 
2.27.0




^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 5.10 16/29] Xen/x86: dont bail early from clear_foreign_p2m_mapping()
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (14 preceding siblings ...)
  2021-02-22 12:13 ` [PATCH 5.10 15/29] net: fix proc_fs init handling in af_packet and tls Greg Kroah-Hartman
@ 2021-02-22 12:13 ` Greg Kroah-Hartman
  2021-02-22 12:13 ` [PATCH 5.10 17/29] Xen/x86: also check kernel mapping in set_foreign_p2m_mapping() Greg Kroah-Hartman
                   ` (18 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jan Beulich, Juergen Gross

From: Jan Beulich <jbeulich@suse.com>

commit a35f2ef3b7376bfd0a57f7844bd7454389aae1fc upstream.

Its sibling (set_foreign_p2m_mapping()) as well as the sibling of its
only caller (gnttab_map_refs()) don't clean up after themselves in case
of error. Higher level callers are expected to do so. However, in order
for that to really clean up any partially set up state, the operation
should not terminate upon encountering an entry in unexpected state. It
is particularly relevant to notice here that set_foreign_p2m_mapping()
would skip setting up a p2m entry if its grant mapping failed, but it
would continue to set up further p2m entries as long as their mappings
succeeded.

Arguably down the road set_foreign_p2m_mapping() may want its page state
related WARN_ON() also converted to an error return.

This is part of XSA-361.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/xen/p2m.c |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -750,17 +750,15 @@ int clear_foreign_p2m_mapping(struct gnt
 		unsigned long mfn = __pfn_to_mfn(page_to_pfn(pages[i]));
 		unsigned long pfn = page_to_pfn(pages[i]);
 
-		if (mfn == INVALID_P2M_ENTRY || !(mfn & FOREIGN_FRAME_BIT)) {
+		if (mfn != INVALID_P2M_ENTRY && (mfn & FOREIGN_FRAME_BIT))
+			set_phys_to_machine(pfn, INVALID_P2M_ENTRY);
+		else
 			ret = -EINVAL;
-			goto out;
-		}
-
-		set_phys_to_machine(pfn, INVALID_P2M_ENTRY);
 	}
 	if (kunmap_ops)
 		ret = HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref,
-						kunmap_ops, count);
-out:
+						kunmap_ops, count) ?: ret;
+
 	return ret;
 }
 EXPORT_SYMBOL_GPL(clear_foreign_p2m_mapping);



^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH 5.10 17/29] Xen/x86: also check kernel mapping in set_foreign_p2m_mapping()
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (15 preceding siblings ...)
  2021-02-22 12:13 ` [PATCH 5.10 16/29] Xen/x86: dont bail early from clear_foreign_p2m_mapping() Greg Kroah-Hartman
@ 2021-02-22 12:13 ` Greg Kroah-Hartman
  2021-02-22 12:13 ` [PATCH 5.10 18/29] Xen/gntdev: correct dev_bus_addr handling in gntdev_map_grant_pages() Greg Kroah-Hartman
                   ` (17 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jan Beulich, Juergen Gross

From: Jan Beulich <jbeulich@suse.com>

commit b512e1b077e5ccdbd6e225b15d934ab12453b70a upstream.

We should not set up further state if either mapping failed; paying
attention to just the user mapping's status isn't enough.

Also use GNTST_okay instead of implying its value (zero).

This is part of XSA-361.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/xen/p2m.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -712,7 +712,8 @@ int set_foreign_p2m_mapping(struct gntta
 		unsigned long mfn, pfn;
 
 		/* Do not add to override if the map failed. */
-		if (map_ops[i].status)
+		if (map_ops[i].status != GNTST_okay ||
+		    (kmap_ops && kmap_ops[i].status != GNTST_okay))
 			continue;
 
 		if (map_ops[i].flags & GNTMAP_contains_pte) {



^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH 5.10 18/29] Xen/gntdev: correct dev_bus_addr handling in gntdev_map_grant_pages()
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (16 preceding siblings ...)
  2021-02-22 12:13 ` [PATCH 5.10 17/29] Xen/x86: also check kernel mapping in set_foreign_p2m_mapping() Greg Kroah-Hartman
@ 2021-02-22 12:13 ` Greg Kroah-Hartman
  2021-02-22 12:13 ` [PATCH 5.10 19/29] Xen/gntdev: correct error checking " Greg Kroah-Hartman
                   ` (16 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Jan Beulich, Stefano Stabellini,
	Juergen Gross

From: Jan Beulich <jbeulich@suse.com>

commit dbe5283605b3bc12ca45def09cc721a0a5c853a2 upstream.

We may not skip setting the field in the unmap structure when
GNTMAP_device_map is in use - such an unmap would fail to release the
respective resources (a page ref in the hypervisor). Otoh the field
doesn't need setting at all when GNTMAP_device_map is not in use.

To record the value for unmapping, we also better don't use our local
p2m: In particular after a subsequent change it may not have got updated
for all the batch elements. Instead it can simply be taken from the
respective map's results.

We can additionally avoid playing this game altogether for the kernel
part of the mappings in (x86) PV mode.

This is part of XSA-361.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/xen/gntdev.c |   24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

--- a/drivers/xen/gntdev.c
+++ b/drivers/xen/gntdev.c
@@ -309,18 +309,25 @@ int gntdev_map_grant_pages(struct gntdev
 		 * to the kernel linear addresses of the struct pages.
 		 * These ptes are completely different from the user ptes dealt
 		 * with find_grant_ptes.
+		 * Note that GNTMAP_device_map isn't needed here: The
+		 * dev_bus_addr output field gets consumed only from ->map_ops,
+		 * and by not requesting it when mapping we also avoid needing
+		 * to mirror dev_bus_addr into ->unmap_ops (and holding an extra
+		 * reference to the page in the hypervisor).
 		 */
+		unsigned int flags = (map->flags & ~GNTMAP_device_map) |
+				     GNTMAP_host_map;
+
 		for (i = 0; i < map->count; i++) {
 			unsigned long address = (unsigned long)
 				pfn_to_kaddr(page_to_pfn(map->pages[i]));
 			BUG_ON(PageHighMem(map->pages[i]));
 
-			gnttab_set_map_op(&map->kmap_ops[i], address,
-				map->flags | GNTMAP_host_map,
+			gnttab_set_map_op(&map->kmap_ops[i], address, flags,
 				map->grants[i].ref,
 				map->grants[i].domid);
 			gnttab_set_unmap_op(&map->kunmap_ops[i], address,
-				map->flags | GNTMAP_host_map, -1);
+				flags, -1);
 		}
 	}
 
@@ -336,17 +343,12 @@ int gntdev_map_grant_pages(struct gntdev
 			continue;
 		}
 
+		if (map->flags & GNTMAP_device_map)
+			map->unmap_ops[i].dev_bus_addr = map->map_ops[i].dev_bus_addr;
+
 		map->unmap_ops[i].handle = map->map_ops[i].handle;
 		if (use_ptemod)
 			map->kunmap_ops[i].handle = map->kmap_ops[i].handle;
-#ifdef CONFIG_XEN_GRANT_DMA_ALLOC
-		else if (map->dma_vaddr) {
-			unsigned long bfn;
-
-			bfn = pfn_to_bfn(page_to_pfn(map->pages[i]));
-			map->unmap_ops[i].dev_bus_addr = __pfn_to_phys(bfn);
-		}
-#endif
 	}
 	return err;
 }



^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH 5.10 19/29] Xen/gntdev: correct error checking in gntdev_map_grant_pages()
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (17 preceding siblings ...)
  2021-02-22 12:13 ` [PATCH 5.10 18/29] Xen/gntdev: correct dev_bus_addr handling in gntdev_map_grant_pages() Greg Kroah-Hartman
@ 2021-02-22 12:13 ` Greg Kroah-Hartman
  2021-02-22 12:13 ` [PATCH 5.10 20/29] xen/arm: dont ignore return errors from set_phys_to_machine Greg Kroah-Hartman
                   ` (15 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jan Beulich, Juergen Gross

From: Jan Beulich <jbeulich@suse.com>

commit ebee0eab08594b2bd5db716288a4f1ae5936e9bc upstream.

Failure of the kernel part of the mapping operation should also be
indicated as an error to the caller, or else it may assume the
respective kernel VA is okay to access.

Furthermore gnttab_map_refs() failing still requires recording
successfully mapped handles, so they can be unmapped subsequently. This
in turn requires there to be a way to tell full hypercall failure from
partial success - preset map_op status fields such that they won't
"happen" to look as if the operation succeeded.

Also again use GNTST_okay instead of implying its value (zero).

This is part of XSA-361.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/xen/gntdev.c      |   17 +++++++++--------
 include/xen/grant_table.h |    1 +
 2 files changed, 10 insertions(+), 8 deletions(-)

--- a/drivers/xen/gntdev.c
+++ b/drivers/xen/gntdev.c
@@ -334,21 +334,22 @@ int gntdev_map_grant_pages(struct gntdev
 	pr_debug("map %d+%d\n", map->index, map->count);
 	err = gnttab_map_refs(map->map_ops, use_ptemod ? map->kmap_ops : NULL,
 			map->pages, map->count);
-	if (err)
-		return err;
 
 	for (i = 0; i < map->count; i++) {
-		if (map->map_ops[i].status) {
+		if (map->map_ops[i].status == GNTST_okay)
+			map->unmap_ops[i].handle = map->map_ops[i].handle;
+		else if (!err)
 			err = -EINVAL;
-			continue;
-		}
 
 		if (map->flags & GNTMAP_device_map)
 			map->unmap_ops[i].dev_bus_addr = map->map_ops[i].dev_bus_addr;
 
-		map->unmap_ops[i].handle = map->map_ops[i].handle;
-		if (use_ptemod)
-			map->kunmap_ops[i].handle = map->kmap_ops[i].handle;
+		if (use_ptemod) {
+			if (map->kmap_ops[i].status == GNTST_okay)
+				map->kunmap_ops[i].handle = map->kmap_ops[i].handle;
+			else if (!err)
+				err = -EINVAL;
+		}
 	}
 	return err;
 }
--- a/include/xen/grant_table.h
+++ b/include/xen/grant_table.h
@@ -157,6 +157,7 @@ gnttab_set_map_op(struct gnttab_map_gran
 	map->flags = flags;
 	map->ref = ref;
 	map->dom = domid;
+	map->status = 1; /* arbitrary positive value */
 }
 
 static inline void



^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH 5.10 20/29] xen/arm: dont ignore return errors from set_phys_to_machine
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (18 preceding siblings ...)
  2021-02-22 12:13 ` [PATCH 5.10 19/29] Xen/gntdev: correct error checking " Greg Kroah-Hartman
@ 2021-02-22 12:13 ` Greg Kroah-Hartman
  2021-02-22 12:13 ` [PATCH 5.10 21/29] xen-blkback: dont "handle" error by BUG() Greg Kroah-Hartman
                   ` (14 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Stefano Stabellini, Julien Grall,
	Juergen Gross

From: Stefano Stabellini <stefano.stabellini@xilinx.com>

commit 36bf1dfb8b266e089afa9b7b984217f17027bf35 upstream.

set_phys_to_machine can fail due to lack of memory, see the kzalloc call
in arch/arm/xen/p2m.c:__set_phys_to_machine_multi.

Don't ignore the potential return error in set_foreign_p2m_mapping,
returning it to the caller instead.

This is part of XSA-361.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
Cc: stable@vger.kernel.org
Reviewed-by: Julien Grall <jgrall@amazon.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm/xen/p2m.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/arch/arm/xen/p2m.c
+++ b/arch/arm/xen/p2m.c
@@ -95,8 +95,10 @@ int set_foreign_p2m_mapping(struct gntta
 	for (i = 0; i < count; i++) {
 		if (map_ops[i].status)
 			continue;
-		set_phys_to_machine(map_ops[i].host_addr >> XEN_PAGE_SHIFT,
-				    map_ops[i].dev_bus_addr >> XEN_PAGE_SHIFT);
+		if (unlikely(!set_phys_to_machine(map_ops[i].host_addr >> XEN_PAGE_SHIFT,
+				    map_ops[i].dev_bus_addr >> XEN_PAGE_SHIFT))) {
+			return -ENOMEM;
+		}
 	}
 
 	return 0;



^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH 5.10 21/29] xen-blkback: dont "handle" error by BUG()
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (19 preceding siblings ...)
  2021-02-22 12:13 ` [PATCH 5.10 20/29] xen/arm: dont ignore return errors from set_phys_to_machine Greg Kroah-Hartman
@ 2021-02-22 12:13 ` Greg Kroah-Hartman
  2021-02-22 12:13 ` [PATCH 5.10 22/29] xen-netback: " Greg Kroah-Hartman
                   ` (13 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jan Beulich, Juergen Gross

From: Jan Beulich <jbeulich@suse.com>

commit 5a264285ed1cd32e26d9de4f3c8c6855e467fd63 upstream.

In particular -ENOMEM may come back here, from set_foreign_p2m_mapping().
Don't make problems worse, the more that handling elsewhere (together
with map's status fields now indicating whether a mapping wasn't even
attempted, and hence has to be considered failed) doesn't require this
odd way of dealing with errors.

This is part of XSA-362.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/block/xen-blkback/blkback.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -811,10 +811,8 @@ again:
 			break;
 	}
 
-	if (segs_to_map) {
+	if (segs_to_map)
 		ret = gnttab_map_refs(map, NULL, pages_to_gnt, segs_to_map);
-		BUG_ON(ret);
-	}
 
 	/*
 	 * Now swizzle the MFN in our domain with the MFN from the other domain
@@ -830,7 +828,7 @@ again:
 				gnttab_page_cache_put(&ring->free_pages,
 						      &pages[seg_idx]->page, 1);
 				pages[seg_idx]->handle = BLKBACK_INVALID_HANDLE;
-				ret |= 1;
+				ret |= !ret;
 				goto next;
 			}
 			pages[seg_idx]->handle = map[new_map_idx].handle;



^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH 5.10 22/29] xen-netback: dont "handle" error by BUG()
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (20 preceding siblings ...)
  2021-02-22 12:13 ` [PATCH 5.10 21/29] xen-blkback: dont "handle" error by BUG() Greg Kroah-Hartman
@ 2021-02-22 12:13 ` Greg Kroah-Hartman
  2021-02-22 12:13 ` [PATCH 5.10 23/29] xen-scsiback: " Greg Kroah-Hartman
                   ` (12 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jan Beulich, Juergen Gross

From: Jan Beulich <jbeulich@suse.com>

commit 3194a1746e8aabe86075fd3c5e7cf1f4632d7f16 upstream.

In particular -ENOMEM may come back here, from set_foreign_p2m_mapping().
Don't make problems worse, the more that handling elsewhere (together
with map's status fields now indicating whether a mapping wasn't even
attempted, and hence has to be considered failed) doesn't require this
odd way of dealing with errors.

This is part of XSA-362.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/xen-netback/netback.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -1342,13 +1342,11 @@ int xenvif_tx_action(struct xenvif_queue
 		return 0;
 
 	gnttab_batch_copy(queue->tx_copy_ops, nr_cops);
-	if (nr_mops != 0) {
+	if (nr_mops != 0)
 		ret = gnttab_map_refs(queue->tx_map_ops,
 				      NULL,
 				      queue->pages_to_map,
 				      nr_mops);
-		BUG_ON(ret);
-	}
 
 	work_done = xenvif_tx_submit(queue);
 



^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH 5.10 23/29] xen-scsiback: dont "handle" error by BUG()
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (21 preceding siblings ...)
  2021-02-22 12:13 ` [PATCH 5.10 22/29] xen-netback: " Greg Kroah-Hartman
@ 2021-02-22 12:13 ` Greg Kroah-Hartman
  2021-02-22 12:13 ` [PATCH 5.10 24/29] xen-blkback: fix error handling in xen_blkbk_map() Greg Kroah-Hartman
                   ` (11 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jan Beulich, Juergen Gross

From: Jan Beulich <jbeulich@suse.com>

commit 7c77474b2d22176d2bfb592ec74e0f2cb71352c9 upstream.

In particular -ENOMEM may come back here, from set_foreign_p2m_mapping().
Don't make problems worse, the more that handling elsewhere (together
with map's status fields now indicating whether a mapping wasn't even
attempted, and hence has to be considered failed) doesn't require this
odd way of dealing with errors.

This is part of XSA-362.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/xen/xen-scsiback.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/xen/xen-scsiback.c
+++ b/drivers/xen/xen-scsiback.c
@@ -386,12 +386,12 @@ static int scsiback_gnttab_data_map_batc
 		return 0;
 
 	err = gnttab_map_refs(map, NULL, pg, cnt);
-	BUG_ON(err);
 	for (i = 0; i < cnt; i++) {
 		if (unlikely(map[i].status != GNTST_okay)) {
 			pr_err("invalid buffer -- could not remap it\n");
 			map[i].handle = SCSIBACK_INVALID_HANDLE;
-			err = -ENOMEM;
+			if (!err)
+				err = -ENOMEM;
 		} else {
 			get_page(pg[i]);
 		}



^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH 5.10 24/29] xen-blkback: fix error handling in xen_blkbk_map()
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (22 preceding siblings ...)
  2021-02-22 12:13 ` [PATCH 5.10 23/29] xen-scsiback: " Greg Kroah-Hartman
@ 2021-02-22 12:13 ` Greg Kroah-Hartman
  2021-02-22 12:13 ` [PATCH 5.10 25/29] tty: protect tty_write from odd low-level tty disciplines Greg Kroah-Hartman
                   ` (10 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Jan Beulich, Juergen Gross, Julien Grall

From: Jan Beulich <jbeulich@suse.com>

commit 871997bc9e423f05c7da7c9178e62dde5df2a7f8 upstream.

The function uses a goto-based loop, which may lead to an earlier error
getting discarded by a later iteration. Exit this ad-hoc loop when an
error was encountered.

The out-of-memory error path additionally fails to fill a structure
field looked at by xen_blkbk_unmap_prepare() before inspecting the
handle which does get properly set (to BLKBACK_INVALID_HANDLE).

Since the earlier exiting from the ad-hoc loop requires the same field
filling (invalidation) as that on the out-of-memory path, fold both
paths. While doing so, drop the pr_alert(), as extra log messages aren't
going to help the situation (the kernel will log oom conditions already
anyway).

This is XSA-365.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <julien@xen.org>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/block/xen-blkback/blkback.c |   26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -794,8 +794,13 @@ again:
 			pages[i]->persistent_gnt = persistent_gnt;
 		} else {
 			if (gnttab_page_cache_get(&ring->free_pages,
-						  &pages[i]->page))
-				goto out_of_memory;
+						  &pages[i]->page)) {
+				gnttab_page_cache_put(&ring->free_pages,
+						      pages_to_gnt,
+						      segs_to_map);
+				ret = -ENOMEM;
+				goto out;
+			}
 			addr = vaddr(pages[i]->page);
 			pages_to_gnt[segs_to_map] = pages[i]->page;
 			pages[i]->persistent_gnt = NULL;
@@ -880,17 +885,18 @@ next:
 	}
 	segs_to_map = 0;
 	last_map = map_until;
-	if (map_until != num)
+	if (!ret && map_until != num)
 		goto again;
 
-	return ret;
-
-out_of_memory:
-	pr_alert("%s: out of memory\n", __func__);
-	gnttab_page_cache_put(&ring->free_pages, pages_to_gnt, segs_to_map);
-	for (i = last_map; i < num; i++)
+out:
+	for (i = last_map; i < num; i++) {
+		/* Don't zap current batch's valid persistent grants. */
+		if(i >= last_map + segs_to_map)
+			pages[i]->persistent_gnt = NULL;
 		pages[i]->handle = BLKBACK_INVALID_HANDLE;
-	return -ENOMEM;
+	}
+
+	return ret;
 }
 
 static int xen_blkbk_map_seg(struct pending_req *pending_req)



^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH 5.10 25/29] tty: protect tty_write from odd low-level tty disciplines
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (23 preceding siblings ...)
  2021-02-22 12:13 ` [PATCH 5.10 24/29] xen-blkback: fix error handling in xen_blkbk_map() Greg Kroah-Hartman
@ 2021-02-22 12:13 ` Greg Kroah-Hartman
  2021-02-22 12:13 ` [PATCH 5.10 26/29] Bluetooth: btusb: Always fallback to alt 1 for WBS Greg Kroah-Hartman
                   ` (9 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, syzbot+3d2c27c2b7dc2a94814d,
	Linus Torvalds, Al Viro

From: Linus Torvalds <torvalds@linux-foundation.org>

commit 3342ff2698e9720f4040cc458a2744b2b32f5c3a upstream.

Al root-caused a new warning from syzbot to the ttyprintk tty driver
returning a write count larger than the data the tty layer actually gave
it.  Which confused the tty write code mightily, and with the new
iov_iter based code, caused a WARNING in iov_iter_revert().

syzbot correctly bisected the source of the new warning to commit
9bb48c82aced ("tty: implement write_iter"), but the oddity goes back
much further, it just didn't get caught by anything before.

Reported-by: syzbot+3d2c27c2b7dc2a94814d@syzkaller.appspotmail.com
Fixes: 9bb48c82aced ("tty: implement write_iter")
Debugged-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/tty/tty_io.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -963,11 +963,14 @@ static inline ssize_t do_tty_write(
 		if (ret <= 0)
 			break;
 
+		written += ret;
+		if (ret > size)
+			break;
+
 		/* FIXME! Have Al check this! */
 		if (ret != size)
 			iov_iter_revert(from, size-ret);
 
-		written += ret;
 		count -= ret;
 		if (!count)
 			break;



^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH 5.10 26/29] Bluetooth: btusb: Always fallback to alt 1 for WBS
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (24 preceding siblings ...)
  2021-02-22 12:13 ` [PATCH 5.10 25/29] tty: protect tty_write from odd low-level tty disciplines Greg Kroah-Hartman
@ 2021-02-22 12:13 ` Greg Kroah-Hartman
  2021-02-22 12:13 ` [PATCH 5.10 27/29] btrfs: fix backport of 2175bf57dc952 in 5.10.13 Greg Kroah-Hartman
                   ` (8 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Trent Piepho, Marcel Holtmann,
	Salvatore Bonaccorso, Sjoerd Simons, Sebastian Reichel

From: Trent Piepho <tpiepho@gmail.com>

commit 517b693351a2d04f3af1fc0e506ac7e1346094de upstream.

When alt mode 6 is not available, fallback to the kernel <= 5.7 behavior
of always using alt mode 1.

Prior to kernel 5.8, btusb would always use alt mode 1 for WBS (Wide
Band Speech aka mSBC aka transparent SCO).  In commit baac6276c0a9
("Bluetooth: btusb: handle mSBC audio over USB Endpoints") this
was changed to use alt mode 6, which is the recommended mode in the
Bluetooth spec (Specifications of the Bluetooth System, v5.0, Vol 4.B
§2.2.1).  However, many if not most BT USB adapters do not support alt
mode 6.  In fact, I have been unable to find any which do.

In kernel 5.8, this was changed to use alt mode 6, and if not available,
use alt mode 0.  But mode 0 has a zero byte max packet length and can
not possibly work.  It is just there as a zero-bandwidth dummy mode to
work around a USB flaw that would prevent device enumeration if
insufficient bandwidth were available for the lowest isoc mode
supported.

In effect, WBS was broken for all USB-BT adapters that do not support
alt 6, which appears to nearly all of them.

Then in commit 461f95f04f19 ("Bluetooth: btusb: USB alternate setting 1 for
WBS") the 5.7 behavior was restored, but only for Realtek adapters.

I've tested a Broadcom BRCM20702A and CSR 8510 adapter, both work with
the 5.7 behavior and do not with the 5.8.

So get rid of the Realtek specific flag and use the 5.7 behavior for all
adapters as a fallback when alt 6 is not available.  This was the
kernel's behavior prior to 5.8 and I can find no adapters for which it
is not correct.  And even if there is an adapter for which this does not
work, the current behavior would be to fall back to alt 0, which can not
possibly work either, and so is no better.

Signed-off-by: Trent Piepho <tpiepho@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Cc: Salvatore Bonaccorso <carnil@debian.org>
Cc: Sjoerd Simons <sjoerd@luon.net>
Cc: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/bluetooth/btusb.c |   20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -480,7 +480,6 @@ static const struct dmi_system_id btusb_
 #define BTUSB_HW_RESET_ACTIVE	12
 #define BTUSB_TX_WAIT_VND_EVT	13
 #define BTUSB_WAKEUP_DISABLE	14
-#define BTUSB_USE_ALT1_FOR_WBS	15
 
 struct btusb_data {
 	struct hci_dev       *hdev;
@@ -1710,15 +1709,12 @@ static void btusb_work(struct work_struc
 				new_alts = data->sco_num;
 			}
 		} else if (data->air_mode == HCI_NOTIFY_ENABLE_SCO_TRANSP) {
-			/* Check if Alt 6 is supported for Transparent audio */
-			if (btusb_find_altsetting(data, 6)) {
-				data->usb_alt6_packet_flow = true;
-				new_alts = 6;
-			} else if (test_bit(BTUSB_USE_ALT1_FOR_WBS, &data->flags)) {
-				new_alts = 1;
-			} else {
-				bt_dev_err(hdev, "Device does not support ALT setting 6");
-			}
+			/* Bluetooth USB spec recommends alt 6 (63 bytes), but
+			 * many adapters do not support it.  Alt 1 appears to
+			 * work for all adapters that do not have alt 6, and
+			 * which work with WBS at all.
+			 */
+			new_alts = btusb_find_altsetting(data, 6) ? 6 : 1;
 		}
 
 		if (btusb_switch_alt_setting(hdev, new_alts) < 0)
@@ -4149,10 +4145,6 @@ static int btusb_probe(struct usb_interf
 		 * (DEVICE_REMOTE_WAKEUP)
 		 */
 		set_bit(BTUSB_WAKEUP_DISABLE, &data->flags);
-		if (btusb_find_altsetting(data, 1))
-			set_bit(BTUSB_USE_ALT1_FOR_WBS, &data->flags);
-		else
-			bt_dev_err(hdev, "Device does not support ALT setting 1");
 	}
 
 	if (!reset)



^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH 5.10 27/29] btrfs: fix backport of 2175bf57dc952 in 5.10.13
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (25 preceding siblings ...)
  2021-02-22 12:13 ` [PATCH 5.10 26/29] Bluetooth: btusb: Always fallback to alt 1 for WBS Greg Kroah-Hartman
@ 2021-02-22 12:13 ` Greg Kroah-Hartman
  2021-02-22 12:13 ` [PATCH 5.10 28/29] btrfs: fix crash after non-aligned direct IO write with O_DSYNC Greg Kroah-Hartman
                   ` (7 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:13 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, Wang Yugui, David Sterba

From: David Sterba <dsterba@suse.com>

There's a mistake in backport of upstream commit 2175bf57dc95 ("btrfs:
fix possible free space tree corruption with online conversion") as
5.10.13 commit 2175bf57dc95.

The enum value BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED has been added to the
wrong enum set, colliding with value of BTRFS_FS_QUOTA_ENABLE. This
could cause problems during the tree conversion, where the quotas
wouldn't be set up properly but the related code executed anyway due to
the bit set.

Link: https://lore.kernel.org/linux-btrfs/20210219111741.95DD.409509F4@e16-tech.com
Reported-by: Wang Yugui <wangyugui@e16-tech.com>
CC: stable@vger.kernel.org # 5.10.13+
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/btrfs/ctree.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -146,9 +146,6 @@ enum {
 	BTRFS_FS_STATE_DEV_REPLACING,
 	/* The btrfs_fs_info created for self-tests */
 	BTRFS_FS_STATE_DUMMY_FS_INFO,
-
-	/* Indicate that we can't trust the free space tree for caching yet */
-	BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED,
 };
 
 #define BTRFS_BACKREF_REV_MAX		256
@@ -562,6 +559,9 @@ enum {
 
 	/* Indicate that the discard workqueue can service discards. */
 	BTRFS_FS_DISCARD_RUNNING,
+
+	/* Indicate that we can't trust the free space tree for caching yet */
+	BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED,
 };
 
 /*



^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH 5.10 28/29] btrfs: fix crash after non-aligned direct IO write with O_DSYNC
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (26 preceding siblings ...)
  2021-02-22 12:13 ` [PATCH 5.10 27/29] btrfs: fix backport of 2175bf57dc952 in 5.10.13 Greg Kroah-Hartman
@ 2021-02-22 12:13 ` Greg Kroah-Hartman
  2021-02-22 12:13 ` [PATCH 5.10 29/29] media: pwc: Use correct device for DMA Greg Kroah-Hartman
                   ` (6 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:13 UTC (permalink / raw)
  To: linux-kernel, linux-btrfs
  Cc: Greg Kroah-Hartman, stable, stable@vger.kernel.org,
	dsterba@suse.cz, Filipe Manana, David Sterba, Filipe Manana

From: Filipe Manana <fdmanana@suse.com>

Whenever we attempt to do a non-aligned direct IO write with O_DSYNC, we
end up triggering an assertion and crashing. Example reproducer:

  $ cat test.sh
  #!/bin/bash

  DEV=/dev/sdj
  MNT=/mnt/sdj

  mkfs.btrfs -f $DEV > /dev/null
  mount $DEV $MNT

  # Do a direct IO write with O_DSYNC into a non-aligned range...
  xfs_io -f -d -s -c "pwrite -S 0xab -b 64K 1111 64K" $MNT/foobar

  umount $MNT

When running the reproducer an assertion fails and produces the following
trace:

  [ 2418.403134] assertion failed: !current->journal_info || flush != BTRFS_RESERVE_FLUSH_DATA, in fs/btrfs/space-info.c:1467
  [ 2418.403745] ------------[ cut here ]------------
  [ 2418.404306] kernel BUG at fs/btrfs/ctree.h:3286!
  [ 2418.404862] invalid opcode: 0000 [#2] PREEMPT SMP DEBUG_PAGEALLOC PTI
  [ 2418.405451] CPU: 1 PID: 64705 Comm: xfs_io Tainted: G      D           5.10.15-btrfs-next-87 #1
  [ 2418.406026] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014
  [ 2418.407228] RIP: 0010:assertfail.constprop.0+0x18/0x26 [btrfs]
  [ 2418.407835] Code: e6 48 c7 (...)
  [ 2418.409078] RSP: 0018:ffffb06080d13c98 EFLAGS: 00010246
  [ 2418.409696] RAX: 000000000000006c RBX: ffff994c1debbf08 RCX: 0000000000000000
  [ 2418.410302] RDX: 0000000000000000 RSI: 0000000000000027 RDI: 00000000ffffffff
  [ 2418.410904] RBP: ffff994c21770000 R08: 0000000000000000 R09: 0000000000000000
  [ 2418.411504] R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000010000
  [ 2418.412111] R13: ffff994c22198400 R14: ffff994c21770000 R15: 0000000000000000
  [ 2418.412713] FS:  00007f54fd7aff00(0000) GS:ffff994d35200000(0000) knlGS:0000000000000000
  [ 2418.413326] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  [ 2418.413933] CR2: 000056549596d000 CR3: 000000010b928003 CR4: 0000000000370ee0
  [ 2418.414528] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
  [ 2418.415109] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
  [ 2418.415669] Call Trace:
  [ 2418.416254]  btrfs_reserve_data_bytes.cold+0x22/0x22 [btrfs]
  [ 2418.416812]  btrfs_check_data_free_space+0x4c/0xa0 [btrfs]
  [ 2418.417380]  btrfs_buffered_write+0x1b0/0x7f0 [btrfs]
  [ 2418.418315]  btrfs_file_write_iter+0x2a9/0x770 [btrfs]
  [ 2418.418920]  new_sync_write+0x11f/0x1c0
  [ 2418.419430]  vfs_write+0x2bb/0x3b0
  [ 2418.419972]  __x64_sys_pwrite64+0x90/0xc0
  [ 2418.420486]  do_syscall_64+0x33/0x80
  [ 2418.420979]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
  [ 2418.421486] RIP: 0033:0x7f54fda0b986
  [ 2418.421981] Code: 48 c7 c0 (...)
  [ 2418.423019] RSP: 002b:00007ffc40569c38 EFLAGS: 00000246 ORIG_RAX: 0000000000000012
  [ 2418.423547] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f54fda0b986
  [ 2418.424075] RDX: 0000000000010000 RSI: 000056549595e000 RDI: 0000000000000003
  [ 2418.424596] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000400
  [ 2418.425119] R10: 0000000000000400 R11: 0000000000000246 R12: 00000000ffffffff
  [ 2418.425644] R13: 0000000000000400 R14: 0000000000010000 R15: 0000000000000000
  [ 2418.426148] Modules linked in: btrfs blake2b_generic (...)
  [ 2418.429540] ---[ end trace ef2aeb44dc0afa34 ]---

1) At btrfs_file_write_iter() we set current->journal_info to
   BTRFS_DIO_SYNC_STUB;

2) We then call __btrfs_direct_write(), which calls btrfs_direct_IO();

3) We can't do the direct IO write because it starts at a non-aligned
   offset (1111). So at btrfs_direct_IO() we return -EINVAL (coming from
   check_direct_IO() which does the alignment check), but we leave
   current->journal_info set to BTRFS_DIO_SYNC_STUB - we only clear it
   at btrfs_dio_iomap_begin(), because we assume we always get there;

4) Then at __btrfs_direct_write() we see that the attempt to do the
   direct IO write was not successful, 0 bytes written, so we fallback
   to a buffered write by calling btrfs_buffered_write();

5) There we call btrfs_check_data_free_space() which in turn calls
   btrfs_alloc_data_chunk_ondemand() and that calls
   btrfs_reserve_data_bytes() with flush == BTRFS_RESERVE_FLUSH_DATA;

6) Then at btrfs_reserve_data_bytes() we have current->journal_info set to
   BTRFS_DIO_SYNC_STUB, therefore not NULL, and flush has the value
   BTRFS_RESERVE_FLUSH_DATA, triggering the second assertion:

  int btrfs_reserve_data_bytes(struct btrfs_fs_info *fs_info, u64 bytes,
                               enum btrfs_reserve_flush_enum flush)
  {
      struct btrfs_space_info *data_sinfo = fs_info->data_sinfo;
      int ret;

      ASSERT(flush == BTRFS_RESERVE_FLUSH_DATA ||
             flush == BTRFS_RESERVE_FLUSH_FREE_SPACE_INODE);
      ASSERT(!current->journal_info || flush != BTRFS_RESERVE_FLUSH_DATA);
  (...)

So fix that by setting the journal to NULL whenever check_direct_IO()
returns a failure.

This bug only affects 5.10 kernels, and the regression was introduced in
5.10-rc1 by commit 0eb79294dbe328 ("btrfs: dio iomap DSYNC workaround").
The bug does not exist in 5.11 kernels due to commit ecfdc08b8cc65d
("btrfs: remove dio iomap DSYNC workaround"), which depends on a large
patchset that went into the merge window for 5.11. So this is a fix only
for 5.10.x stable kernels, as there are people hitting this bug.

Fixes: 0eb79294dbe328 ("btrfs: dio iomap DSYNC workaround")
CC: stable@vger.kernel.org # 5.10 (and only 5.10)
Acked-by: David Sterba <dsterba@suse.com>
Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1181605
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/btrfs/inode.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -8026,8 +8026,12 @@ ssize_t btrfs_direct_IO(struct kiocb *io
 	bool relock = false;
 	ssize_t ret;
 
-	if (check_direct_IO(fs_info, iter, offset))
+	if (check_direct_IO(fs_info, iter, offset)) {
+		ASSERT(current->journal_info == NULL ||
+		       current->journal_info == BTRFS_DIO_SYNC_STUB);
+		current->journal_info = NULL;
 		return 0;
+	}
 
 	count = iov_iter_count(iter);
 	if (iov_iter_rw(iter) == WRITE) {



^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH 5.10 29/29] media: pwc: Use correct device for DMA
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (27 preceding siblings ...)
  2021-02-22 12:13 ` [PATCH 5.10 28/29] btrfs: fix crash after non-aligned direct IO write with O_DSYNC Greg Kroah-Hartman
@ 2021-02-22 12:13 ` Greg Kroah-Hartman
  2021-02-22 17:17 ` [PATCH 5.10 00/29] 5.10.18-rc1 review Florian Fainelli
                   ` (5 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-22 12:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Matwey V. Kornilov, Hans Verkuil,
	Mauro Carvalho Chehab

From: Matwey V. Kornilov <matwey@sai.msu.ru>

commit 69c9e825e812ec6d663e64ebf14bd3bc7f37e2c7 upstream.

This fixes the following newly introduced warning:

[   15.518253] ------------[ cut here ]------------
[   15.518941] WARNING: CPU: 0 PID: 246 at kernel/dma/mapping.c:149 dma_map_page_attrs+0x1a8/0x1d0
[   15.520634] Modules linked in: pwc videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_common videodev mc efivarfs
[   15.522335] CPU: 0 PID: 246 Comm: v4l2-test Not tainted 5.11.0-rc1+ #1
[   15.523281] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
[   15.524438] RIP: 0010:dma_map_page_attrs+0x1a8/0x1d0
[   15.525135] Code: 10 5b 5d 41 5c 41 5d c3 4d 89 d0 eb d7 4d 89 c8 89 e9 48 89 da e8 68 29 00 00 eb d1 48 89 f2 48 2b 50 18 48 89 d0 eb 83 0f 0b <0f> 0b 48 c7 c0 ff ff ff ff eb b8 48 89 d9 48 8b 40 40 e8 61 69 d2
[   15.527938] RSP: 0018:ffffa2694047bca8 EFLAGS: 00010246
[   15.528716] RAX: 0000000000000000 RBX: 0000000000002580 RCX: 0000000000000000
[   15.529782] RDX: 0000000000000000 RSI: ffffcdce000ecc00 RDI: ffffa0b4bdb888a0
[   15.530849] RBP: 0000000000000002 R08: 0000000000000002 R09: 0000000000000000
[   15.531881] R10: 0000000000000004 R11: 000000000002d8c0 R12: 0000000000000000
[   15.532911] R13: ffffa0b4bdb88800 R14: ffffa0b483820000 R15: ffffa0b4bdb888a0
[   15.533942] FS:  00007fc5fbb5e4c0(0000) GS:ffffa0b4fc000000(0000) knlGS:0000000000000000
[   15.535141] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   15.535988] CR2: 00007fc5fb6ea138 CR3: 0000000003812000 CR4: 00000000001506f0
[   15.537025] Call Trace:
[   15.537425]  start_streaming+0x2e9/0x4b0 [pwc]
[   15.538143]  vb2_start_streaming+0x5e/0x110 [videobuf2_common]
[   15.538989]  vb2_core_streamon+0x107/0x140 [videobuf2_common]
[   15.539831]  __video_do_ioctl+0x18f/0x4a0 [videodev]
[   15.540670]  video_usercopy+0x13a/0x5b0 [videodev]
[   15.541349]  ? video_put_user+0x230/0x230 [videodev]
[   15.542096]  ? selinux_file_ioctl+0x143/0x200
[   15.542752]  v4l2_ioctl+0x40/0x50 [videodev]
[   15.543360]  __x64_sys_ioctl+0x89/0xc0
[   15.543930]  do_syscall_64+0x33/0x40
[   15.544448]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[   15.545236] RIP: 0033:0x7fc5fb671587
[   15.545780] Code: b3 66 90 48 8b 05 11 49 2c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d e1 48 2c 00 f7 d8 64 89 01 48
[   15.548486] RSP: 002b:00007fff0f71f038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[   15.549578] RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fc5fb671587
[   15.550664] RDX: 00007fff0f71f060 RSI: 0000000040045612 RDI: 0000000000000003
[   15.551706] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
[   15.552738] R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff0f71f060
[   15.553817] R13: 00007fff0f71f1d0 R14: 0000000000de1270 R15: 0000000000000000
[   15.554914] ---[ end trace 7be03122966c2486 ]---

Fixes: 1161db6776bd ("media: usb: pwc: Don't use coherent DMA buffers for ISO transfer")
Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/media/usb/pwc/pwc-if.c |   22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

--- a/drivers/media/usb/pwc/pwc-if.c
+++ b/drivers/media/usb/pwc/pwc-if.c
@@ -155,16 +155,17 @@ static const struct video_device pwc_tem
 /***************************************************************************/
 /* Private functions */
 
-static void *pwc_alloc_urb_buffer(struct device *dev,
+static void *pwc_alloc_urb_buffer(struct usb_device *dev,
 				  size_t size, dma_addr_t *dma_handle)
 {
+	struct device *dmadev = dev->bus->sysdev;
 	void *buffer = kmalloc(size, GFP_KERNEL);
 
 	if (!buffer)
 		return NULL;
 
-	*dma_handle = dma_map_single(dev, buffer, size, DMA_FROM_DEVICE);
-	if (dma_mapping_error(dev, *dma_handle)) {
+	*dma_handle = dma_map_single(dmadev, buffer, size, DMA_FROM_DEVICE);
+	if (dma_mapping_error(dmadev, *dma_handle)) {
 		kfree(buffer);
 		return NULL;
 	}
@@ -172,12 +173,14 @@ static void *pwc_alloc_urb_buffer(struct
 	return buffer;
 }
 
-static void pwc_free_urb_buffer(struct device *dev,
+static void pwc_free_urb_buffer(struct usb_device *dev,
 				size_t size,
 				void *buffer,
 				dma_addr_t dma_handle)
 {
-	dma_unmap_single(dev, dma_handle, size, DMA_FROM_DEVICE);
+	struct device *dmadev = dev->bus->sysdev;
+
+	dma_unmap_single(dmadev, dma_handle, size, DMA_FROM_DEVICE);
 	kfree(buffer);
 }
 
@@ -282,6 +285,7 @@ static void pwc_frame_complete(struct pw
 static void pwc_isoc_handler(struct urb *urb)
 {
 	struct pwc_device *pdev = (struct pwc_device *)urb->context;
+	struct device *dmadev = urb->dev->bus->sysdev;
 	int i, fst, flen;
 	unsigned char *iso_buf = NULL;
 
@@ -328,7 +332,7 @@ static void pwc_isoc_handler(struct urb
 	/* Reset ISOC error counter. We did get here, after all. */
 	pdev->visoc_errors = 0;
 
-	dma_sync_single_for_cpu(&urb->dev->dev,
+	dma_sync_single_for_cpu(dmadev,
 				urb->transfer_dma,
 				urb->transfer_buffer_length,
 				DMA_FROM_DEVICE);
@@ -379,7 +383,7 @@ static void pwc_isoc_handler(struct urb
 		pdev->vlast_packet_size = flen;
 	}
 
-	dma_sync_single_for_device(&urb->dev->dev,
+	dma_sync_single_for_device(dmadev,
 				   urb->transfer_dma,
 				   urb->transfer_buffer_length,
 				   DMA_FROM_DEVICE);
@@ -461,7 +465,7 @@ retry:
 		urb->pipe = usb_rcvisocpipe(udev, pdev->vendpoint);
 		urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP;
 		urb->transfer_buffer_length = ISO_BUFFER_SIZE;
-		urb->transfer_buffer = pwc_alloc_urb_buffer(&udev->dev,
+		urb->transfer_buffer = pwc_alloc_urb_buffer(udev,
 							    urb->transfer_buffer_length,
 							    &urb->transfer_dma);
 		if (urb->transfer_buffer == NULL) {
@@ -524,7 +528,7 @@ static void pwc_iso_free(struct pwc_devi
 		if (urb) {
 			PWC_DEBUG_MEMORY("Freeing URB\n");
 			if (urb->transfer_buffer)
-				pwc_free_urb_buffer(&urb->dev->dev,
+				pwc_free_urb_buffer(urb->dev,
 						    urb->transfer_buffer_length,
 						    urb->transfer_buffer,
 						    urb->transfer_dma);



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 5.10 00/29] 5.10.18-rc1 review
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (28 preceding siblings ...)
  2021-02-22 12:13 ` [PATCH 5.10 29/29] media: pwc: Use correct device for DMA Greg Kroah-Hartman
@ 2021-02-22 17:17 ` Florian Fainelli
  2021-02-24 18:42   ` Greg Kroah-Hartman
  2021-02-22 18:42 ` Pavel Machek
                   ` (4 subsequent siblings)
  34 siblings, 1 reply; 43+ messages in thread
From: Florian Fainelli @ 2021-02-22 17:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel
  Cc: torvalds, akpm, linux, shuah, patches, lkft-triage, pavel,
	jonathanh, stable



On 2/22/2021 4:12 AM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 5.10.18 release.
> There are 29 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 Wed, 24 Feb 2021 12:07:46 +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.10.18-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.10.y
> and the diffstat can be found below.

On ARCH_BRCMSTB using 32-bit ARM and 64-bit ARM kernels:

Tested-by: Florian Fainelli <f.fainelli@gmail.com>

Thanks!
-- 
Florian

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 5.10 00/29] 5.10.18-rc1 review
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (29 preceding siblings ...)
  2021-02-22 17:17 ` [PATCH 5.10 00/29] 5.10.18-rc1 review Florian Fainelli
@ 2021-02-22 18:42 ` Pavel Machek
  2021-02-24 18:42   ` Greg Kroah-Hartman
  2021-02-22 21:28 ` Guenter Roeck
                   ` (3 subsequent siblings)
  34 siblings, 1 reply; 43+ messages in thread
From: Pavel Machek @ 2021-02-22 18:42 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, torvalds, akpm, linux, shuah, patches, lkft-triage,
	pavel, jonathanh, stable

[-- Attachment #1: Type: text/plain, Size: 722 bytes --]

Hi!

> This is the start of the stable review cycle for the 5.10.18 release.
> There are 29 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.

Two runs are marked as failed, but details show "no available board",
so it is not a kernel problem.

https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/tree/linux-5.10.y

Tested-by: Pavel Machek (CIP) <pavel@denx.de>

Best regards,
                                                                Pavel


-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 5.10 03/29] vdpa_sim: store parsed MAC address in a buffer
  2021-02-22 12:12 ` [PATCH 5.10 03/29] vdpa_sim: store parsed MAC address in a buffer Greg Kroah-Hartman
@ 2021-02-22 19:54   ` Pavel Machek
  2021-02-23  4:49     ` Greg Kroah-Hartman
  2021-02-23  8:06     ` Stefano Garzarella
  0 siblings, 2 replies; 43+ messages in thread
From: Pavel Machek @ 2021-02-22 19:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, stable, Jason Wang, Stefano Garzarella, Michael S. Tsirkin

[-- Attachment #1: Type: text/plain, Size: 730 bytes --]

Hi!

> From: Stefano Garzarella <sgarzare@redhat.com>
> 
> commit cf1a3b35382c10ce315c32bd2b3d7789897fbe13 upstream.
> 
> As preparation for the next patches, we store the MAC address,
> parsed during the vdpasim_create(), in a buffer that will be used
> to fill 'config' together with other configurations.

I'm not sure why this series is in stable. It is not documented to fix
anything bad. 

> +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
> @@ -42,6 +42,8 @@ static char *macaddr;
>  module_param(macaddr, charp, 0);
>  MODULE_PARM_DESC(macaddr, "Ethernet MAC address");
>  
> +u8 macaddr_buf[ETH_ALEN];
> +

Should this be static?

Best regards,
								Pavel
-- 
http://www.livejournal.com/~pavelmachek

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 5.10 00/29] 5.10.18-rc1 review
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (30 preceding siblings ...)
  2021-02-22 18:42 ` Pavel Machek
@ 2021-02-22 21:28 ` Guenter Roeck
  2021-02-22 21:34 ` Igor
                   ` (2 subsequent siblings)
  34 siblings, 0 replies; 43+ messages in thread
From: Guenter Roeck @ 2021-02-22 21:28 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, torvalds, akpm, shuah, patches, lkft-triage, pavel,
	jonathanh, stable

On Mon, Feb 22, 2021 at 01:12:54PM +0100, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 5.10.18 release.
> There are 29 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 Wed, 24 Feb 2021 12:07:46 +0000.
> Anything received after that time might be too late.
> 

Build results:
	total: 156 pass: 156 fail: 0
Qemu test results:
	total: 430 pass: 430 fail: 0

Tested-by: Guenter Roeck <linux@roeck-us.net>

Guenter

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 5.10 00/29] 5.10.18-rc1 review
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (31 preceding siblings ...)
  2021-02-22 21:28 ` Guenter Roeck
@ 2021-02-22 21:34 ` Igor
  2021-02-23  2:49 ` Naresh Kamboju
  2021-02-23 21:06 ` Shuah Khan
  34 siblings, 0 replies; 43+ messages in thread
From: Igor @ 2021-02-22 21:34 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, torvalds, akpm, linux, shuah, patches, lkft-triage,
	pavel, jonathanh, stable, skhan

On Mon, Feb 22, 2021 at 01:12:54PM +0100, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 5.10.18 release.
> There are 29 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 Wed, 24 Feb 2021 12:07:46 +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.10.18-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.10.y
> and the diffstat can be found below.
> 
> thanks,
> 
> greg k-h
> 

Compiled and booted on my machine(x86_64) without any dmesg regression.
My compilation uses the default Debian 10 .config(From kernel
4.19.0-14-amd64), followed by olddefconfig.

Tested-by: Igor Matheus Andrade Torrente <igormtorrente@gmail.com>

Best regards
---
Igor Matheus Andrade Torrente

> -------------
> Pseudo-Shortlog of commits:
> 
> Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>     Linux 5.10.18-rc1
> 
> Matwey V. Kornilov <matwey@sai.msu.ru>
>     media: pwc: Use correct device for DMA
> 
> Filipe Manana <fdmanana@suse.com>
>     btrfs: fix crash after non-aligned direct IO write with O_DSYNC
> 
> David Sterba <dsterba@suse.com>
>     btrfs: fix backport of 2175bf57dc952 in 5.10.13
> 
> Trent Piepho <tpiepho@gmail.com>
>     Bluetooth: btusb: Always fallback to alt 1 for WBS
> 
> Linus Torvalds <torvalds@linux-foundation.org>
>     tty: protect tty_write from odd low-level tty disciplines
> 
> Jan Beulich <jbeulich@suse.com>
>     xen-blkback: fix error handling in xen_blkbk_map()
> 
> Jan Beulich <jbeulich@suse.com>
>     xen-scsiback: don't "handle" error by BUG()
> 
> Jan Beulich <jbeulich@suse.com>
>     xen-netback: don't "handle" error by BUG()
> 
> Jan Beulich <jbeulich@suse.com>
>     xen-blkback: don't "handle" error by BUG()
> 
> Stefano Stabellini <stefano.stabellini@xilinx.com>
>     xen/arm: don't ignore return errors from set_phys_to_machine
> 
> Jan Beulich <jbeulich@suse.com>
>     Xen/gntdev: correct error checking in gntdev_map_grant_pages()
> 
> Jan Beulich <jbeulich@suse.com>
>     Xen/gntdev: correct dev_bus_addr handling in gntdev_map_grant_pages()
> 
> Jan Beulich <jbeulich@suse.com>
>     Xen/x86: also check kernel mapping in set_foreign_p2m_mapping()
> 
> Jan Beulich <jbeulich@suse.com>
>     Xen/x86: don't bail early from clear_foreign_p2m_mapping()
> 
> Yonatan Linik <yonatanlinik@gmail.com>
>     net: fix proc_fs init handling in af_packet and tls
> 
> Wang Hai <wanghai38@huawei.com>
>     net: bridge: Fix a warning when del bridge sysfs
> 
> Eelco Chaudron <echaudro@redhat.com>
>     net: openvswitch: fix TTL decrement exception action execution
> 
> Pablo Neira Ayuso <pablo@netfilter.org>
>     net: sched: incorrect Kconfig dependencies on Netfilter modules
> 
> Lorenzo Bianconi <lorenzo@kernel.org>
>     mt76: mt7615: fix rdd mcu cmd endianness
> 
> Felix Fietkau <nbd@nbd.name>
>     mt76: mt7915: fix endian issues
> 
> wenxu <wenxu@ucloud.cn>
>     net/sched: fix miss init the mru in qdisc_skb_cb
> 
> Florian Westphal <fw@strlen.de>
>     mptcp: skip to next candidate if subflow has unacked data
> 
> Loic Poulain <loic.poulain@linaro.org>
>     net: qrtr: Fix port ID for control messages
> 
> Max Gurtovoy <mgurtovoy@nvidia.com>
>     IB/isert: add module param to set sg_tablesize for IO cmd
> 
> Stefano Garzarella <sgarzare@redhat.com>
>     vdpa_sim: add get_config callback in vdpasim_dev_attr
> 
> Stefano Garzarella <sgarzare@redhat.com>
>     vdpa_sim: make 'config' generic and usable for any device type
> 
> Stefano Garzarella <sgarzare@redhat.com>
>     vdpa_sim: store parsed MAC address in a buffer
> 
> Stefano Garzarella <sgarzare@redhat.com>
>     vdpa_sim: add struct vdpasim_dev_attr for device attributes
> 
> Max Gurtovoy <mgurtovoy@nvidia.com>
>     vdpa_sim: remove hard-coded virtq count
> 
> 
> -------------
> 
> Diffstat:
> 
>  Makefile                                        |  4 +-
>  arch/arm/xen/p2m.c                              |  6 +-
>  arch/x86/xen/p2m.c                              | 15 ++---
>  drivers/block/xen-blkback/blkback.c             | 32 +++++----
>  drivers/bluetooth/btusb.c                       | 20 ++----
>  drivers/infiniband/ulp/isert/ib_isert.c         | 27 +++++++-
>  drivers/infiniband/ulp/isert/ib_isert.h         |  6 ++
>  drivers/media/usb/pwc/pwc-if.c                  | 22 +++---
>  drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 89 ++++++++++++++++++-------
>  drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 87 ++++++++++++++++++------
>  drivers/net/xen-netback/netback.c               |  4 +-
>  drivers/tty/tty_io.c                            |  5 +-
>  drivers/vdpa/vdpa_sim/vdpa_sim.c                | 83 ++++++++++++++++-------
>  drivers/xen/gntdev.c                            | 37 +++++-----
>  drivers/xen/xen-scsiback.c                      |  4 +-
>  fs/btrfs/ctree.h                                |  6 +-
>  fs/btrfs/inode.c                                |  6 +-
>  include/xen/grant_table.h                       |  1 +
>  net/bridge/br.c                                 |  5 +-
>  net/core/dev.c                                  |  2 +
>  net/mptcp/protocol.c                            |  5 +-
>  net/openvswitch/actions.c                       | 15 ++---
>  net/packet/af_packet.c                          |  2 +
>  net/qrtr/qrtr.c                                 |  2 +-
>  net/sched/Kconfig                               |  6 +-
>  net/tls/tls_proc.c                              |  3 +
>  26 files changed, 337 insertions(+), 157 deletions(-)
> 
> 


^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 5.10 00/29] 5.10.18-rc1 review
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (32 preceding siblings ...)
  2021-02-22 21:34 ` Igor
@ 2021-02-23  2:49 ` Naresh Kamboju
  2021-02-23 21:06 ` Shuah Khan
  34 siblings, 0 replies; 43+ messages in thread
From: Naresh Kamboju @ 2021-02-23  2:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: open list, Shuah Khan, patches, lkft-triage, Jon Hunter,
	linux-stable, pavel, Andrew Morton, Linus Torvalds,
	Guenter Roeck

On Mon, 22 Feb 2021 at 17:44, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> This is the start of the stable review cycle for the 5.10.18 release.
> There are 29 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 Wed, 24 Feb 2021 12:07:46 +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.10.18-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.10.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h


Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.

Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>

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

kernel: 5.10.18-rc1
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-5.10.y
git commit: 905cc0ddef721db27341d7ca4f85bbcd82bbb6e1
git describe: v5.10.17-30-g905cc0ddef72
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.10.y/build/v5.10.17-30-g905cc0ddef72

No regressions (compared to build v5.10.17)


No fixes (compared to build v5.10.17)


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

Environments
--------------
- arc
- arm
- arm64
- dragonboard-410c
- dragonboard-845c
- hi6220-hikey
- i386
- juno-r2
- juno-r2-compat
- juno-r2-kasan
- mips
- nxp-ls2088
- nxp-ls2088-64k_page_size
- parisc
- powerpc
- qemu-arm-clang
- qemu-arm64-clang
- qemu-arm64-kasan
- qemu-x86_64-clang
- qemu-x86_64-kasan
- qemu-x86_64-kcsan
- qemu_arm
- qemu_arm64
- qemu_arm64-compat
- qemu_i386
- qemu_x86_64
- qemu_x86_64-compat
- riscv
- s390
- sh
- sparc
- x15
- x86
- x86-kasan
- x86_64

Test Suites
-----------
* build
* linux-log-parser
* install-android-platform-tools-r2600
* kselftest-
* kselftest-bpf
* kselftest-efivarfs
* kselftest-filesystems
* kselftest-firmware
* kselftest-fpu
* kselftest-futex
* kselftest-gpio
* kselftest-ipc
* kselftest-ir
* kselftest-kcmp
* kselftest-lkdtm
* kselftest-timens
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user
* kselftest-zram
* libhugetlbfs
* ltp-cap_bounds-tests
* ltp-commands-tests
* ltp-containers-tests
* ltp-cpuhotplug-tests
* ltp-crypto-tests
* ltp-cve-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-hugetlb-tests
* ltp-ipc-tests
* ltp-math-tests
* ltp-mm-tests
* ltp-nptl-tests
* ltp-pty-tests
* ltp-sched-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* ltp-tracing-tests
* kselftest-android
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-intel_pstate
* kselftest-kvm
* kselftest-livepatch
* kselftest-ptrace
* ltp-dio-tests
* ltp-fs-tests
* ltp-io-tests
* network-basic-tests
* perf
* kselftest-kexec
* kselftest-lib
* kselftest-membarrier
* kselftest-memfd
* kselftest-memory-hotplug
* kselftest-mincore
* kselftest-mount
* kselftest-mqueue
* kselftest-net
* kselftest-netfilter
* kselftest-nsfs
* kselftest-openat2
* kselftest-pid_namespace
* kselftest-pidfd
* kselftest-proc
* kselftest-pstore
* kselftest-rseq
* kselftest-rtc
* kselftest-seccomp
* kselftest-sigaltstack
* kselftest-size
* kselftest-splice
* kselftest-static_keys
* kselftest-sync
* kselftest-sysctl
* kselftest-tc-testing
* ltp-open-posix-tests
* v4l2-compliance
* kvm-unit-tests
* ltp-controllers-tests
* kunit
* rcutorture
* kselftest-vm
* ssuite
* fwts

-- 
Linaro LKFT
https://lkft.linaro.org

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 5.10 03/29] vdpa_sim: store parsed MAC address in a buffer
  2021-02-22 19:54   ` Pavel Machek
@ 2021-02-23  4:49     ` Greg Kroah-Hartman
  2021-02-23  8:06     ` Stefano Garzarella
  1 sibling, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-23  4:49 UTC (permalink / raw)
  To: Pavel Machek
  Cc: linux-kernel, stable, Jason Wang, Stefano Garzarella, Michael S. Tsirkin

On Mon, Feb 22, 2021 at 08:54:15PM +0100, Pavel Machek wrote:
> Hi!
> 
> > From: Stefano Garzarella <sgarzare@redhat.com>
> > 
> > commit cf1a3b35382c10ce315c32bd2b3d7789897fbe13 upstream.
> > 
> > As preparation for the next patches, we store the MAC address,
> > parsed during the vdpasim_create(), in a buffer that will be used
> > to fill 'config' together with other configurations.
> 
> I'm not sure why this series is in stable. It is not documented to fix
> anything bad. 

Please see https://lore.kernel.org/r/20210211162519.215418-1-sgarzare@redhat.com

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 5.10 03/29] vdpa_sim: store parsed MAC address in a buffer
  2021-02-22 19:54   ` Pavel Machek
  2021-02-23  4:49     ` Greg Kroah-Hartman
@ 2021-02-23  8:06     ` Stefano Garzarella
  2021-02-24  8:29       ` Pavel Machek
  1 sibling, 1 reply; 43+ messages in thread
From: Stefano Garzarella @ 2021-02-23  8:06 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Greg Kroah-Hartman, linux-kernel, stable, Jason Wang, Michael S. Tsirkin

On Mon, Feb 22, 2021 at 08:54:15PM +0100, Pavel Machek wrote:
>Hi!
>
>> From: Stefano Garzarella <sgarzare@redhat.com>
>>
>> commit cf1a3b35382c10ce315c32bd2b3d7789897fbe13 upstream.
>>
>> As preparation for the next patches, we store the MAC address,
>> parsed during the vdpasim_create(), in a buffer that will be used
>> to fill 'config' together with other configurations.
>
>I'm not sure why this series is in stable. It is not documented to fix
>anything bad.
>
>> +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
>> @@ -42,6 +42,8 @@ static char *macaddr;
>>  module_param(macaddr, charp, 0);
>>  MODULE_PARM_DESC(macaddr, "Ethernet MAC address");
>>
>> +u8 macaddr_buf[ETH_ALEN];
>> +
>
>Should this be static?

Yes, there is already a patch [1] queued by Michael but not yet 
upstream. When it will be merged upstream I will make sure it will be 
backported.

Thanks,
Stefano

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git/commit/?h=linux-next&id=8c0bea4adac9f1f9ac827210fa8862be4bde6290


^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 5.10 00/29] 5.10.18-rc1 review
  2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
                   ` (33 preceding siblings ...)
  2021-02-23  2:49 ` Naresh Kamboju
@ 2021-02-23 21:06 ` Shuah Khan
  34 siblings, 0 replies; 43+ messages in thread
From: Shuah Khan @ 2021-02-23 21:06 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel
  Cc: torvalds, akpm, linux, shuah, patches, lkft-triage, pavel,
	jonathanh, stable, Shuah Khan

On 2/22/21 5:12 AM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 5.10.18 release.
> There are 29 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 Wed, 24 Feb 2021 12:07:46 +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.10.18-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.10.y
> and the diffstat can be found below.
> 
> thanks,
> 
> greg k-h
> 

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

Tested-by: Shuah Khan <skhan@linuxfoundation.org>

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 5.10 03/29] vdpa_sim: store parsed MAC address in a buffer
  2021-02-23  8:06     ` Stefano Garzarella
@ 2021-02-24  8:29       ` Pavel Machek
  2021-02-24  8:36         ` Stefano Garzarella
  0 siblings, 1 reply; 43+ messages in thread
From: Pavel Machek @ 2021-02-24  8:29 UTC (permalink / raw)
  To: Stefano Garzarella
  Cc: Greg Kroah-Hartman, linux-kernel, stable, Jason Wang, Michael S. Tsirkin

[-- Attachment #1: Type: text/plain, Size: 732 bytes --]

Hi!

> >>+++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
> >>@@ -42,6 +42,8 @@ static char *macaddr;
> >> module_param(macaddr, charp, 0);
> >> MODULE_PARM_DESC(macaddr, "Ethernet MAC address");
> >>
> >>+u8 macaddr_buf[ETH_ALEN];
> >>+
> >
> >Should this be static?
> 
> Yes, there is already a patch [1] queued by Michael but not yet upstream.
> When it will be merged upstream I will make sure it will be backported.

Having it in mainline is enough, I don't really think it causes
anything user-visible, so it does not need to be in stable.

Best regards,
								Pavel
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 5.10 03/29] vdpa_sim: store parsed MAC address in a buffer
  2021-02-24  8:29       ` Pavel Machek
@ 2021-02-24  8:36         ` Stefano Garzarella
  0 siblings, 0 replies; 43+ messages in thread
From: Stefano Garzarella @ 2021-02-24  8:36 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Greg Kroah-Hartman, linux-kernel, stable, Jason Wang, Michael S. Tsirkin

On Wed, Feb 24, 2021 at 09:29:54AM +0100, Pavel Machek wrote:
>Hi!
>
>> >>+++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
>> >>@@ -42,6 +42,8 @@ static char *macaddr;
>> >> module_param(macaddr, charp, 0);
>> >> MODULE_PARM_DESC(macaddr, "Ethernet MAC address");
>> >>
>> >>+u8 macaddr_buf[ETH_ALEN];
>> >>+
>> >
>> >Should this be static?
>>
>> Yes, there is already a patch [1] queued by Michael but not yet upstream.
>> When it will be merged upstream I will make sure it will be backported.
>
>Having it in mainline is enough, I don't really think it causes
>anything user-visible, so it does not need to be in stable.

Got it.

Thanks,
Stefano


^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 5.10 00/29] 5.10.18-rc1 review
  2021-02-22 18:42 ` Pavel Machek
@ 2021-02-24 18:42   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-24 18:42 UTC (permalink / raw)
  To: Pavel Machek
  Cc: linux-kernel, torvalds, akpm, linux, shuah, patches, lkft-triage,
	jonathanh, stable

On Mon, Feb 22, 2021 at 07:42:23PM +0100, Pavel Machek wrote:
> Hi!
> 
> > This is the start of the stable review cycle for the 5.10.18 release.
> > There are 29 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.
> 
> Two runs are marked as failed, but details show "no available board",
> so it is not a kernel problem.
> 
> https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/tree/linux-5.10.y
> 
> Tested-by: Pavel Machek (CIP) <pavel@denx.de>

Thanks for testing some of these.

greg k-h

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 5.10 00/29] 5.10.18-rc1 review
  2021-02-22 17:17 ` [PATCH 5.10 00/29] 5.10.18-rc1 review Florian Fainelli
@ 2021-02-24 18:42   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 43+ messages in thread
From: Greg Kroah-Hartman @ 2021-02-24 18:42 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: linux-kernel, torvalds, akpm, linux, shuah, patches, lkft-triage,
	pavel, jonathanh, stable

On Mon, Feb 22, 2021 at 09:17:44AM -0800, Florian Fainelli wrote:
> 
> 
> On 2/22/2021 4:12 AM, Greg Kroah-Hartman wrote:
> > This is the start of the stable review cycle for the 5.10.18 release.
> > There are 29 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 Wed, 24 Feb 2021 12:07:46 +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.10.18-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.10.y
> > and the diffstat can be found below.
> 
> On ARCH_BRCMSTB using 32-bit ARM and 64-bit ARM kernels:
> 
> Tested-by: Florian Fainelli <f.fainelli@gmail.com>

Thanks for testing!

^ permalink raw reply	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2021-02-24 18:43 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-22 12:12 [PATCH 5.10 00/29] 5.10.18-rc1 review Greg Kroah-Hartman
2021-02-22 12:12 ` [PATCH 5.10 01/29] vdpa_sim: remove hard-coded virtq count Greg Kroah-Hartman
2021-02-22 12:12 ` [PATCH 5.10 02/29] vdpa_sim: add struct vdpasim_dev_attr for device attributes Greg Kroah-Hartman
2021-02-22 12:12 ` [PATCH 5.10 03/29] vdpa_sim: store parsed MAC address in a buffer Greg Kroah-Hartman
2021-02-22 19:54   ` Pavel Machek
2021-02-23  4:49     ` Greg Kroah-Hartman
2021-02-23  8:06     ` Stefano Garzarella
2021-02-24  8:29       ` Pavel Machek
2021-02-24  8:36         ` Stefano Garzarella
2021-02-22 12:12 ` [PATCH 5.10 04/29] vdpa_sim: make config generic and usable for any device type Greg Kroah-Hartman
2021-02-22 12:12 ` [PATCH 5.10 05/29] vdpa_sim: add get_config callback in vdpasim_dev_attr Greg Kroah-Hartman
2021-02-22 12:13 ` [PATCH 5.10 06/29] IB/isert: add module param to set sg_tablesize for IO cmd Greg Kroah-Hartman
2021-02-22 12:13 ` [PATCH 5.10 07/29] net: qrtr: Fix port ID for control messages Greg Kroah-Hartman
2021-02-22 12:13 ` [PATCH 5.10 08/29] mptcp: skip to next candidate if subflow has unacked data Greg Kroah-Hartman
2021-02-22 12:13 ` [PATCH 5.10 09/29] net/sched: fix miss init the mru in qdisc_skb_cb Greg Kroah-Hartman
2021-02-22 12:13 ` [PATCH 5.10 10/29] mt76: mt7915: fix endian issues Greg Kroah-Hartman
2021-02-22 12:13 ` [PATCH 5.10 11/29] mt76: mt7615: fix rdd mcu cmd endianness Greg Kroah-Hartman
2021-02-22 12:13 ` [PATCH 5.10 12/29] net: sched: incorrect Kconfig dependencies on Netfilter modules Greg Kroah-Hartman
2021-02-22 12:13 ` [PATCH 5.10 13/29] net: openvswitch: fix TTL decrement exception action execution Greg Kroah-Hartman
2021-02-22 12:13 ` [PATCH 5.10 14/29] net: bridge: Fix a warning when del bridge sysfs Greg Kroah-Hartman
2021-02-22 12:13 ` [PATCH 5.10 15/29] net: fix proc_fs init handling in af_packet and tls Greg Kroah-Hartman
2021-02-22 12:13 ` [PATCH 5.10 16/29] Xen/x86: dont bail early from clear_foreign_p2m_mapping() Greg Kroah-Hartman
2021-02-22 12:13 ` [PATCH 5.10 17/29] Xen/x86: also check kernel mapping in set_foreign_p2m_mapping() Greg Kroah-Hartman
2021-02-22 12:13 ` [PATCH 5.10 18/29] Xen/gntdev: correct dev_bus_addr handling in gntdev_map_grant_pages() Greg Kroah-Hartman
2021-02-22 12:13 ` [PATCH 5.10 19/29] Xen/gntdev: correct error checking " Greg Kroah-Hartman
2021-02-22 12:13 ` [PATCH 5.10 20/29] xen/arm: dont ignore return errors from set_phys_to_machine Greg Kroah-Hartman
2021-02-22 12:13 ` [PATCH 5.10 21/29] xen-blkback: dont "handle" error by BUG() Greg Kroah-Hartman
2021-02-22 12:13 ` [PATCH 5.10 22/29] xen-netback: " Greg Kroah-Hartman
2021-02-22 12:13 ` [PATCH 5.10 23/29] xen-scsiback: " Greg Kroah-Hartman
2021-02-22 12:13 ` [PATCH 5.10 24/29] xen-blkback: fix error handling in xen_blkbk_map() Greg Kroah-Hartman
2021-02-22 12:13 ` [PATCH 5.10 25/29] tty: protect tty_write from odd low-level tty disciplines Greg Kroah-Hartman
2021-02-22 12:13 ` [PATCH 5.10 26/29] Bluetooth: btusb: Always fallback to alt 1 for WBS Greg Kroah-Hartman
2021-02-22 12:13 ` [PATCH 5.10 27/29] btrfs: fix backport of 2175bf57dc952 in 5.10.13 Greg Kroah-Hartman
2021-02-22 12:13 ` [PATCH 5.10 28/29] btrfs: fix crash after non-aligned direct IO write with O_DSYNC Greg Kroah-Hartman
2021-02-22 12:13 ` [PATCH 5.10 29/29] media: pwc: Use correct device for DMA Greg Kroah-Hartman
2021-02-22 17:17 ` [PATCH 5.10 00/29] 5.10.18-rc1 review Florian Fainelli
2021-02-24 18:42   ` Greg Kroah-Hartman
2021-02-22 18:42 ` Pavel Machek
2021-02-24 18:42   ` Greg Kroah-Hartman
2021-02-22 21:28 ` Guenter Roeck
2021-02-22 21:34 ` Igor
2021-02-23  2:49 ` Naresh Kamboju
2021-02-23 21:06 ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).