6.12.114-rc1 review
Subsystems (5)
Greg Kroah-Hartman
maintainerPATCH 797/869 net: stmmac: fix dma mapping leak in stmmac_tso_xmit()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Bianconi <[email protected]>
[ Upstream commit a5d946466a95621fa2769720d59ea336003aa1a5 ]
In stmmac_tso_xmit(), if the DMA mapping of an skb fragment fails, the frame is dropped but the DMA mappings already created for the linear part and for the fragments mapped before the failure are never unmapped, leaking DMA mappings.
Fix the leak by walking back over the descriptors used by the frame and releasing each of them with stmmac_free_tx_buffer(). Moreover, release the descriptors with stmmac_release_tx_desc() unmapping the DMA buffers.
--- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 67 ++++++++++++------- 1 file changed, 43 insertions(+), 24 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +43 -24
@@ -4087,6 +4087,7 @@ static bool stmmac_vlan_insert(struct stmmac_priv *priv, struct sk_buff *skb,/** * stmmac_tso_allocator - close entry point of the driver * @priv: driver private structure +* @entry: TX queue buffer index * @des: buffer start address * @total_len: total length to fill in descriptors * @last_segment: condition for the last descriptor
@@ -4095,8 +4096,9 @@ static bool stmmac_vlan_insert(struct stmmac_priv *priv, struct sk_buff *skb,* This function fills descriptor and request new descriptors according to * buffer length to fill */ -static void stmmac_tso_allocator (struct stmmac_priv *priv,dma_addr_t des, -int total_len,bool last_segment,u32 queue) +static void stmmac_tso_allocator (struct stmmac_priv *priv,u32 *entry, +dma_addr_t des,int total_len, +bool last_segment,u32 queue) {struct stmmac_tx_queue *tx_q = &priv->dma_conf.tx_queue[queue];struct dma_desc *desc;
@@ -4108,14 +4110,13 @@ static void stmmac_tso_allocator(struct stmmac_priv *priv, dma_addr_t des,while (tmp_len >0 ) {dma_addr_t curr_addr; - tx_q->cur_tx =STMMAC_NEXT_ENTRY (tx_q->cur_tx, - priv->dma_conf.dma_tx_size); -WARN_ON (tx_q->tx_skbuff[tx_q->cur_tx]); + *entry =STMMAC_NEXT_ENTRY (*entry, priv->dma_conf.dma_tx_size); +WARN_ON (tx_q->tx_skbuff[*entry]);if (tx_q->tbs &STMMAC_TBS_AVAIL ) - desc = &tx_q->dma_entx[tx_q->cur_tx].basic; + desc = &tx_q->dma_entx[*entry].basic;else - desc = &tx_q->dma_tx[tx_q->cur_tx]; + desc = &tx_q->dma_tx[*entry]; curr_addr = des + (total_len - tmp_len);stmmac_set_desc_addr (priv, desc, curr_addr);
@@ -4240,7 +4241,7 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev) {struct dma_desc *desc, *first, *mss_desc =NULL ;struct stmmac_priv *priv =netdev_priv (dev); -unsigned int first_entry, tx_packets; +unsigned int first_entry, entry, tx_packets;struct stmmac_txq_stats *txq_stats;int i, first_tx, nfrags, ndesc;struct stmmac_tx_queue *tx_q;
@@ -4315,22 +4316,24 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev) } first_entry = tx_q->cur_tx; -WARN_ON (tx_q->tx_skbuff[first_entry]); + entry = first_entry; + +WARN_ON (tx_q->tx_skbuff[entry]);if (tx_q->tbs &STMMAC_TBS_AVAIL ) - desc = &tx_q->dma_entx[first_entry].basic; + desc = &tx_q->dma_entx[entry].basic;else - desc = &tx_q->dma_tx[first_entry]; + desc = &tx_q->dma_tx[entry]; first = desc;/* first descriptor: fill Headers on Buf1 */ des =dma_map_single (priv->device, skb->data,skb_headlen (skb),DMA_TO_DEVICE );if (dma_mapping_error (priv->device, des)) - goto dma_map_err; + goto error;stmmac_set_desc_addr (priv, first, des); -stmmac_tso_allocator (priv, des + proto_hdr_len, pay_len, +stmmac_tso_allocator (priv, &entry, des + proto_hdr_len, pay_len, (nfrags ==0 ), queue);/* In case two or more DMA transmit descriptors are allocated for this
@@ -4345,10 +4348,10 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)* this DMA buffer right after the DMA engine completely finishes the * full buffer transmission. */ - tx_q->tx_skbuff_dma[tx_q->cur_tx].buf = des; - tx_q->tx_skbuff_dma[tx_q->cur_tx].len =skb_headlen (skb); - tx_q->tx_skbuff_dma[tx_q->cur_tx].map_as_page = false; - tx_q->tx_skbuff_dma[tx_q->cur_tx].buf_type =STMMAC_TXBUF_T_SKB ; + tx_q->tx_skbuff_dma[entry].buf = des; + tx_q->tx_skbuff_dma[entry].len =skb_headlen (skb); + tx_q->tx_skbuff_dma[entry].map_as_page = false; + tx_q->tx_skbuff_dma[entry].buf_type =STMMAC_TXBUF_T_SKB ;/* Prepare fragments */ for (i =0 ; i < nfrags; i++) {
@@ -4358,16 +4361,17 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)skb_frag_size (frag), DMA_TO_DEVICE);if (dma_mapping_error (priv->device, des)) - goto dma_map_err; + goto error_dma_unmap; -stmmac_tso_allocator (priv, des,skb_frag_size (frag), +stmmac_tso_allocator (priv, &entry, des,skb_frag_size (frag), (i == nfrags -1 ), queue); - tx_q->tx_skbuff_dma[tx_q->cur_tx].buf = des; - tx_q->tx_skbuff_dma[tx_q->cur_tx].len =skb_frag_size (frag); - tx_q->tx_skbuff_dma[tx_q->cur_tx].map_as_page = true; - tx_q->tx_skbuff_dma[tx_q->cur_tx].buf_type =STMMAC_TXBUF_T_SKB ; + tx_q->tx_skbuff_dma[entry].buf = des; + tx_q->tx_skbuff_dma[entry].len =skb_frag_size (frag); + tx_q->tx_skbuff_dma[entry].map_as_page = true; + tx_q->tx_skbuff_dma[entry].buf_type =STMMAC_TXBUF_T_SKB ; } + tx_q->cur_tx = entry; tx_q->tx_skbuff_dma[tx_q->cur_tx].last_segment = true;
@@ -4464,7 +4468,22 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)return NETDEV_TX_OK ; -dma_map_err: +error_dma_unmap: +for (;;) { +if (tx_q->tbs &STMMAC_TBS_AVAIL ) + desc = &tx_q->dma_entx[first_entry].basic; +else + desc = &tx_q->dma_tx[first_entry]; +stmmac_release_tx_desc (priv, desc, priv->mode); +stmmac_free_tx_buffer (priv, &priv->dma_conf, queue, + first_entry); +if (first_entry == entry) +break ; + + first_entry =STMMAC_NEXT_ENTRY (first_entry, + priv->dma_conf.dma_tx_size); + } +error:dev_err (priv->device,"Tx dma map failed\n" );dev_kfree_skb (skb); priv->xstats.tx_dropped++;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 798/869 bpf: check_cond_jmp_op(): properly infer if register is null
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eduard Zingerman <[email protected]>
[ Upstream commit d3ef6c097ba078e1f8c7239d76a0ce8b61e75095 ]
Nicholas Carlini reported a bug when verifier can incorrectly infer that a pointer is non-null. The bug occurs when two pointers are compared and one of them has a type w/o PTR_MAYBE_NULL flag, but which allows a value to be NULL at runtime.
Here is an example:
// `a` is PTR_TO_MEM | MEM_RDONLY | PTR_UNTRUSTED // `a` is 0 at runtime. // `b` is PTR_TO_MAP_VALUE | PTR_MAYBE_NULL void *a = bpf_rdonly_cast(0, 0); int *b = bpf_map_lookup_elem(...);
if (a == b)
*b = 42; // verifier does not catch null pointer dereference
This happens because of a special case in check_cond_jmp_op(), which attempts to strip PTR_MAYBE_NULL flags from pointer types, when processing comparisons like rA == rB, if either rA or rB can't be null.
The non-null property is derived based on the absence of PTR_MAYBE_NULL flag on rA's or rB's type. But that is not sufficient for types like PTR_TO_MEM, as in the example.
This patch replaces type_may_be_null() call with reg_not_null(), which contains an allowlist of types for which absence of PTR_MAYBE_NULL actually means that the value can't be NULL at runtime.
At the moment, the list in the reg_not_null() omits two types for which PTR_MAYBE_NULL is applicable: PTR_TO_XDP_SOCK and PTR_TO_BUF. In order to remain backward compatible, and assuming that only comparison between pointers of the same type makes sense, this commit extends reg_not_null(). W/o such an extension e.g. verifier_jeq_infer_not_null/null_ptr_to_map_value fails.
reg_not_null() can be extended further, but I deem that out of scope for the fix at hand. Explicit base_type(...) != PTR_TO_BTF_ID checks in the check_cond_jmp_op() can be removed with migration to reg_not_null(), but that is a behavioural change, as the special case would start matching for PTR_TO_BTF_ID that is also is_trusted_reg(). I omit the behavioural change from this commit.
--- kernel/bpf/verifier.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
kernel/bpf/verifier.c +6 -3
@@ -405,6 +405,8 @@ static bool reg_not_null(const struct bpf_reg_state *reg) type =base_type (type);return type ==PTR_TO_SOCKET || type ==PTR_TO_TCP_SOCK || + type ==PTR_TO_XDP_SOCK || + type ==PTR_TO_BUF || type ==PTR_TO_MAP_VALUE || type ==PTR_TO_MAP_KEY || type == PTR_TO_SOCK_COMMON ||
@@ -16057,7 +16059,6 @@ static int check_cond_jmp_op(struct bpf_verifier_env *env,*/ if (!is_jmp32 &&BPF_SRC (insn->code) ==BPF_X &&__is_pointer_value (false, src_reg) &&__is_pointer_value (false, dst_reg) && -type_may_be_null (src_reg->type) !=type_may_be_null (dst_reg->type) &&base_type (src_reg->type) !=PTR_TO_BTF_ID &&base_type (dst_reg->type) !=PTR_TO_BTF_ID ) { eq_branch_regs =NULL ;
@@ -16073,9 +16074,11 @@ static int check_cond_jmp_op(struct bpf_verifier_env *env,break ; }if (eq_branch_regs) { -if (type_may_be_null (src_reg->type)) +/* src == dst && dst != NULL => src != NULL */ +if (reg_not_null (dst_reg) &&type_may_be_null (src_reg->type))mark_ptr_not_null_reg (&eq_branch_regs[insn->src_reg]); -else +/* src == dst && src != NULL => dst != NULL */ +if (reg_not_null (src_reg) &&type_may_be_null (dst_reg->type))mark_ptr_not_null_reg (&eq_branch_regs[insn->dst_reg]); } }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 799/869 printk: Dont WARN on kthread_run failure.
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tetsuo Handa <[email protected]>
[ Upstream commit 72dd0ec09e7cc98ed58ddeac26575e5d1ab8a93d ]
Since __kthread_create_on_node() returns -EINTR upon SIGKILL, we should not use WARN_ON() in order to catch kthread_run() failure.
--- kernel/printk/nbcon.c | 2 +- kernel/printk/printk.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
kernel/printk/nbcon.c +1 -1
@@ -1333,7 +1333,7 @@ bool nbcon_kthread_create(struct console *con)return true; kt =kthread_run (nbcon_kthread_func, con,"pr/%s%d" , con->name, con->index); -if (WARN_ON (IS_ERR (kt))) { +if (IS_ERR (kt)) {con_printk (KERN_ERR , con,"failed to start printing thread\n" );return false; }
kernel/printk/printk.c +1 -1
@@ -3638,7 +3638,7 @@ static bool legacy_kthread_create(void)lockdep_assert_console_list_lock_held (); kt =kthread_run (legacy_kthread_func,NULL ,"pr/legacy" ); -if (WARN_ON (IS_ERR (kt))) { +if (IS_ERR (kt)) {pr_err ("failed to start legacy printing thread\n" );return false; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 800/869 drm/gud: validate GUD_ROTATION_0 is present in supported rotations
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sajal Gupta <[email protected]>
[ Upstream commit cb732d027aa18e1fcf9d2797f47d20b179ebc59c ]
The rotation argument to drm_plane_create_rotation_property() is set to DRM_MODE_ROTATE_0, and the device reported rotation bitmask is used as the supported_rotations argument. The driver never validates that GUD_ROTATION_0 is present, so a device that omits it from its GUD_PROPERTY_ROTATION triggers theWARN_ON(rotation & ~supported_rotations) in drm_plane_create_rotation_property()
Fix this by skipping the creation of rotation property if the device doesn't have the GUD_ROTATION_0 bit
--- drivers/gpu/drm/gud/gud_drv.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/gud/gud_drv.c +2 -0
@@ -288,6 +288,8 @@ static int gud_get_properties(struct gud_device *gdrm)* but mask out any additions on future devices. */ val &=GUD_ROTATION_MASK ; +if (!(val &GUD_ROTATION_0 )) +continue ; ret =drm_plane_create_rotation_property (&gdrm->pipe.plane,DRM_MODE_ROTATE_0 , val);break ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 801/869 drm/virtio: Use drm_gem_plane_helper_prepare_fb()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dongwon Kim <[email protected]>
[ Upstream commit 30f86b8f86ada845fbd0d853b3a3d238567ac2c2 ]
Use drm_gem_plane_helper_prepare_fb() helper for explicit framebuffer synchronization. We need to wait for explicit fences in a case of Venus and native contexts when guest user space uses explicit fencing.
Stable-dep-of: 6a736d2f9d0c ("drm/virtio: use the DMA API for resource backing on Xen")
--- drivers/gpu/drm/virtio/virtgpu_plane.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/virtio/virtgpu_plane.c +4 -0
@@ -26,6 +26,7 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_damage_helper.h> #include <drm/drm_fourcc.h> +#include <drm/drm_gem_atomic_helper.h> #include "virtgpu_drv.h"
@@ -276,6 +277,9 @@ static int virtio_gpu_plane_prepare_fb(struct drm_plane *plane, vgfb =to_virtio_gpu_framebuffer (new_state->fb); vgplane_st =to_virtio_gpu_plane_state (new_state); bo =gem_to_virtio_gpu_obj (vgfb->base.obj[0 ]); + +drm_gem_plane_helper_prepare_fb (plane, new_state); +if (!bo || (plane->type ==DRM_PLANE_TYPE_PRIMARY && !bo->guest_blob))return 0 ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 802/869 drm/virtio: Add a helper to map and note the dma addrs and lengths
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vivek Kasireddy <[email protected]>
[ Upstream commit 25c3fd1183c0631d67cd126b2ba3e48388e15204 ]
This helper would be used when first initializing the object as part of import and also when updating the plane where we need to ensure that the imported object's backing is valid.
Stable-dep-of: 6a736d2f9d0c ("drm/virtio: use the DMA API for resource backing on Xen")
--- drivers/gpu/drm/virtio/virtgpu_drv.h | 5 +++ drivers/gpu/drm/virtio/virtgpu_prime.c | 42 ++++++++++++++++++++++++++ 2 files changed, 47 insertions(+)
drivers/gpu/drm/virtio/virtgpu_drv.h +5 -0
@@ -89,6 +89,7 @@ struct virtio_gpu_object_params {struct virtio_gpu_object {struct drm_gem_shmem_object base; +struct sg_table *sgt;uint32_t hw_res_handle;bool dumb;bool created;
@@ -476,6 +477,10 @@ struct drm_gem_object *virtgpu_gem_prime_import(struct drm_device *dev,struct drm_gem_object *virtgpu_gem_prime_import_sg_table (struct drm_device *dev,struct dma_buf_attachment *attach,struct sg_table *sgt); +int virtgpu_dma_buf_import_sgt (struct virtio_gpu_mem_entry **ents, +unsigned int *nents, +struct virtio_gpu_object *bo, +struct dma_buf_attachment *attach);/* virtgpu_debugfs.c */ void virtio_gpu_debugfs_init (struct drm_minor *minor);
drivers/gpu/drm/virtio/virtgpu_prime.c +42 -0
54 lines not on this page · raw message
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 803/869 drm/virtio: use the DMA API for resource backing on Xen
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Leggett <[email protected]>
[ Upstream commit 6a736d2f9d0c6e6217fe7532bc4c50ceca71db78 ]
On a Xen PV domain page addresses bear no relation to the real machine addresses the host would have to use to reach it. virtio_ring.c handles this correctly, vring_use_map_api() returns true for any xen_domain() regardless of VIRTIO_F_ACCESS_PLATFORM.
virtio-gpu makes the same decision independently, but its copy looks only at the feature bit:
bool use_dma_api = !virtio_has_dma_quirk(vgdev->vdev);
QEMU does not set iommu_platform on virtio-vga by default, so VIRTIO_F_ACCESS_PLATFORM is not negotiated, use_dma_api is false, and virtio_gpu_object_shmem_init() describes the framebuffer's backing pages to the host with sg_phys(). Those are guest-physical addresses. In a PV domain they resolve, on the host side, to pages belonging to some other domain, so the host scans out unrelated memory.
Move the decision into virtio_gpu_use_dma_api() and give it the xen_domain() check, like vring_use_map_api() has. This additionally enables the dma_sync_sgtable_for_device() calls in virtgpu_vq.c, which are required for correctness whenever swiotlb is in play.
Reproduced with a Xen 4.21 PV dom0 nested inside QEMU 8.2 with virtio-vga, on both a distro 6.8 kernel and 6.18 LTS. A PVH dom0 works fine and doesn't need this fix because it is identity-mapped, only PV dom0s are affected.
--- drivers/gpu/drm/virtio/virtgpu_drv.h | 20 ++++++++++++++++++++ drivers/gpu/drm/virtio/virtgpu_object.c | 2 +- drivers/gpu/drm/virtio/virtgpu_vq.c | 4 ++-- 3 files changed, 23 insertions(+), 3 deletions(-)
drivers/gpu/drm/virtio/virtgpu_drv.h +20 -0
@@ -43,6 +43,8 @@#include <drm/drm_probe_helper.h> #include <drm/virtgpu_drm.h> +#include <xen/xen.h> +#define DRIVER_NAME "virtio_gpu"#define DRIVER_DESC "virtio GPU"#define DRIVER_DATE "0"
@@ -61,6 +63,24 @@/* See virtio_gpu_ctx_create. One additional character for NULL terminator. */ #define DEBUG_NAME_MAX_LEN 65 +/* +* Whether the host must be told about resource backing pages by DMA address +* rather than guest-physical address. +* +* This mirrors vring_use_map_api() in drivers/virtio/virtio_ring.c, including +* its xen_domain() case. +*/ +static inline bool virtio_gpu_use_dma_api (const struct virtio_device *vdev) +{ +if (!virtio_has_dma_quirk (vdev)) +return true; + +if (xen_domain ()) +return true; + +return false; +} +struct virtio_gpu_object_params {unsigned long size;bool dumb;
drivers/gpu/drm/virtio/virtgpu_object.c +1 -1
@@ -137,7 +137,7 @@ static int virtio_gpu_object_shmem_init(struct virtio_gpu_device *vgdev,struct virtio_gpu_mem_entry **ents, unsigned int *nents) { - bool use_dma_api = !virtio_has_dma_quirk(vgdev->vdev); + bool use_dma_api = virtio_gpu_use_dma_api(vgdev->vdev);struct scatterlist *sg;struct sg_table *pages;int si;
drivers/gpu/drm/virtio/virtgpu_vq.c +2 -2
@@ -601,7 +601,7 @@ void virtio_gpu_cmd_transfer_to_host_2d(struct virtio_gpu_device *vgdev,struct virtio_gpu_object *bo =gem_to_virtio_gpu_obj (objs->objs[0 ]);struct virtio_gpu_transfer_to_host_2d *cmd_p;struct virtio_gpu_vbuffer *vbuf; -bool use_dma_api = !virtio_has_dma_quirk (vgdev->vdev); +bool use_dma_api =virtio_gpu_use_dma_api (vgdev->vdev);if (virtio_gpu_is_shmem (bo) && use_dma_api) dma_sync_sgtable_for_device(vgdev->vdev->dev.parent,
@@ -1020,7 +1020,7 @@ void virtio_gpu_cmd_transfer_to_host_3d(struct virtio_gpu_device *vgdev,struct virtio_gpu_object *bo =gem_to_virtio_gpu_obj (objs->objs[0 ]);struct virtio_gpu_transfer_host_3d *cmd_p;struct virtio_gpu_vbuffer *vbuf; -bool use_dma_api = !virtio_has_dma_quirk (vgdev->vdev); +bool use_dma_api =virtio_gpu_use_dma_api (vgdev->vdev);if (virtio_gpu_is_shmem (bo) && use_dma_api) dma_sync_sgtable_for_device(vgdev->vdev->dev.parent,
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 804/869 functionfs: fix the open/removal races
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Al Viro <[email protected]>
[ Upstream commit e5bf5ee266633cb18fff6f98f0b7d59a62819eee ]
ffs_epfile_open() can race with removal, ending up with file->private_data pointing to freed object.
There is a total count of opened files on functionfs (both ep0 and dynamic ones) and when it hits zero, dynamic files get removed. Unfortunately, that removal can happen while another thread is in ffs_epfile_open(), but has not incremented the count yet. In that case open will succeed, leaving us with UAF on any subsequent read() or write().
The root cause is that ffs->opened is misused; atomic_dec_and_test() vs. atomic_add_return() is not a good idea, when object remains visible all along.
To untangle that
* serialize openers on ffs->mutex (both for ep0 and for dynamic files)
* have dynamic ones use atomic_inc_not_zero() and fail if we had
zero ->opened; in that case the file we are opening is doomed.
* have the inodes of dynamic files marked on removal (from the
callback of simple_recursive_removal()) - clear ->i_private there.
* have open of dynamic ones verify they hadn't been already removed,
along with checking that state is FFS_ACTIVE.
--- drivers/usb/gadget/function/f_fs.c | 55 ++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 11 deletions(-)
drivers/usb/gadget/function/f_fs.c +44 -11
@@ -649,13 +649,22 @@ static ssize_t ffs_ep0_read(struct file *file, char __user *buf,static int ffs_ep0_open (struct inode *inode,struct file *file) { -struct ffs_data *ffs = inode->i_private; +struct ffs_data *ffs = inode->i_sb->s_fs_info; +int ret; -if (ffs->state ==FFS_CLOSING ) -return -EBUSY ; +/* Acquire mutex */ + ret =ffs_mutex_lock (&ffs->mutex, file->f_flags &O_NONBLOCK ); +if (ret <0 ) +return ret; - file->private_data = ffs;ffs_data_opened (ffs); +if (ffs->state ==FFS_CLOSING ) { +ffs_data_closed (ffs); +mutex_unlock (&ffs->mutex); +return -EBUSY ; + } +mutex_unlock (&ffs->mutex); + file->private_data = ffs;return stream_open (inode, file); }
@@ -1212,14 +1221,34 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data)static int ffs_epfile_open (struct inode *inode,struct file *file) { -struct ffs_epfile *epfile = inode->i_private; +struct ffs_data *ffs = inode->i_sb->s_fs_info; +struct ffs_epfile *epfile; +int ret; -if (WARN_ON (epfile->ffs->state !=FFS_ACTIVE )) +/* Acquire mutex */ + ret =ffs_mutex_lock (&ffs->mutex, file->f_flags &O_NONBLOCK ); +if (ret <0 ) +return ret; + +if (!atomic_inc_not_zero (&ffs->opened)) { +mutex_unlock (&ffs->mutex);return -ENODEV ; + } +ffs_data_get (ffs); +/* +* we want the state to be FFS_ACTIVE; FFS_ACTIVE alone is +* not enough, though - we might have been through FFS_CLOSING +* and back to FFS_ACTIVE, with our file already removed. +*/ + epfile =smp_load_acquire (&inode->i_private); +if (unlikely (ffs->state !=FFS_ACTIVE || !epfile)) { +mutex_unlock (&ffs->mutex); +ffs_data_closed (ffs); +return -ENODEV ; + } +mutex_unlock (&ffs->mutex); file->private_data = epfile; -ffs_data_opened (epfile->ffs); -return stream_open (inode, file); }
@@ -1368,7 +1397,7 @@ static void ffs_dmabuf_put(struct dma_buf_attachment *attach)static int ffs_epfile_release (struct inode *inode,struct file *file) { -struct ffs_epfile *epfile = inode->i_private; +struct ffs_epfile *epfile = file->private_data;struct ffs_dmabuf_priv *priv, *tmp;struct ffs_data *ffs = epfile->ffs;
@@ -2413,6 +2442,11 @@ static int ffs_epfiles_create(struct ffs_data *ffs)return 0 ; } +static void clear_one (struct dentry *dentry) +{ +smp_store_release (&dentry->d_inode->i_private,NULL ); +} +static void ffs_epfiles_destroy (struct ffs_epfile *epfiles,unsigned count) {struct ffs_epfile *epfile = epfiles;
@@ -2421,8 +2455,7 @@ static void ffs_epfiles_destroy(struct ffs_epfile *epfiles, unsigned count)BUG_ON (mutex_is_locked (&epfile->mutex));__ffs_epfile_read_buffer_free (epfile);if (epfile->dentry) { -d_delete (epfile->dentry); -dput (epfile->dentry); +simple_recursive_removal (epfile->dentry, clear_one); epfile->dentry =NULL ; } }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 805/869 ACPI: platform: Use acpi_bus_get_primary_device()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <[email protected]>
[ Upstream commit a9ba4dd2f18bf3f439d9ef0d8f375f90360ba1bd ]
The acpi_get_first_physical_node() usage in acpi_platform_fill_resource() and acpi_create_platform_device() is generally unsafe because in theory the device returned by it may be freed at any time [1].
It is also inefficient because acpi_get_first_physical_node() is called multiple times for the same argument which can be avoided.
Address these issues by using acpi_bus_get_primary_device() instead of acpi_get_first_physical_node() and adjusting the code to call it just once at the beginning of and acpi_create_platform_device() and drop the device reference acquired by it upon the return from that function.
--- drivers/acpi/acpi_platform.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
drivers/acpi/acpi_platform.c +7 -9
@@ -71,18 +71,15 @@ static struct notifier_block acpi_platform_notifier = { .notifier_call = acpi_platform_device_remove_notify, }; -static void acpi_platform_fill_resource (struct acpi_device *adev, -const struct resource *src,struct resource *dest) +static void acpi_platform_fill_resource (struct device *parent, +const struct resource *src, +struct resource *dest) { -struct device *parent; - *dest = *src; -/* * If the device has parent we need to take its resources into * account as well because this device might consume part of those. */ - parent =acpi_get_first_physical_node (acpi_dev_parent (adev));if (parent &&dev_is_pci (parent)) dest->parent =pci_find_resource (to_pci_dev (parent), dest); }
@@ -110,7 +107,8 @@ static unsigned int acpi_platform_resource_count(struct acpi_resource *ares, voistruct platform_device *acpi_create_platform_device (struct acpi_device *adev,const struct property_entry *properties) { -struct acpi_device *parent =acpi_dev_parent (adev); +struct acpi_device *p =acpi_dev_parent (adev); + struct device *parent __free(put_device) = acpi_bus_get_primary_device(p);struct platform_device *pdev =NULL ;struct platform_device_info pdevinfo;const struct acpi_device_id *match;
@@ -149,7 +147,7 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev, } count =0 ;list_for_each_entry (rentry, &resource_list, node) -acpi_platform_fill_resource (adev, rentry->res, +acpi_platform_fill_resource (parent, rentry->res, &resources[count++]);acpi_dev_free_resource_list (&resource_list);
@@ -161,7 +159,7 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev,* attached to it, that physical device should be the parent of the * platform device we are about to create. */ - pdevinfo.parent = parent ?acpi_get_first_physical_node (parent) :NULL ; + pdevinfo.parent = parent; pdevinfo.name =dev_name (&adev->dev); pdevinfo.id =PLATFORM_DEVID_NONE ; pdevinfo.res = resources;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 806/869 KVM: nSVM: Triple fault if restore host CR3 fails on nested #VMEXIT
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yosry Ahmed <[email protected]>
[ Upstream commit 5d291ef0585ed880ed4dd71ea1a5965e0a65fb53 ]
If loading L1's CR3 fails on a nested #VMEXIT, nested_svm_vmexit() returns an error code that is ignored by most callers, and continues to run L1 with corrupted state. A sane recovery is not possible in this case, and HW behavior is to cause a shutdown. Inject a triple fault instead, and do not return early from nested_svm_vmexit(). Continue cleaning up the vCPU state (e.g. clear pending exceptions), to handle the failure as gracefully as possible.
Quoted 1 line
From the APM:
Upon #VMEXIT, the processor performs the following actions in order to return to the host execution context:
...
if (illegal host state loaded, or exception while loading host state)
shutdown
else
execute first host instruction following the VMRUN
Remove the return value of nested_svm_vmexit(), which is mostly unchecked anyway.
--- arch/x86/kvm/svm/nested.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
arch/x86/kvm/svm/nested.c +2 -3
@@ -1163,9 +1163,8 @@ int nested_svm_vmexit(struct vcpu_svm *svm)nested_svm_uninit_mmu_context (vcpu); - rc =nested_svm_load_cr3 (vcpu, vmcb01->save.cr3, false, true); -if (rc) -return 1 ; +if (nested_svm_load_cr3 (vcpu, vmcb01->save.cr3, false, true)) +kvm_make_request (KVM_REQ_TRIPLE_FAULT , vcpu);/* * Drop what we picked up for L2 via svm_complete_interrupts() so it
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 807/869 greybus: raw: fix use-after-free if write is called after disconnect
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Damien Riégel <[email protected]>
[ Upstream commit 84265cbd96b97058ef67e3f8be3933667a000835 ]
If a user writes to the chardev after disconnect has been called, the kernel panics with the following trace (with CONFIG_INIT_ON_FREE_DEFAULT_ON=y):
BUG: kernel NULL pointer dereference, address: 0000000000000218
...
Call Trace:
<TASK>
gb_operation_create_common+0x61/0x180
gb_operation_create_flags+0x28/0xa0
gb_operation_sync_timeout+0x6f/0x100
raw_write+0x7b/0xc7 [gb_raw]
vfs_write+0xcf/0x420
? task_mm_cid_work+0x136/0x220
ksys_write+0x63/0xe0
do_syscall_64+0xa4/0x290
entry_SYSCALL_64_after_hwframe+0x77/0x7fDisconnect calls gb_connection_destroy, which ends up freeing the connection object. When gb_operation_sync is called in the write file operations, its gets a freed connection as parameter and the kernel panics.
The gb_connection_destroy cannot be moved out of the disconnect function, as the Greybus subsystem expect all connections belonging to a bundle to be destroyed when disconnect returns.
To prevent this bug, use a rw lock to synchronize access between write and disconnect. This guarantees that the write function doesn't try to use a disconnected connection.
--- drivers/staging/greybus/raw.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
drivers/staging/greybus/raw.c +21 -2
@@ -21,6 +21,8 @@ struct gb_raw {struct list_head list;int list_data;struct mutex list_lock; +struct rw_semaphore disconnect_lock; +bool disconnected;struct cdev cdev;struct device dev; };
@@ -200,6 +202,7 @@ static int gb_raw_probe(struct gb_bundle *bundle,INIT_LIST_HEAD (&raw->list);mutex_init (&raw->list_lock); +init_rwsem (&raw->disconnect_lock); raw->connection = connection;greybus_set_drvdata (bundle, raw);
@@ -235,6 +238,11 @@ static void gb_raw_disconnect(struct gb_bundle *bundle)struct raw_data *temp;cdev_device_del (&raw->cdev, &raw->dev); + +down_write (&raw->disconnect_lock); + raw->disconnected = true; +up_write (&raw->disconnect_lock); +gb_connection_disable (connection);gb_connection_destroy (connection);
@@ -277,11 +285,22 @@ static ssize_t raw_write(struct file *file, const char __user *buf,if (count >MAX_PACKET_SIZE )return -E2BIG ; +down_read (&raw->disconnect_lock); + +if (raw->disconnected) { + retval = -ENODEV ; + goto exit; + } + retval =gb_raw_send (raw, count, buf);if (retval) -return retval; + goto exit; -return count; + retval = count; +exit: +up_read (&raw->disconnect_lock); + +return retval; } static ssize_t raw_read(struct file *file, char __user *buf, size_t count,
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 808/869 firmware: arm_ffa: Add support for IMPDEF value in the memory access descriptor
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sudeep Holla <[email protected]>
[ Upstream commit 11fb1a82aefa6f7fea6ac82334edb5639b9927df ]
FF-A v1.2 introduced 16 byte IMPLEMENTATION DEFINED value in the endpoint memory access descriptor to allow any sender could to specify an its any custom value for each receiver. Also this value must be specified by the receiver when retrieving the memory region. The sender must ensure it informs the receiver of this value via an IMPLEMENTATION DEFINED mechanism such as a partition message.
So the FF-A driver can use the message interfaces to communicate the value and set the same in the ffa_mem_region_attributes structures when using the memory interfaces.
The driver ensure that the size of the endpoint memory access descriptors is set correctly based on the FF-A version.
Message-Id: <[email protected]>
Stable-dep-of: b4d961351aa8 ("firmware: arm_ffa: Fix Endpoint Memory Access Descriptor offset calculation")
--- drivers/firmware/arm_ffa/driver.c | 39 ++++++++++++++++++++++--------- include/linux/arm_ffa.h | 22 +++++++++++++++-- 2 files changed, 48 insertions(+), 13 deletions(-)
drivers/firmware/arm_ffa/driver.c +28 -11
@@ -613,6 +613,26 @@ static u16 ffa_memory_attributes_get(u32 func_id)return FFA_MEM_NORMAL |FFA_MEM_WRITE_BACK |FFA_MEM_INNER_SHAREABLE ; } +static void ffa_emad_impdef_value_init (u32 version,void *dst,void *src) +{ +struct ffa_mem_region_attributes *ep_mem_access; + +if (FFA_EMAD_HAS_IMPDEF_FIELD (version)) +memcpy (dst, src,sizeof (ep_mem_access->impdef_val)); +} + +static void +ffa_mem_region_additional_setup (u32 version,struct ffa_mem_region *mem_region) +{ +if (!FFA_MEM_REGION_HAS_EP_MEM_OFFSET (version)) { + mem_region->ep_mem_size =0 ; + }else { + mem_region->ep_mem_size =ffa_emad_size_get (version); + mem_region->ep_mem_offset =sizeof (*mem_region); +memset (mem_region->reserved,0 ,12 ); + } +} +static int ffa_setup_and_transmit (u32 func_id,void *buffer,u32 max_fragsize,struct ffa_mem_ops_args *args)
@@ -631,26 +651,23 @@ ffa_setup_and_transmit(u32 func_id, void *buffer, u32 max_fragsize, mem_region->flags = args->flags; mem_region->sender_id = drv_info->vm_id; mem_region->attributes =ffa_memory_attributes_get (func_id); - ep_mem_access = buffer + -ffa_mem_desc_offset (buffer,0 , drv_info->version); composite_offset =ffa_mem_desc_offset (buffer, args->nattrs, drv_info->version); -for (idx =0 ; idx < args->nattrs; idx++, ep_mem_access++) { -memset (ep_mem_access,0 ,sizeof (*ep_mem_access)); +for (idx =0 ; idx < args->nattrs; idx++) { + ep_mem_access = buffer + +ffa_mem_desc_offset (buffer, idx, drv_info->version); +memset (ep_mem_access,0 ,ffa_emad_size_get (drv_info->version)); ep_mem_access->receiver = args->attrs[idx].receiver; ep_mem_access->attrs = args->attrs[idx].attrs; ep_mem_access->composite_off = composite_offset; +ffa_emad_impdef_value_init (drv_info->version, + ep_mem_access->impdef_val, + args->attrs[idx].impdef_val); } mem_region->handle =0 ; mem_region->ep_count = args->nattrs; -if (drv_info->version <=FFA_VERSION_1_0 ) { - mem_region->ep_mem_size =0 ; - }else { - mem_region->ep_mem_size =sizeof (*ep_mem_access); - mem_region->ep_mem_offset =sizeof (*mem_region); -memset (mem_region->reserved,0 ,12 ); - } +ffa_mem_region_additional_setup (drv_info->version, mem_region); composite = buffer + composite_offset; composite->total_pg_cnt =ffa_get_num_pages_sg (args->sg);
include/linux/arm_ffa.h +20 -2
@@ -112,6 +112,7 @@ FIELD_PREP(FFA_MINOR_VERSION_MASK, (minor)))#define FFA_VERSION_1_0 FFA_PACK_VERSION_INFO(1, 0)#define FFA_VERSION_1_1 FFA_PACK_VERSION_INFO(1, 1) +#define FFA_VERSION_1_2 FFA_PACK_VERSION_INFO(1, 2)/** * FF-A specification mentions explicitly about '4K pages'. This should
@@ -326,6 +327,7 @@ struct ffa_mem_region_attributes {* an `struct ffa_mem_region_addr_range`. */ u32 composite_off; +u8 impdef_val[16 ];u64 reserved; };
@@ -405,15 +407,31 @@ struct ffa_mem_region {#define CONSTITUENTS_OFFSET (x) \ (offsetof(struct ffa_composite_mem_region, constituents[x])) +#define FFA_EMAD_HAS_IMPDEF_FIELD (version) ((version) >= FFA_VERSION_1_2) +#define FFA_MEM_REGION_HAS_EP_MEM_OFFSET (version) ((version) > FFA_VERSION_1_0) + +static inline u32 ffa_emad_size_get (u32 ffa_version) +{ +u32 sz; +struct ffa_mem_region_attributes *ep_mem_access; + +if (FFA_EMAD_HAS_IMPDEF_FIELD (ffa_version)) + sz =sizeof (*ep_mem_access); +else + sz =sizeof (*ep_mem_access) -sizeof (ep_mem_access->impdef_val); + +return sz; +} +static inline u32 ffa_mem_desc_offset (struct ffa_mem_region *buf,int count,u32 ffa_version) { -u32 offset = count *sizeof (struct ffa_mem_region_attributes ); +u32 offset = count *ffa_emad_size_get (ffa_version);/* * Earlier to v1.1, the endpoint memory descriptor array started at * offset 32(i.e. offset of ep_mem_offset in the current structure) */ -if (ffa_version <=FFA_VERSION_1_0 ) +if (!FFA_MEM_REGION_HAS_EP_MEM_OFFSET (ffa_version)) offset += offsetof(struct ffa_mem_region , ep_mem_offset);else offset +=sizeof (struct ffa_mem_region );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 809/869 firmware: arm_ffa: Fix Endpoint Memory Access Descriptor offset calculation
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Ene <[email protected]>
[ Upstream commit b4d961351aa84fdf0148783fb1f3a1391b8a0adb ]
Use the descriptor's ep_mem_offset to calculate the start of the endpoint memory access array and to comply with the FF-A spec instead of defaulting to sizeof(struct ffa_mem_region).
This requires moving ffa_mem_region_additional_setup() earlier in the setup flow.
Also, add sanity checks to ensure the calculated descriptor offsets do not exceed max_fragsize.
--- drivers/firmware/arm_ffa/driver.c | 20 +++++++++++++++----- include/linux/arm_ffa.h | 2 +- 2 files changed, 16 insertions(+), 6 deletions(-)
drivers/firmware/arm_ffa/driver.c +15 -5
@@ -645,19 +645,30 @@ ffa_setup_and_transmit(u32 func_id, void *buffer, u32 max_fragsize,struct ffa_composite_mem_region *composite;struct ffa_mem_region_addr_range *constituents;struct ffa_mem_region_attributes *ep_mem_access; -u32 idx, frag_len, length, buf_sz =0 , num_entries =sg_nents (args->sg); +u32 idx, frag_len, length, buf_sz =0 , num_entries =sg_nents (args->sg), ep_offset; +u32 emad_end, emad_size =ffa_emad_size_get (drv_info->version); mem_region->tag = args->tag; mem_region->flags = args->flags; mem_region->sender_id = drv_info->vm_id; mem_region->attributes =ffa_memory_attributes_get (func_id); + +ffa_mem_region_additional_setup (drv_info->version, mem_region); composite_offset =ffa_mem_desc_offset (buffer, args->nattrs, drv_info->version); +if (composite_offset +sizeof (*composite) > max_fragsize) +return -ENXIO ;for (idx =0 ; idx < args->nattrs; idx++) { - ep_mem_access = buffer + -ffa_mem_desc_offset (buffer, idx, drv_info->version); -memset (ep_mem_access,0 ,ffa_emad_size_get (drv_info->version)); + ep_offset =ffa_mem_desc_offset (buffer, idx, drv_info->version); +if (check_add_overflow (ep_offset, emad_size, &emad_end)) +return -ENXIO ; + +if (emad_end > max_fragsize) +return -ENXIO ; + + ep_mem_access = buffer + ep_offset; +memset (ep_mem_access,0 , emad_size); ep_mem_access->receiver = args->attrs[idx].receiver; ep_mem_access->attrs = args->attrs[idx].attrs; ep_mem_access->composite_off = composite_offset;
@@ -667,7 +678,6 @@ ffa_setup_and_transmit(u32 func_id, void *buffer, u32 max_fragsize, } mem_region->handle =0 ; mem_region->ep_count = args->nattrs; -ffa_mem_region_additional_setup (drv_info->version, mem_region); composite = buffer + composite_offset; composite->total_pg_cnt =ffa_get_num_pages_sg (args->sg);
include/linux/arm_ffa.h +1 -1
@@ -434,7 +434,7 @@ ffa_mem_desc_offset(struct ffa_mem_region *buf, int count, u32 ffa_version)if (!FFA_MEM_REGION_HAS_EP_MEM_OFFSET (ffa_version)) offset += offsetof(struct ffa_mem_region , ep_mem_offset);else - offset +=sizeof (struct ffa_mem_region ); + offset += buf->ep_mem_offset;return offset; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 810/869 pmdomain: imx93-blk-ctrl: Extract PHY as shared domain for DSI/CSI
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guoniu Zhou <[email protected]>
[ Upstream commit 99611233f8cda833169fa6487d5dacdf189e5cb0 ]
The MIPI DSI and CSI domains share control bits for clock and reset, which can lead to incorrect behavior if one domain disables the shared resource while the other is still active.
To fix the issue, introduce a shared MIPI PHY power domain to own the common resources and make DSI and CSI its subdomains. This ensures the shared bits are properly managed and not disabled while still in use.
--- drivers/pmdomain/imx/imx93-blk-ctrl.c | 60 +++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 3 deletions(-)
drivers/pmdomain/imx/imx93-blk-ctrl.c +57 -3
@@ -47,6 +47,8 @@#define PRIO (X ) (X) +#define BLK_CTRL_NO_PARENT UINT_MAX +struct imx93_blk_ctrl_domain ;struct imx93_blk_ctrl {
@@ -73,6 +75,7 @@ struct imx93_blk_ctrl_domain_data {int num_clks;u32 rst_mask;u32 clk_mask; +u32 parent;int num_qos;struct imx93_blk_ctrl_qos qos[DOMAIN_MAX_QOS ]; };
@@ -287,18 +290,46 @@ static int imx93_blk_ctrl_probe(struct platform_device *pdev) bc->onecell_data.domains[i] = &domain->genpd; } +for (i =0 ; i < bc_data->num_domains; i++) { +struct imx93_blk_ctrl_domain *domain = &bc->domains[i]; +const struct imx93_blk_ctrl_domain_data *data = domain->data; + +if (data->parent ==BLK_CTRL_NO_PARENT ) +continue ; + + ret =pm_genpd_add_subdomain (&bc->domains[data->parent].genpd, + &domain->genpd); +if (ret) { +dev_err_probe (dev, ret,"failed to add subdomain %s\n" , + domain->genpd.name); + goto cleanup_subdomains; + } + } +pm_runtime_enable (dev); ret =of_genpd_add_provider_onecell (dev->of_node, &bc->onecell_data);if (ret) {dev_err_probe (dev, ret,"failed to add power domain provider\n" ); - goto cleanup_pds; + goto cleanup_subdomains; }dev_set_drvdata (dev, bc);return 0 ; +cleanup_subdomains: +for (i--; i >=0 ; i--) { +const struct imx93_blk_ctrl_domain_data *data = bc->domains[i].data; + +if (data->parent ==BLK_CTRL_NO_PARENT ) +continue ; + +pm_genpd_remove_subdomain (&bc->domains[data->parent].genpd, + &bc->domains[i].genpd); + } + i = bc_data->num_domains; + cleanup_pds:for (i--; i >=0 ; i--)pm_genpd_remove (&bc->domains[i].genpd);
@@ -315,6 +346,16 @@ static void imx93_blk_ctrl_remove(struct platform_device *pdev)pm_runtime_disable (&pdev->dev); +for (i =0 ; i < bc->onecell_data.num_domains; i++) { +struct imx93_blk_ctrl_domain *domain = &bc->domains[i]; + +if (domain->data->parent ==BLK_CTRL_NO_PARENT ) +continue ; + +pm_genpd_remove_subdomain (&bc->domains[domain->data->parent].genpd, + &domain->genpd); + } +for (i =0 ; i < bc->onecell_data.num_domains; i++) {struct imx93_blk_ctrl_domain *domain = &bc->domains[i];
@@ -327,8 +368,9 @@ static const struct imx93_blk_ctrl_domain_data imx93_media_blk_ctl_domain_data[] .name = "mediablk-mipi-dsi", .clk_names = (const char *[]){ "dsi" }, .num_clks = 1, - .rst_mask = BIT(11) | BIT(12), - .clk_mask = BIT(11) | BIT(12), + .rst_mask = BIT(11), + .clk_mask = BIT(11), + .parent = IMX93_MEDIABLK_PD_MIPI_PHY, }, [IMX93_MEDIABLK_PD_MIPI_CSI] = { .name = "mediablk-mipi-csi",
@@ -336,6 +378,7 @@ static const struct imx93_blk_ctrl_domain_data imx93_media_blk_ctl_domain_data[] .num_clks = 2, .rst_mask = BIT(9) | BIT(10), .clk_mask = BIT(9) | BIT(10), + .parent = IMX93_MEDIABLK_PD_MIPI_PHY, }, [IMX93_MEDIABLK_PD_PXP] = { .name = "mediablk-pxp",
@@ -343,6 +386,7 @@ static const struct imx93_blk_ctrl_domain_data imx93_media_blk_ctl_domain_data[] .num_clks = 1, .rst_mask = BIT(7) | BIT(8), .clk_mask = BIT(7) | BIT(8), + .parent = BLK_CTRL_NO_PARENT, .num_qos = 2, .qos = { {
@@ -364,6 +408,7 @@ static const struct imx93_blk_ctrl_domain_data imx93_media_blk_ctl_domain_data[] .num_clks = 2, .rst_mask = BIT(4) | BIT(5) | BIT(6), .clk_mask = BIT(4) | BIT(5) | BIT(6), + .parent = BLK_CTRL_NO_PARENT, .num_qos = 1, .qos = { {
@@ -380,6 +425,7 @@ static const struct imx93_blk_ctrl_domain_data imx93_media_blk_ctl_domain_data[] .num_clks = 1, .rst_mask = BIT(2) | BIT(3), .clk_mask = BIT(2) | BIT(3), + .parent = BLK_CTRL_NO_PARENT, .num_qos = 4, .qos = { {
@@ -405,6 +451,14 @@ static const struct imx93_blk_ctrl_domain_data imx93_media_blk_ctl_domain_data[] } } }, + [IMX93_MEDIABLK_PD_MIPI_PHY ] = { + .name ="mediablk-mipi-phy" , + .clk_names =NULL , + .num_clks =0 , + .rst_mask =BIT (12 ), + .clk_mask =BIT (12 ), + .parent =BLK_CTRL_NO_PARENT , + }, };static const struct regmap_range imx93_media_blk_ctl_yes_ranges[] = {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 811/869 cxl/region: Resolve region deletion races
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Williams <[email protected]>
[ Upstream commit 4dd86ca99ffcc413cbf79063fd9956ef54e0ca91 ]
Sungwoo noticed that the sysfs trigger to delete a region may try to delete a region multiple times. It also has no exclusion relative to the kernel releasing the region via CXL root device teardown.
Instead of installing new cxl root devres actions per region, use the existing root decoder unregistration event to remove all remaining regions. An xarray of regions replaces a devres list of regions.
This handles 3 separate issues with the old approach:
1/ sysfs users racing to delete the same region: no longer possible now
that the regions_lock is held over the lookup and deletion.
2/ multiple actions triggering deletion of the same region: solved by
erasing regions while holding @regions_lock, and only proceeding on successful erasure.
3/ userspace racing devres_release_all() to trigger the devres not found
warning: solved by sysfs unregistration not requiring a release action
--- drivers/cxl/core/core.h | 2 ++ drivers/cxl/core/port.c | 5 ++++ drivers/cxl/core/region.c | 62 ++++++++++++++++++++++----------------- drivers/cxl/cxl.h | 4 +++ 4 files changed, 46 insertions(+), 27 deletions(-)
drivers/cxl/core/core.h +2 -0
@@ -32,6 +32,7 @@ int cxl_get_poison_by_endpoint(struct cxl_port *port);struct cxl_region *cxl_dpa_to_region (const struct cxl_memdev *cxlmd,u64 dpa);u64 cxl_dpa_to_hpa (struct cxl_region *cxlr,const struct cxl_memdev *cxlmd,u64 dpa); +void kill_regions (struct cxl_root_decoder *cxlrd);#else static inline u64 cxl_dpa_to_hpa(struct cxl_region *cxlr,
@@ -58,6 +59,7 @@ static inline int cxl_region_init(void)static inline void cxl_region_exit (void ) { } +static inline void kill_regions (struct cxl_root_decoder *cxlrd) { };#define CXL_REGION_ATTR (x) NULL#define CXL_REGION_TYPE (x) NULL#define SET_CXL_REGION_ATTR (x)
drivers/cxl/core/port.c +5 -0
@@ -445,6 +445,8 @@ static void cxl_root_decoder_release(struct device *dev)if (atomic_read (&cxlrd->region_id) >=0 )memregion_free (atomic_read (&cxlrd->region_id)); +mutex_destroy (&cxlrd->regions_lock); +xa_destroy (&cxlrd->regions);__cxl_decoder_release (&cxlrd->cxlsd.cxld);kfree (cxlrd); }
@@ -1826,6 +1828,7 @@ struct cxl_root_decoder *cxl_root_decoder_alloc(struct cxl_port *port, }mutex_init (&cxlrd->regions_lock); +xa_init (&cxlrd->regions); cxld = &cxlsd->cxld; cxld->dev.type = &cxl_decoder_root_type;
@@ -2009,6 +2012,8 @@ static void cxld_unregister(void *dev) cxled =to_cxl_endpoint_decoder (dev);cxl_decoder_kill_region (cxled); } +if (is_root_decoder (dev)) +kill_regions (to_cxl_root_decoder (dev));device_unregister (dev); }
drivers/cxl/core/region.c +35 -27
127 lines not on this page · raw message
drivers/cxl/cxl.h +4 -0
@@ -453,6 +453,8 @@ typedef u64 (*cxl_hpa_to_spa_fn)(struct cxl_root_decoder *cxlrd, u64 hpa);* @hpa_to_spa: translate CXL host-physical-address to Platform system-physical-address * @platform_data: platform specific configuration data * @regions_lock: sync region discovery, construction, and deletion +* @regions: regions to remove at root decoder destruct time +* @dead: root decoder dead to region creation * @qos_class: QoS performance class cookie * @cxlsd: base cxl switch decoder */
@@ -462,6 +464,8 @@ struct cxl_root_decoder {cxl_hpa_to_spa_fn hpa_to_spa;void *platform_data;struct mutex regions_lock; +struct xarray regions; +bool dead;int qos_class;struct cxl_switch_decoder cxlsd; };
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 812/869 bpf: Remove migrate_{disable|enable} in bpf_obj_free_fields()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hou Tao <[email protected]>
[ Upstream commit 1d2dbe7120e89090ed4f6be03d6fbadfbfff59bf ]
The callers of bpf_obj_free_fields() have already guaranteed that the migration is disabled, therefore, there is no need to invoke migrate_{disable,enable} pair in bpf_obj_free_fields()'s underly implementation.
This patch removes unnecessary migrate_{disable|enable} pairs from bpf_obj_free_fields() and its callees: bpf_list_head_free() and bpf_rb_root_free().
Stable-dep-of: 4a7910ee060d ("bpf: Clear rb node linkage when freeing bpf_rb_root")
--- kernel/bpf/helpers.c | 4 ---- kernel/bpf/syscall.c | 2 -- 2 files changed, 6 deletions(-)
kernel/bpf/helpers.c +0 -4
@@ -2100,9 +2100,7 @@ void bpf_list_head_free(const struct btf_field *field, void *list_head,/* The contained type can also have resources, including a * bpf_list_head which needs to be freed. */ -migrate_disable ();__bpf_obj_drop_impl (obj, field->graph_root.value_rec, false); -migrate_enable (); } }
@@ -2139,9 +2137,7 @@ void bpf_rb_root_free(const struct btf_field *field, void *rb_root, obj -= field->graph_root.node_offset; -migrate_disable ();__bpf_obj_drop_impl (obj, field->graph_root.value_rec, false); -migrate_enable (); } }
kernel/bpf/syscall.c +0 -2
@@ -707,11 +707,9 @@ void bpf_obj_free_fields(const struct btf_record *rec, void *obj)if (!btf_is_kernel (field->kptr.btf)) { pointee_struct_meta =btf_find_struct_meta (field->kptr.btf, field->kptr.btf_id); -migrate_disable ();__bpf_obj_drop_impl (xchgd_field, pointee_struct_meta ? pointee_struct_meta->record :NULL , fields[i].type ==BPF_KPTR_PERCPU ); -migrate_enable (); }else { field->kptr.dtor (xchgd_field); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 813/869 bpf: Clear rb node linkage when freeing bpf_rb_root
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kaitao Cheng <[email protected]>
[ Upstream commit 4a7910ee060d8ce55612f5b3cc267f3a265a3cec ]
bpf_rb_root_free() detaches the root by copying the current rb_root_cached and then replacing the live root with RB_ROOT_CACHED. It then walks the copied root and drops each object contained in the tree.
This leaves the rb node state intact while dropping the object. If the object is refcounted and survives the drop, its bpf_rb_node_kern still contains an owner pointer to the freed root and stale rb tree linkage. If a later bpf_rb_root allocation reuses the same address, bpf_rbtree_remove() can incorrectly pass the owner check and call rb_erase_cached() on a node whose rb pointers belong to the old tree.
Mirror the list draining behavior by marking nodes as busy while the root is being detached, then clear the rb node and release the owner before dropping the containing object. This makes surviving nodes unowned and safe to reject from remove or accept for a later add.
--- kernel/bpf/helpers.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
kernel/bpf/helpers.c +9 -2
@@ -2121,6 +2121,7 @@ void bpf_rb_root_free(const struct btf_field *field, void *rb_root, struct bpf_spin_lock *spin_lock) {struct rb_root_cached orig_root, *root = rb_root; +struct bpf_rb_node_kern *node;struct rb_node *pos, *n;void *obj;
@@ -2129,14 +2130,20 @@ void bpf_rb_root_free(const struct btf_field *field, void *rb_root,__bpf_spin_lock_irqsave (spin_lock); orig_root = *root; +bpf_rbtree_postorder_for_each_entry_safe (pos, n, &orig_root.rb_root) { + node = rb_entry(pos, struct bpf_rb_node_kern, rb_node); +WRITE_ONCE (node->owner,BPF_PTR_POISON ); + } *root =RB_ROOT_CACHED ;__bpf_spin_unlock_irqrestore (spin_lock);bpf_rbtree_postorder_for_each_entry_safe (pos, n, &orig_root.rb_root) { obj = pos; obj -= field->graph_root.node_offset; - - + node = rb_entry(pos, struct bpf_rb_node_kern, rb_node); +RB_CLEAR_NODE (pos); +/* Ensure __bpf_rbtree_add() sees the node as unlinked. */ +smp_store_release (&node->owner,NULL );__bpf_obj_drop_impl (obj, field->graph_root.value_rec, false); } }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 814/869 ocfs2: validate external xattr entries when reading metadata
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang <[email protected]>
[ Upstream commit 2cf82b46d5e43be0dfbaac7fa1073cec2fc1f5e6 ]
ocfs2_validate_xattr_block() checks the xattr block header before the block reaches higher-level xattr users, but it does not verify that a non-indexed block's xh_count and entry offsets fit inside the block. Indexed buckets likewise reach list/get consumers after ECC without an entry-bounds check.
Use the flat xattr entry validator for non-indexed external xattr blocks, and use a bucket-specific validator for indexed buckets at metadata read time. The bucket validator keeps the entry array bounded by the first bucket block while checking name/value offsets against the bucket block they target.
Reject corrupted external xattr metadata before listxattr() or getxattr() can walk out-of-range entry arrays or name/value offsets.
Validation reproduced this kernel report:
BUG: KASAN: use-after-free in ocfs2_xattr_list_entries+0xd7/0x190 Read of size 1 at addr ffff88810a654007 by task ocfs2_xattr_lis/630 Call Trace: dump_stack_lvl+0x66/0xa0 print_report+0xce/0x630 kasan_report+0xe0/0x110 ocfs2_xattr_list_entries+0xd7/0x190 ocfs2_listxattr+0x3f6/0x610 listxattr+0x90/0xe0 path_listxattrat+0xed/0x220 do_syscall_64+0x115/0x6a0 entry_SYSCALL_64_after_hwframe+0x77/0x7f
--- fs/ocfs2/xattr.c | 97 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+)
fs/ocfs2/xattr.c +97 -0
@@ -386,6 +386,12 @@ static int ocfs2_init_xattr_bucket(struct ocfs2_xattr_bucket *bucket,return rc; } +static int ocfs2_validate_xattr_entries_flat (struct super_block *sb,u64 blkno, +struct ocfs2_xattr_header *xh, +size_t region_size); +static int ocfs2_validate_xattr_bucket (struct ocfs2_xattr_bucket *bucket, +u64 blkno); +/* Read the xattr bucket at xb_blkno */ static int ocfs2_read_xattr_bucket (struct ocfs2_xattr_bucket *bucket,u64 xb_blkno)
@@ -404,6 +410,8 @@ static int ocfs2_read_xattr_bucket(struct ocfs2_xattr_bucket *bucket,spin_unlock (&OCFS2_SB (bucket->bu_inode->i_sb)->osb_xattr_lock);if (rc)mlog_errno (rc); +else + rc =ocfs2_validate_xattr_bucket (bucket, xb_blkno); }if (rc)
@@ -505,6 +513,22 @@ static int ocfs2_validate_xattr_block(struct super_block *sb, le32_to_cpu(xb->xb_fs_generation)); } +if (!(le16_to_cpu (xb->xb_flags) &OCFS2_XATTR_INDEXED )) { +size_t region_offset = + offsetof(struct ocfs2_xattr_block, xb_attrs.xb_header); + +if (bh->b_size < region_offset) +return ocfs2_error (sb, +"Invalid xattr block %llu: block size %zu is too small\n" , + (unsigned long long )bh->b_blocknr, + bh->b_size); + +return ocfs2_validate_xattr_entries_flat (sb, bh->b_blocknr, + &xb->xb_attrs.xb_header, + bh->b_size - + region_offset); + } +return 0 ; }
@@ -1071,6 +1095,79 @@ int ocfs2_validate_inode_xattr(struct super_block *sb, u64 blkno,return ocfs2_validate_xattr_entries_flat (sb, blkno, xh, inline_size); } +static int ocfs2_validate_xattr_bucket (struct ocfs2_xattr_bucket *bucket, +u64 blkno) +{ +struct super_block *sb = bucket->bu_inode->i_sb; +struct ocfs2_xattr_header *xh =bucket_xh (bucket); +u16 xattr_count =le16_to_cpu (xh->xh_count); +size_t region_size = (size_t )sb->s_blocksize * bucket->bu_blocks; +size_t entries_limit = sb->s_blocksize; +size_t nv_limit = sb->s_blocksize; +size_t max_entries; +int i; + +if (region_size <sizeof (*xh)) +return ocfs2_error (sb, +"Invalid xattr bucket %llu: region size %zu is too small\n" , + (unsigned long long )blkno, region_size); + +if (entries_limit <sizeof (*xh)) +return ocfs2_error (sb, +"Invalid xattr bucket %llu: entries limit %zu is too small\n" , + (unsigned long long )blkno, + entries_limit); + + max_entries = (entries_limit -sizeof (*xh)) / +sizeof (struct ocfs2_xattr_entry ); + +if (xattr_count > max_entries) +return ocfs2_error (sb, +"Invalid xattr bucket %llu: entry count %u exceeds maximum %zu\n" , + (unsigned long long )blkno, + xattr_count, max_entries); + +for (i =0 ; i < xattr_count; i++) { +struct ocfs2_xattr_entry *xe = &xh->xh_entries[i]; +size_t name_offset =le16_to_cpu (xe->xe_name_offset); +size_t block_off = name_offset >> sb->s_blocksize_bits; +size_t block_offset = name_offset % nv_limit; +size_t value_offset; + +if (name_offset >= region_size || block_off >= bucket->bu_blocks) +return ocfs2_error (sb, +"Invalid xattr bucket %llu: entry %d name is out of bounds\n" , + (unsigned long long )blkno, i); + +if (xe->xe_name_len > nv_limit - block_offset) +return ocfs2_error (sb, +"Invalid xattr bucket %llu: entry %d name crosses block boundary\n" , + (unsigned long long )blkno, i); + + value_offset = block_offset +OCFS2_XATTR_SIZE (xe->xe_name_len); +if (value_offset > nv_limit) +return ocfs2_error (sb, +"Invalid xattr bucket %llu: entry %d value starts out of bounds\n" , + (unsigned long long )blkno, i); + +if (ocfs2_xattr_is_local (xe)) { +if (le64_to_cpu (xe->xe_value_size) > + nv_limit - value_offset) +return ocfs2_error (sb, +"Invalid xattr bucket %llu: entry %d value is out of bounds\n" , + (unsigned long long )blkno, + i); + }else if (sizeof (struct ocfs2_xattr_value_root ) > + nv_limit - value_offset) { +return ocfs2_error (sb, +"Invalid xattr bucket %llu: entry %d value root is out of bounds\n" , + (unsigned long long )blkno, i); + } + } + +return 0 ; +} +int ocfs2_has_inline_xattr_value_outside (struct inode *inode,struct ocfs2_dinode *di) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 815/869 dm-integrity: replace forgeable discard filler with a keyed sector marker
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shukai Ni <[email protected]>
[ Upstream commit 68c5c42567bc462139128968ebbfadd0aefff519 ]
The discard-block check in dm_integrity_rw_tag() treats a stored tag of all 0xf6 bytes (DISCARD_FILLER) as proof a block was discarded and skips HMAC verification. allow_discards is only accepted in dm-integrity's standalone mode. An attacker with raw write access to the backing device, but without the integrity key, can stamp any block with an all-0xf6 tag and have it served as authentic.
Add a new "allow_discards_keyed" target argument that marks discarded blocks with a keyed checksum of (salt || sector) instead, computed by integrity_discard_checksum().
--- .../admin-guide/device-mapper/dm-ima.rst | 7 +- .../device-mapper/dm-integrity.rst | 13 +++ drivers/md/dm-integrity.c | 110 +++++++++++++++--- 3 files changed, 114 insertions(+), 16 deletions(-)
Documentation/admin-guide/device-mapper/dm-ima.rst +5 -2
@@ -424,7 +424,8 @@ section above) has the following data format for 'integrity' target. target_attributes := <target_name> "," <target_version> "," <dev_name> "," <start> <tag_size> "," <mode> "," [<meta_device> ","] [<block_size> ","] <recalculate> "," - <allow_discards> "," <fix_padding> "," <fix_hmac> "," <legacy_recalculate> "," + <allow_discards> "," <allow_discards_keyed> "," <fix_padding> "," <fix_hmac> "," + <legacy_recalculate> "," <journal_sectors> "," <interleave_sectors> "," <buffer_sectors> ";" target_name := "target_name=integrity"
@@ -438,6 +439,7 @@ section above) has the following data format for 'integrity' target. block_size := "block_size=" <N> recalculate := "recalculate=" <yes_no> allow_discards := "allow_discards=" <yes_no> + allow_discards_keyed := "allow_discards_keyed=" <yes_no> fix_padding := "fix_padding=" <yes_no> fix_hmac := "fix_hmac=" <yes_no> legacy_recalculate := "legacy_recalculate=" <yes_no>
@@ -455,7 +457,8 @@ section above) has the following data format for 'integrity' target. dm_version=4.45.0; name=integrity1,uuid=,major=253,minor=1,minor_count=1,num_targets=1; target_index=0,target_begin=0,target_len=7856,target_name=integrity,target_version=1.10.0, - dev_name=253:0,start=0,tag_size=32,mode=J,recalculate=n,allow_discards=n,fix_padding=n, + dev_name=253:0,start=0,tag_size=32,mode=J,recalculate=n,allow_discards=n, + allow_discards_keyed=n,fix_padding=n, fix_hmac=n,legacy_recalculate=n,journal_sectors=88,interleave_sectors=32768,buffer_sectors=128;
Documentation/admin-guide/device-mapper/dm-integrity.rst +13 -0
@@ -185,6 +185,19 @@ allow_discards Allow block discard requests (a.k.a. TRIM) for the integrity device. Discards are only allowed to devices using internal hash. + A discarded block is marked with a constant filler tag that anyone + with raw write access to the backing device can forge without the + key. Use allow_discards_keyed instead on new volumes. + +allow_discards_keyed + Like allow_discards, but marks a discarded block with a keyed + checksum of the sector number, HMAC_key(salt || sector), instead of + the constant filler tag, so it can't be forged without the + integrity key. + + Not compatible with volumes that already have discarded blocks + marked the old way; only use on a freshly formatted volume. + fix_padding Use a smaller padding of the tag area that is more space-efficient. If this option is not present, large padding is
drivers/md/dm-integrity.c +96 -14
243 lines not on this page · raw message
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 816/869 perf/x86/intel/uncore: Fix uncore_box ref/unref ordering
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zide Chen <[email protected]>
[ Upstream commit 174f0582e38abe03b88e15f04bfe58490f88cb19 ]
In uncore_event_cpu_online(), uncore_box_ref() was called before uncore_change_context(). uncore_box_ref() gates on box->cpu >= 0, but box->cpu is still -1 at that point because uncore_change_context() has not run yet. As a result, the box is never initialized on the first CPU to come online in a die, leaving it permanently uninitialized in the single-CPU-per-die case.
Thus, box->refcnt is one count below the true value, and in the CPU offline path, the box will be torn down on the second-to-last CPU.
In uncore_event_cpu_offline(), uncore_box_unref() was called after uncore_change_context(), so box->cpu is already -1 when the collector CPU goes offline, which prevents it from tearing down the box.
Fix by swapping the call order in both paths so that uncore_box_{ref,unref}() runs at the point where box->cpu reflects the correct context.
Move allocate_boxes() out of uncore_box_ref() to enable this reordering.
--- arch/x86/events/intel/uncore.c | 46 +++++++++++++++------------------- 1 file changed, 20 insertions(+), 26 deletions(-)
arch/x86/events/intel/uncore.c +20 -26
@@ -1535,9 +1535,15 @@ static int uncore_event_cpu_offline(unsigned int cpu) {int die, target; +/* Clear the references */ + die =topology_logical_die_id (cpu); +uncore_box_unref (uncore_msr_uncores, die); +uncore_box_unref (uncore_mmio_uncores, die); +/* Check if exiting cpu is used for collecting uncore events */ if (!cpumask_test_and_clear_cpu (cpu, &uncore_cpu_mask)) - goto unref; +return 0 ; +/* Find a new cpu to collect uncore events */ target =cpumask_any_but (topology_die_cpumask (cpu), cpu);
@@ -1550,16 +1556,10 @@ static int uncore_event_cpu_offline(unsigned int cpu)uncore_change_context (uncore_msr_uncores, cpu, target);uncore_change_context (uncore_mmio_uncores, cpu, target);uncore_change_context (uncore_pci_uncores, cpu, target); - -unref: -/* Clear the references */ - die =topology_logical_die_id (cpu); -uncore_box_unref (uncore_msr_uncores, die); -uncore_box_unref (uncore_mmio_uncores, die);return 0 ; } -static int allocate_boxes (struct intel_uncore_type **types, +static void allocate_boxes (struct intel_uncore_type **types,unsigned int die,unsigned int cpu) {struct intel_uncore_box *box, *tmp;
@@ -1588,14 +1588,13 @@ static int allocate_boxes(struct intel_uncore_type **types,list_del_init (&box->active_list); box->pmu->boxes[die] = box; } -return 0 ; +return ; cleanup:list_for_each_entry_safe (box, tmp, &allocated, active_list) {list_del_init (&box->active_list);kfree (box); } -return -ENOMEM ; } static int uncore_box_ref(struct intel_uncore_type **types,
@@ -1604,11 +1603,7 @@ static int uncore_box_ref(struct intel_uncore_type **types,struct intel_uncore_type *type;struct intel_uncore_pmu *pmu;struct intel_uncore_box *box; -int i, ret; - - ret =allocate_boxes (types, id, cpu); -if (ret) -return ret; +int i;for (; *types; types++) { type = *types;
@@ -1624,27 +1619,26 @@ static int uncore_box_ref(struct intel_uncore_type **types,static int uncore_event_cpu_online (unsigned int cpu) { -int die, target, msr_ret, mmio_ret; +int die, target; die =topology_logical_die_id (cpu); - msr_ret =uncore_box_ref (uncore_msr_uncores, die, cpu); - mmio_ret =uncore_box_ref (uncore_mmio_uncores, die, cpu); +allocate_boxes (uncore_msr_uncores, die, cpu); +allocate_boxes (uncore_mmio_uncores, die, cpu);/* * Check if there is an online cpu in the package * which collects uncore events already. */ target =cpumask_any_and (&uncore_cpu_mask,topology_die_cpumask (cpu)); -if (target < nr_cpu_ids) -return 0 ; - -cpumask_set_cpu (cpu, &uncore_cpu_mask); - -if (!msr_ret) +if (target >= nr_cpu_ids) { +cpumask_set_cpu (cpu, &uncore_cpu_mask);uncore_change_context (uncore_msr_uncores,-1 , cpu); -if (!mmio_ret)uncore_change_context (uncore_mmio_uncores,-1 , cpu); -uncore_change_context (uncore_pci_uncores,-1 , cpu); +uncore_change_context (uncore_pci_uncores,-1 , cpu); + } + +uncore_box_ref (uncore_msr_uncores, die, cpu); +uncore_box_ref (uncore_mmio_uncores, die, cpu);return 0 ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 817/869 i3c: master: Fix recursive locking during device registration
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adrian Hunter <[email protected]>
[ Upstream commit 456f832e5fc26fbfd3b8200fd4553eee520cc377 ]
i3c_master_register_new_i3c_devs() registers newly discovered devices while holding i3c_bus_normaluse_lock(), a down_read(). device_register() can immediately probe the device, and probe callbacks typically invoke I3C helpers that take i3c_bus_normaluse_lock() again, leading to a recursive acquisition of the same rwsem. rwsems do not support recursive read locking and can deadlock when a writer is waiting. See the "Recursive read locks" section of Documentation/locking/lockdep-design.rst.
For example, with Intel LPSS I3C, LOCKDEP generates a WARNING like:
# echo intel-lpss-i3c.0 > /sys/bus/platform/drivers/mipi-i3c-hci/unbind
# echo intel-lpss-i3c.0 > /sys/bus/platform/drivers/mipi-i3c-hci/bind
WARNING: possible recursive locking detected
kworker/5:1/94 is trying to acquire lock:
ffff88811c810d78 (&i3cbus->lock){++++}-{4:4}, at: i3c_device_match_id+0x45/0x370
but task is already holding lock:
ffff88811c810d78 (&i3cbus->lock){++++}-{4:4}, at: i3c_master_reg_work_fn+0x21/0x5f0Fix this by separating device creation from device registration. Populate desc->dev under the maintenance lock, collect the devices that still need registration into a local list, then release the lock before calling device_register(). Finally retake the lock and clean up any devices that failed to register.
Use the maintenance lock rather than the normal-use lock while adding device objects. A write-side maintenance lock prevents readers from observing a partially initialized desc->dev during initial device population, or desc->dev disappearing if registration fails.
The local list requires a list node, so add a list node member to struct i3c_device.
--- drivers/i3c/master.c | 39 ++++++++++++++++++++++++++------------ include/linux/i3c/master.h | 3 +++ 2 files changed, 30 insertions(+), 12 deletions(-)
drivers/i3c/master.c +27 -12
@@ -1661,12 +1661,16 @@ static int i3c_master_early_i3c_dev_add(struct i3c_master_controller *master,static void i3c_master_register_new_i3c_devs (struct i3c_master_controller *master) { +struct i3c_device *i3cdev, *tmp;struct i3c_dev_desc *desc; +LIST_HEAD (i3c_unreg_devs);int ret;if (!master->init_done)return ; +i3c_bus_maintenance_lock (&master->bus); +i3c_bus_for_each_i3cdev (&master->bus, desc) {if (desc->dev || !desc->info.dyn_addr || desc == master->this)continue ;
@@ -1687,15 +1691,30 @@ i3c_master_register_new_i3c_devs(struct i3c_master_controller *master)if (desc->boardinfo) desc->dev->dev.of_node = desc->boardinfo->of_node; - ret =device_register (&desc->dev->dev); -if (ret) { -dev_err (&master->dev, -"Failed to add I3C device (err = %d)\n" , ret); - desc->dev->desc =NULL ; -put_device (&desc->dev->dev); - desc->dev =NULL ; - } +list_add_tail (&desc->dev->node, &i3c_unreg_devs); + } + +i3c_bus_maintenance_unlock (&master->bus); + +list_for_each_entry_safe (i3cdev, tmp, &i3c_unreg_devs, node) { + ret =device_register (&i3cdev->dev); +if (ret) +dev_err (&master->dev,"Failed to add I3C device (err = %d)\n" , ret); +else +list_del_init (&i3cdev->node); } + +i3c_bus_maintenance_lock (&master->bus); + +list_for_each_entry_safe (i3cdev, tmp, &i3c_unreg_devs, node) { +list_del (&i3cdev->node); + desc = i3cdev->desc; + i3cdev->desc =NULL ; +put_device (&i3cdev->dev); + desc->dev =NULL ; + } + +i3c_bus_maintenance_unlock (&master->bus); }/**
@@ -1724,9 +1743,7 @@ int i3c_master_do_daa(struct i3c_master_controller *master)if (ret)return ret; -i3c_bus_normaluse_lock (&master->bus);i3c_master_register_new_i3c_devs (master); -i3c_bus_normaluse_unlock (&master->bus);return 0 ; }
@@ -2904,9 +2921,7 @@ int i3c_master_register(struct i3c_master_controller *master,* register I3C devices discovered during the initial DAA. */ master->init_done = true; -i3c_bus_normaluse_lock (&master->bus);i3c_master_register_new_i3c_devs (master); -i3c_bus_normaluse_unlock (&master->bus);return 0 ;
include/linux/i3c/master.h +3 -0
@@ -228,6 +228,8 @@ struct i3c_dev_desc {* every time the I3C device is rediscovered with a different dynamic * address assigned * @bus: I3C bus this device is attached to +* @node: unregistered device list node, only for use by +* i3c_master_register_new_i3c_devs(), it is not protected by a lock * * I3C device object exposed to I3C device drivers. The takes care of linking * this object to the relevant &struct_i3c_dev_desc one.
@@ -238,6 +240,7 @@ struct i3c_device {struct device dev;struct i3c_dev_desc *desc;struct i3c_bus *bus; +struct list_head node; };/*
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 818/869 xfs: remove unused trace event xfs_dqreclaim_dirty
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven Rostedt <[email protected]>
[ Upstream commit b9adb86b9045e6e912035e5991d370ac769be0b8 ]
The tracepoint trace_xfs_dqreclaim_dirty was removed with other code removed from xfs_qm_dquot_isolate() but the defined tracepoint was not.
--- fs/xfs/xfs_trace.h | 1 - 1 file changed, 1 deletion(-)
fs/xfs/xfs_trace.h +0 -1
@@ -1097,7 +1097,6 @@ DEFINE_EVENT(xfs_dquot_class, name, \ TP_ARGS(dqp))DEFINE_DQUOT_EVENT (xfs_dqadjust);DEFINE_DQUOT_EVENT (xfs_dqreclaim_want); -DEFINE_DQUOT_EVENT (xfs_dqreclaim_dirty);DEFINE_DQUOT_EVENT (xfs_dqreclaim_busy);DEFINE_DQUOT_EVENT (xfs_dqreclaim_done);DEFINE_DQUOT_EVENT (xfs_dqattach_found);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 819/869 ublk: fix dead loop when canceling io command
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ming Lei <[email protected]>
[ Upstream commit dd24f87f65c957f30e605e44961d2fd53a44c780 ]
Commit:
f40139fde527 ("ublk: fix race between io_uring_cmd_complete_in_task and
ublk_cancel_cmd")
adds a request state check in ublk_cancel_cmd(), and if the request is started, skips canceling this uring_cmd.
However, the current uring_cmd may be in ACTIVE state, without block request coming to the uring command. Meantime, if the cached request in tag_set.tags[tag] has been delivered to ublk server and reycycled, then this uring_cmd can't be canceled.
ublk requests are aborted in ublk char device release handler, which depends on canceling all ACTIVE uring_cmd. So it causes a dead loop.
Fix this issue by not taking a stale request into account when canceling uring_cmd in ublk_cancel_cmd().
--- drivers/block/ublk_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/ublk_drv.c +1 -1
@@ -1580,7 +1580,7 @@ static void ublk_cancel_cmd(struct ublk_queue *ubq, unsigned tag,* that ublk_dispatch_req() is always called */ req =blk_mq_tag_to_rq (ub->tag_set.tags[ubq->q_id], tag); -if (req &&blk_mq_request_started (req)) +if (req &&blk_mq_request_started (req) && req->tag == tag)return ;spin_lock (&ubq->cancel_lock);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 820/869 riscv: uaccess: Only restore the CSR_STATUS SUM bit
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cyril Bur <[email protected]>
[ Upstream commit 265d6aba165c500389c80d394ac247460c443ef5 ]
During switch to csrs will OR the value of the register into the corresponding csr. In this case we're only interested in restoring the SUM bit not the entire register.
--- arch/riscv/include/asm/processor.h | 2 +- arch/riscv/kernel/asm-offsets.c | 6 +++--- arch/riscv/kernel/entry.S | 9 +++++---- 3 files changed, 9 insertions(+), 8 deletions(-)
arch/riscv/include/asm/processor.h +1 -1
@@ -103,7 +103,7 @@ struct thread_struct {struct __riscv_d_ext_state fstate;unsigned long bad_cause;unsigned long envcfg; -unsigned long status; +unsigned long sum;u32 riscv_v_flags;u32 vstate_ctrl;struct __riscv_v_ext_state vstate;
arch/riscv/kernel/asm-offsets.c +3 -3
@@ -35,7 +35,7 @@ void asm_offsets(void)OFFSET (TASK_THREAD_S9 , task_struct, thread.s[9 ]);OFFSET (TASK_THREAD_S10 , task_struct, thread.s[10 ]);OFFSET (TASK_THREAD_S11 , task_struct, thread.s[11 ]); -OFFSET (TASK_THREAD_STATUS , task_struct, thread.status); +OFFSET (TASK_THREAD_SUM , task_struct, thread.sum);OFFSET (TASK_TI_CPU , task_struct, thread_info.cpu);OFFSET (TASK_TI_FLAGS , task_struct, thread_info.flags);
@@ -349,8 +349,8 @@ void asm_offsets(void) offsetof(struct task_struct, thread.s[11]) - offsetof(struct task_struct, thread.ra) ); -DEFINE (TASK_THREAD_STATUS_RA , - offsetof(struct task_struct, thread.status) +DEFINE (TASK_THREAD_SUM_RA , + offsetof(struct task_struct, thread.sum) - offsetof(struct task_struct, thread.ra) );
arch/riscv/kernel/entry.S +5 -4
@@ -404,14 +404,15 @@ SYM_FUNC_START(__switch_to) REG_S s11, TASK_THREAD_S11_RA(a3) /* save the user space access flag */ - li s0, SR_SUM - csrr s1, CSR_STATUS - REG_S s1, TASK_THREAD_STATUS_RA(a3) + csrr s0, CSR_STATUS + REG_S s0, TASK_THREAD_SUM_RA(a3) /* Save the kernel shadow call stack pointer */ scs_save_current /* Restore context from next->thread */ - REG_L s0, TASK_THREAD_STATUS_RA(a4) + REG_L s0, TASK_THREAD_SUM_RA(a4) + li s1, SR_SUM + and s0, s0, s1 csrs CSR_STATUS, s0 REG_L ra, TASK_THREAD_RA_RA(a4) REG_L sp, TASK_THREAD_SP_RA(a4)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 821/869 s390/kvm: Initialize uninitialized flags variable
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Claudio Imbrenda <[email protected]>
[ Upstream commit 64844729a608d308089510fc3bb23abf602f4e47 ]
The flags variable was being used uninitialized.
Initialize it to 0 as expected.
For some reason neither gcc nor clang reported a warning.
Stable-dep-of: 5f9df945d4e8 ("KVM: s390: Fix FOLL_*/FAULT_FLAG_* confusion")
--- arch/s390/kvm/kvm-s390.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/kvm/kvm-s390.c +1 -1
@@ -4737,8 +4737,8 @@ static int vcpu_post_run_addressing_exception(struct kvm_vcpu *vcpu)static int vcpu_post_run_handle_fault (struct kvm_vcpu *vcpu) { +unsigned int flags =0 ;unsigned long gaddr; -unsigned int flags;int rc =0 ; gaddr = current->thread.gmap_teid.addr *PAGE_SIZE ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 822/869 KVM: s390: wrapper for KVM_BUG
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Claudio Imbrenda <[email protected]>
[ Upstream commit decff09adbeba4b75a1982b1dc3991761914e2df ]
Wrap the call to KVM_BUG; this reduces code duplication and improves readability.
Message-ID: <[email protected]>
Stable-dep-of: 5f9df945d4e8 ("KVM: s390: Fix FOLL_*/FAULT_FLAG_* confusion")
--- arch/s390/kvm/kvm-s390.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
arch/s390/kvm/kvm-s390.c +10 -9
@@ -4735,6 +4735,13 @@ static int vcpu_post_run_addressing_exception(struct kvm_vcpu *vcpu)return kvm_s390_inject_prog_irq (vcpu, &pgm_info); } +static void kvm_s390_assert_primary_as (struct kvm_vcpu *vcpu) +{ +KVM_BUG (current->thread.gmap_teid.as !=PSW_BITS_AS_PRIMARY , vcpu->kvm, +"Unexpected program interrupt 0x%x, TEID 0x%016lx" , + current->thread.gmap_int_code, current->thread.gmap_teid.val); +} +static int vcpu_post_run_handle_fault (struct kvm_vcpu *vcpu) {unsigned int flags =0 ;
@@ -4750,9 +4757,7 @@ static int vcpu_post_run_handle_fault(struct kvm_vcpu *vcpu) vcpu->stat.exit_null++;break ;case PGM_NON_SECURE_STORAGE_ACCESS : -KVM_BUG (current->thread.gmap_teid.as !=PSW_BITS_AS_PRIMARY , vcpu->kvm, -"Unexpected program interrupt 0x%x, TEID 0x%016lx" , - current->thread.gmap_int_code, current->thread.gmap_teid.val); +kvm_s390_assert_primary_as (vcpu);/* * This is normal operation; a page belonging to a protected * guest has not been imported yet. Try to import the page into
@@ -4763,9 +4768,7 @@ static int vcpu_post_run_handle_fault(struct kvm_vcpu *vcpu)break ;case PGM_SECURE_STORAGE_ACCESS :case PGM_SECURE_STORAGE_VIOLATION : -KVM_BUG (current->thread.gmap_teid.as !=PSW_BITS_AS_PRIMARY , vcpu->kvm, -"Unexpected program interrupt 0x%x, TEID 0x%016lx" , - current->thread.gmap_int_code, current->thread.gmap_teid.val); +kvm_s390_assert_primary_as (vcpu);/* * This can happen after a reboot with asynchronous teardown; * the new guest (normal or protected) will run on top of the
@@ -4794,9 +4797,7 @@ static int vcpu_post_run_handle_fault(struct kvm_vcpu *vcpu)case PGM_REGION_FIRST_TRANS :case PGM_REGION_SECOND_TRANS :case PGM_REGION_THIRD_TRANS : -KVM_BUG (current->thread.gmap_teid.as !=PSW_BITS_AS_PRIMARY , vcpu->kvm, -"Unexpected program interrupt 0x%x, TEID 0x%016lx" , - current->thread.gmap_int_code, current->thread.gmap_teid.val); +kvm_s390_assert_primary_as (vcpu);if (vcpu->arch.gmap->pfault_enabled) { rc =gmap_fault (vcpu->arch.gmap, gaddr, flags |FAULT_FLAG_RETRY_NOWAIT );if (rc == -EFAULT )
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 823/869 KVM: s390: move pv gmap functions into kvm
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Claudio Imbrenda <[email protected]>
[ Upstream commit 5cbe24350b7d8ef6d466a37d56b07ae643c622ca ]
Move gmap related functions from kernel/uv into kvm.
Create a new file to collect gmap-related functions.
Message-ID: <[email protected]>
Stable-dep-of: 5f9df945d4e8 ("KVM: s390: Fix FOLL_*/FAULT_FLAG_* confusion")
--- arch/s390/include/asm/gmap.h | 1 + arch/s390/include/asm/uv.h | 6 +- arch/s390/kernel/uv.c | 292 ++++------------------------------- arch/s390/kvm/Makefile | 2 +- arch/s390/kvm/gmap.c | 212 +++++++++++++++++++++++++ arch/s390/kvm/gmap.h | 17 ++ arch/s390/kvm/intercept.c | 3 +- arch/s390/kvm/kvm-s390.c | 1 + arch/s390/kvm/pv.c | 21 +++ arch/s390/mm/gmap.c | 28 ++++ 10 files changed, 315 insertions(+), 268 deletions(-) create mode 100644 arch/s390/kvm/gmap.c create mode 100644 arch/s390/kvm/gmap.h
arch/s390/include/asm/gmap.h +1 -0
@@ -152,6 +152,7 @@ int s390_replace_asce(struct gmap *gmap);void s390_uv_destroy_pfns (unsigned long count,unsigned long *pfns);int __s390_uv_destroy_range (struct mm_struct *mm,unsigned long start,unsigned long end,bool interruptible); +int kvm_s390_wiggle_split_folio (struct mm_struct *mm,struct folio *folio,bool split);/** * s390_uv_destroy_range - Destroy a range of pages in the given mm.
arch/s390/include/asm/uv.h +3 -3
@@ -476,12 +476,12 @@ static inline int is_prot_virt_host(void) }int uv_pin_shared (unsigned long paddr); -int gmap_make_secure (struct gmap *gmap,unsigned long gaddr,void *uvcb); -int gmap_destroy_page (struct gmap *gmap,unsigned long gaddr);int uv_destroy_folio (struct folio *folio);int uv_destroy_pte (pte_t pte);int uv_convert_from_secure_pte (pte_t pte); -int gmap_convert_to_secure (struct gmap *gmap,unsigned long gaddr); +int make_folio_secure (struct folio *folio,struct uv_cb_header *uvcb); +int uv_convert_from_secure (unsigned long paddr); +int uv_convert_from_secure_folio (struct folio *folio);void setup_uv (void );
arch/s390/kernel/uv.c +29 -263
342 lines not on this page · raw message
arch/s390/kvm/Makefile +1 -1
@@ -8,7 +8,7 @@ include $(srctree)/virt/kvm/Makefile.kvm ccflags-y := -Ivirt/kvm -Iarch/s390/kvm kvm-y += kvm-s390.o intercept.o interrupt.o priv.o sigp.o -kvm-y += diag.o gaccess.o guestdbg.o vsie.o pv.o +kvm-y += diag.o gaccess.o guestdbg.o vsie.o pv.o gmap.o kvm-$(CONFIG_VFIO_PCI_ZDEV_KVM) += pci.o obj-$(CONFIG_KVM) += kvm.o
arch/s390/kvm/gmap.c new file +212 -0
212 lines not on this page · raw message
arch/s390/kvm/gmap.h new file +17 -0
@@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* KVM guest address space mapping code +* +* Copyright IBM Corp. 2007, 2016, 2025 +* Author(s): Martin Schwidefsky <[email protected]> +* Claudio Imbrenda <[email protected]> +*/ + +#ifndef ARCH_KVM_S390_GMAP_H +#define ARCH_KVM_S390_GMAP_H + +int gmap_make_secure (struct gmap *gmap,unsigned long gaddr,void *uvcb); +int gmap_convert_to_secure (struct gmap *gmap,unsigned long gaddr); +int gmap_destroy_page (struct gmap *gmap,unsigned long gaddr); + +#endif
arch/s390/kvm/intercept.c +2 -1
@@ -21,6 +21,7 @@#include "gaccess.h" #include "trace.h" #include "trace-s390.h" +#include "gmap.h" u8 kvm_s390_get_ilen (struct kvm_vcpu *vcpu) {
@@ -549,7 +550,7 @@ static int handle_pv_uvc(struct kvm_vcpu *vcpu)* If the unpin did not succeed, the guest will exit again for the UVC * and we will retry the unpin. */ -if (rc == -EINVAL ) +if (rc == -EINVAL || rc == -ENXIO )return 0 ;/* * If we got -EAGAIN here, we simply return it. It will eventually
arch/s390/kvm/kvm-s390.c +1 -0
@@ -49,6 +49,7 @@#include "kvm-s390.h" #include "gaccess.h" #include "pci.h" +#include "gmap.h" #define CREATE_TRACE_POINTS #include "trace.h"
arch/s390/kvm/pv.c +21 -0
@@ -17,6 +17,7 @@#include <linux/sched/mm.h> #include <linux/mmu_notifier.h> #include "kvm-s390.h" +#include "gmap.h" bool kvm_s390_pv_is_protected (struct kvm *kvm) {
@@ -638,10 +639,28 @@ static int unpack_one(struct kvm *kvm, unsigned long addr, u64 tweak, .tweak[1] = offset, };int ret =gmap_make_secure (kvm->arch.gmap, addr, &uvcb); +unsigned long vmaddr; +bool unlocked; *rc = uvcb.header.rc; *rrc = uvcb.header.rrc; +if (ret == -ENXIO ) { +mmap_read_lock (kvm->mm); + vmaddr =gfn_to_hva (kvm,gpa_to_gfn (addr)); +if (kvm_is_error_hva (vmaddr)) { + ret = -EFAULT ; + }else { + ret =fixup_user_fault (kvm->mm, vmaddr,FAULT_FLAG_WRITE , &unlocked); +if (!ret) + ret =__gmap_link (kvm->arch.gmap, addr, vmaddr); + } +mmap_read_unlock (kvm->mm); +if (!ret) +return -EAGAIN ; +return ret; + } +if (ret && ret != -EAGAIN )KVM_UV_EVENT (kvm,3 ,"PROTVIRT VM UNPACK: failed addr %llx with rc %x rrc %x" , uvcb.gaddr, *rc, *rrc);
@@ -660,6 +679,8 @@ int kvm_s390_pv_unpack(struct kvm *kvm, unsigned long addr, unsigned long size,KVM_UV_EVENT (kvm,3 ,"PROTVIRT VM UNPACK: start addr %lx size %lx" , addr, size); +guard (srcu)(&kvm->srcu); +while (offset < size) { ret =unpack_one (kvm, addr, tweak, offset, rc, rrc);if (ret == -EAGAIN ) {
arch/s390/mm/gmap.c +28 -0
@@ -2982,3 +2982,31 @@ int s390_replace_asce(struct gmap *gmap)return 0 ; }EXPORT_SYMBOL_GPL (s390_replace_asce); + +/** +* kvm_s390_wiggle_split_folio() - try to drain extra references to a folio and optionally split +* @mm: the mm containing the folio to work on +* @folio: the folio +* @split: whether to split a large folio +* +* Context: Must be called while holding an extra reference to the folio; +* the mm lock should not be held. +*/ +int kvm_s390_wiggle_split_folio (struct mm_struct *mm,struct folio *folio,bool split) +{ +int rc; + +lockdep_assert_not_held (&mm->mmap_lock); +folio_wait_writeback (folio); +lru_add_drain_all (); +if (split) { +folio_lock (folio); + rc =split_folio (folio); +folio_unlock (folio); + +if (rc != -EBUSY ) +return rc; + } +return -EAGAIN ; +} +EXPORT_SYMBOL_GPL (kvm_s390_wiggle_split_folio);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 824/869 KVM: s390: use __kvm_faultin_pfn()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Claudio Imbrenda <[email protected]>
[ Upstream commit 3762e905ec2e498c96464e094b7d46be98151d3b ]
Refactor the existing page fault handling code to use __kvm_faultin_pfn().
This possible now that memslots are always present.
Message-ID: <[email protected]>
Stable-dep-of: 5f9df945d4e8 ("KVM: s390: Fix FOLL_*/FAULT_FLAG_* confusion")
--- arch/s390/kvm/kvm-s390.c | 126 ++++++++++++++++++++++++++++++--------- arch/s390/kvm/kvm-s390.h | 6 ++ arch/s390/mm/gmap.c | 1 + 3 files changed, 106 insertions(+), 27 deletions(-)
arch/s390/kvm/kvm-s390.c +99 -27
@@ -4743,11 +4743,104 @@ static void kvm_s390_assert_primary_as(struct kvm_vcpu *vcpu) current->thread.gmap_int_code, current->thread.gmap_teid.val); } +/* +* __kvm_s390_handle_dat_fault() - handle a dat fault for the gmap of a vcpu +* @vcpu: the vCPU whose gmap is to be fixed up +* @gfn: the guest frame number used for memslots (including fake memslots) +* @gaddr: the gmap address, does not have to match @gfn for ucontrol gmaps +* @flags: FOLL_* flags +* +* Return: 0 on success, < 0 in case of error. +* Context: The mm lock must not be held before calling. May sleep. +*/ +int __kvm_s390_handle_dat_fault (struct kvm_vcpu *vcpu,gfn_t gfn,gpa_t gaddr,unsigned int flags) +{ +struct kvm_memory_slot *slot; +unsigned int fault_flags; +bool writable, unlocked; +unsigned long vmaddr; +struct page *page; +kvm_pfn_t pfn; +int rc; + + slot =kvm_vcpu_gfn_to_memslot (vcpu, gfn); +if (!slot || slot->flags &KVM_MEMSLOT_INVALID ) +return vcpu_post_run_addressing_exception (vcpu); + + fault_flags = flags &FOLL_WRITE ?FAULT_FLAG_WRITE :0 ; +if (vcpu->arch.gmap->pfault_enabled) + flags |=FOLL_NOWAIT ; + vmaddr =__gfn_to_hva_memslot (slot, gfn); + +try_again: + pfn =__kvm_faultin_pfn (slot, gfn, flags, &writable, &page); + +/* Access outside memory, inject addressing exception */ +if (is_noslot_pfn (pfn)) +return vcpu_post_run_addressing_exception (vcpu); +/* Signal pending: try again */ +if (pfn ==KVM_PFN_ERR_SIGPENDING ) +return -EAGAIN ; + +/* Needs I/O, try to setup async pfault (only possible with FOLL_NOWAIT) */ +if (pfn ==KVM_PFN_ERR_NEEDS_IO ) { +trace_kvm_s390_major_guest_pfault (vcpu); +if (kvm_arch_setup_async_pf (vcpu)) +return 0 ; + vcpu->stat.pfault_sync++; +/* Could not setup async pfault, try again synchronously */ + flags &= ~FOLL_NOWAIT ; + goto try_again; + } +/* Any other error */ +if (is_error_pfn (pfn)) +return -EFAULT ; + +/* Success */ +mmap_read_lock (vcpu->arch.gmap->mm); +/* Mark the userspace PTEs as young and/or dirty, to avoid page fault loops */ + rc =fixup_user_fault (vcpu->arch.gmap->mm, vmaddr, fault_flags, &unlocked); +if (!rc) + rc =__gmap_link (vcpu->arch.gmap, gaddr, vmaddr); + scoped_guard(spinlock, &vcpu->kvm->mmu_lock) { +kvm_release_faultin_page (vcpu->kvm, page, false, writable); + } +mmap_read_unlock (vcpu->arch.gmap->mm); +return rc; +} + +static int vcpu_dat_fault_handler (struct kvm_vcpu *vcpu,unsigned long gaddr,unsigned int flags) +{ +unsigned long gaddr_tmp; +gfn_t gfn; + + gfn =gpa_to_gfn (gaddr); +if (kvm_is_ucontrol (vcpu->kvm)) { +/* +* This translates the per-vCPU guest address into a +* fake guest address, which can then be used with the +* fake memslots that are identity mapping userspace. +* This allows ucontrol VMs to use the normal fault +* resolution path, like normal VMs. +*/ +mmap_read_lock (vcpu->arch.gmap->mm); + gaddr_tmp =__gmap_translate (vcpu->arch.gmap, gaddr); +mmap_read_unlock (vcpu->arch.gmap->mm); +if (gaddr_tmp == -EFAULT ) { + vcpu->run->exit_reason =KVM_EXIT_S390_UCONTROL ; + vcpu->run->s390_ucontrol.trans_exc_code = gaddr; + vcpu->run->s390_ucontrol.pgm_code =PGM_SEGMENT_TRANSLATION ; +return -EREMOTE ; + } + gfn =gpa_to_gfn (gaddr_tmp); + } +return __kvm_s390_handle_dat_fault (vcpu, gfn, gaddr, flags); +} +static int vcpu_post_run_handle_fault (struct kvm_vcpu *vcpu) {unsigned int flags =0 ;unsigned long gaddr; -int rc =0 ; gaddr = current->thread.gmap_teid.addr *PAGE_SIZE ;if (kvm_s390_cur_gmap_fault_is_write ())
@@ -4799,37 +4892,14 @@ static int vcpu_post_run_handle_fault(struct kvm_vcpu *vcpu)case PGM_REGION_SECOND_TRANS :case PGM_REGION_THIRD_TRANS :kvm_s390_assert_primary_as (vcpu); -if (vcpu->arch.gmap->pfault_enabled) { - rc =gmap_fault (vcpu->arch.gmap, gaddr, flags |FAULT_FLAG_RETRY_NOWAIT ); -if (rc == -EFAULT ) -return vcpu_post_run_addressing_exception (vcpu); -if (rc == -EAGAIN ) { -trace_kvm_s390_major_guest_pfault (vcpu); -if (kvm_arch_setup_async_pf (vcpu)) -return 0 ; - vcpu->stat.pfault_sync++; - }else { -return rc; - } - } - rc =gmap_fault (vcpu->arch.gmap, gaddr, flags); -if (rc == -EFAULT ) { -if (kvm_is_ucontrol (vcpu->kvm)) { - vcpu->run->exit_reason =KVM_EXIT_S390_UCONTROL ; - vcpu->run->s390_ucontrol.trans_exc_code = gaddr; - vcpu->run->s390_ucontrol.pgm_code =0x10 ; -return -EREMOTE ; - } -return vcpu_post_run_addressing_exception (vcpu); - } -break ; +return vcpu_dat_fault_handler (vcpu, gaddr, flags);default :KVM_BUG (1 , vcpu->kvm,"Unexpected program interrupt 0x%x, TEID 0x%016lx" , current->thread.gmap_int_code, current->thread.gmap_teid.val);send_sig (SIGSEGV , current,0 );break ; } -return rc; +return 0 ; }static int vcpu_post_run (struct kvm_vcpu *vcpu,int exit_reason)
@@ -5710,7 +5780,9 @@ long kvm_arch_vcpu_ioctl(struct file *filp, }#endif case KVM_S390_VCPU_FAULT : { - r =gmap_fault (vcpu->arch.gmap, arg,0 ); + idx =srcu_read_lock (&vcpu->kvm->srcu); + r =vcpu_dat_fault_handler (vcpu, arg,0 ); +srcu_read_unlock (&vcpu->kvm->srcu, idx);break ; }case KVM_ENABLE_CAP :
arch/s390/kvm/kvm-s390.h +6 -0
@@ -408,6 +408,12 @@ void kvm_s390_vcpu_unsetup_cmma(struct kvm_vcpu *vcpu);void kvm_s390_set_cpu_timer (struct kvm_vcpu *vcpu,__u64 cputm);__u64 kvm_s390_get_cpu_timer (struct kvm_vcpu *vcpu);int kvm_s390_cpus_from_pv (struct kvm *kvm,u16 *rc,u16 *rrc); +int __kvm_s390_handle_dat_fault (struct kvm_vcpu *vcpu,gfn_t gfn,gpa_t gaddr,unsigned int flags); + +static inline int kvm_s390_handle_dat_fault (struct kvm_vcpu *vcpu,gpa_t gaddr,unsigned int flags) +{ +return __kvm_s390_handle_dat_fault (vcpu,gpa_to_gfn (gaddr), gaddr, flags); +}/* implemented in diag.c */ int kvm_s390_handle_diag (struct kvm_vcpu *vcpu);
arch/s390/mm/gmap.c +1 -0
@@ -635,6 +635,7 @@ int __gmap_link(struct gmap *gmap, unsigned long gaddr, unsigned long vmaddr)radix_tree_preload_end ();return rc; } +EXPORT_SYMBOL (__gmap_link);/** * gmap_fault - resolve a fault on a guest address
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 825/869 KVM: s390: move gmap_shadow_pgt_lookup() into kvm
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Claudio Imbrenda <[email protected]>
[ Upstream commit 43656f774a4b4a2841035947e89dcde8ee136caa ]
Move gmap_shadow_pgt_lookup() from mm/gmap.c into kvm/gaccess.c .
Message-ID: <[email protected]>
Stable-dep-of: 5f9df945d4e8 ("KVM: s390: Fix FOLL_*/FAULT_FLAG_* confusion")
--- arch/s390/include/asm/gmap.h | 3 +-- arch/s390/kvm/gaccess.c | 42 +++++++++++++++++++++++++++++++++- arch/s390/kvm/gmap.h | 2 ++ arch/s390/mm/gmap.c | 44 ++---------------------------------- 4 files changed, 46 insertions(+), 45 deletions(-)
arch/s390/include/asm/gmap.h +1 -2
@@ -134,8 +134,6 @@ int gmap_shadow_sgt(struct gmap *sg, unsigned long saddr, unsigned long sgt, int fake);int gmap_shadow_pgt (struct gmap *sg,unsigned long saddr,unsigned long pgt,int fake); -int gmap_shadow_pgt_lookup (struct gmap *sg,unsigned long saddr, -unsigned long *pgt,int *dat_protection,int *fake);int gmap_shadow_page (struct gmap *sg,unsigned long saddr,pte_t pte);void gmap_register_pte_notifier (struct gmap_notifier *);
@@ -153,6 +151,7 @@ void s390_uv_destroy_pfns(unsigned long count, unsigned long *pfns);int __s390_uv_destroy_range (struct mm_struct *mm,unsigned long start,unsigned long end,bool interruptible);int kvm_s390_wiggle_split_folio (struct mm_struct *mm,struct folio *folio,bool split); +unsigned long *gmap_table_walk (struct gmap *gmap,unsigned long gaddr,int level);/** * s390_uv_destroy_range - Destroy a range of pages in the given mm.
arch/s390/kvm/gaccess.c +41 -1
66 lines not on this page · raw message
arch/s390/kvm/gmap.h +2 -0
@@ -10,6 +10,8 @@#ifndef ARCH_KVM_S390_GMAP_H #define ARCH_KVM_S390_GMAP_H +#define GMAP_SHADOW_FAKE_TABLE 1ULL +int gmap_make_secure (struct gmap *gmap,unsigned long gaddr,void *uvcb);int gmap_convert_to_secure (struct gmap *gmap,unsigned long gaddr);int gmap_destroy_page (struct gmap *gmap,unsigned long gaddr);
arch/s390/mm/gmap.c +2 -42
62 lines not on this page · raw message
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 826/869 KVM: s390: pv: fix race when making a page secure
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Claudio Imbrenda <[email protected]>
[ Upstream commit d8dfda5af0be6e48178b6f4b46c6af30b06335b2 ]
Holding the pte lock for the page that is being converted to secure is needed to avoid races. A previous commit removed the locking, which caused issues. Fix by locking the pte again.
Message-ID: <[email protected]>
Stable-dep-of: 5f9df945d4e8 ("KVM: s390: Fix FOLL_*/FAULT_FLAG_* confusion")
--- arch/s390/include/asm/gmap.h | 1 - arch/s390/include/asm/uv.h | 2 +- arch/s390/kernel/uv.c | 136 +++++++++++++++++++++++++++++++++-- arch/s390/kvm/gmap.c | 103 ++------------------------ arch/s390/kvm/kvm-s390.c | 25 ++++--- arch/s390/mm/gmap.c | 28 -------- 6 files changed, 151 insertions(+), 144 deletions(-)
arch/s390/include/asm/gmap.h +0 -1
@@ -150,7 +150,6 @@ int s390_replace_asce(struct gmap *gmap);void s390_uv_destroy_pfns (unsigned long count,unsigned long *pfns);int __s390_uv_destroy_range (struct mm_struct *mm,unsigned long start,unsigned long end,bool interruptible); -int kvm_s390_wiggle_split_folio (struct mm_struct *mm,struct folio *folio,bool split);unsigned long *gmap_table_walk (struct gmap *gmap,unsigned long gaddr,int level);/**
arch/s390/include/asm/uv.h +1 -1
@@ -479,7 +479,7 @@ int uv_pin_shared(unsigned long paddr);int uv_destroy_folio (struct folio *folio);int uv_destroy_pte (pte_t pte);int uv_convert_from_secure_pte (pte_t pte); -int make_folio_secure (struct folio *folio,struct uv_cb_header *uvcb); +int make_hva_secure (struct mm_struct *mm,unsigned long hva,struct uv_cb_header *uvcb);int uv_convert_from_secure (unsigned long paddr);int uv_convert_from_secure_folio (struct folio *folio);
arch/s390/kernel/uv.c +129 -7
169 lines not on this page · raw message
arch/s390/kvm/gmap.c +6 -97
122 lines not on this page · raw message
arch/s390/kvm/kvm-s390.c +15 -10
@@ -4841,6 +4841,7 @@ static int vcpu_post_run_handle_fault(struct kvm_vcpu *vcpu) {unsigned int flags =0 ;unsigned long gaddr; +int rc; gaddr = current->thread.gmap_teid.addr *PAGE_SIZE ;if (kvm_s390_cur_gmap_fault_is_write ())
@@ -4850,16 +4851,6 @@ static int vcpu_post_run_handle_fault(struct kvm_vcpu *vcpu)case 0 : vcpu->stat.exit_null++;break ; -case PGM_NON_SECURE_STORAGE_ACCESS : -kvm_s390_assert_primary_as (vcpu); -/* -* This is normal operation; a page belonging to a protected -* guest has not been imported yet. Try to import the page into -* the protected guest. -*/ -if (gmap_convert_to_secure (vcpu->arch.gmap, gaddr) == -EINVAL ) -send_sig (SIGSEGV , current,0 ); -break ;case PGM_SECURE_STORAGE_ACCESS :case PGM_SECURE_STORAGE_VIOLATION :kvm_s390_assert_primary_as (vcpu);
@@ -4884,6 +4875,20 @@ static int vcpu_post_run_handle_fault(struct kvm_vcpu *vcpu)send_sig (SIGSEGV , current,0 ); }break ; +case PGM_NON_SECURE_STORAGE_ACCESS : +kvm_s390_assert_primary_as (vcpu); +/* +* This is normal operation; a page belonging to a protected +* guest has not been imported yet. Try to import the page into +* the protected guest. +*/ + rc =gmap_convert_to_secure (vcpu->arch.gmap, gaddr); +if (rc == -EINVAL ) +send_sig (SIGSEGV , current,0 ); +if (rc != -ENXIO ) +break ; + flags =FAULT_FLAG_WRITE ; + fallthrough;case PGM_PROTECTION :case PGM_SEGMENT_TRANSLATION :case PGM_PAGE_TRANSLATION :
arch/s390/mm/gmap.c +0 -28
@@ -2943,31 +2943,3 @@ int s390_replace_asce(struct gmap *gmap)return 0 ; }EXPORT_SYMBOL_GPL (s390_replace_asce); - -/** -* kvm_s390_wiggle_split_folio() - try to drain extra references to a folio and optionally split -* @mm: the mm containing the folio to work on -* @folio: the folio -* @split: whether to split a large folio -* -* Context: Must be called while holding an extra reference to the folio; -* the mm lock should not be held. -*/ -int kvm_s390_wiggle_split_folio (struct mm_struct *mm,struct folio *folio,bool split) -{ -int rc; - -lockdep_assert_not_held (&mm->mmap_lock); -folio_wait_writeback (folio); -lru_add_drain_all (); -if (split) { -folio_lock (folio); - rc =split_folio (folio); -folio_unlock (folio); - -if (rc != -EBUSY ) -return rc; - } -return -EAGAIN ; -} -EXPORT_SYMBOL_GPL (kvm_s390_wiggle_split_folio);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 827/869 KVM: s390: Fix FOLL_*/FAULT_FLAG_* confusion
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Claudio Imbrenda <[email protected]>
[ Upstream commit 5f9df945d4e862979b50e4ecaba3dc81fb06e8ed ]
Pass the right type of flag to vcpu_dat_fault_handler(); it expects a FOLL_* flag (in particular FOLL_WRITE), but FAULT_FLAG_WRITE is passed instead.
This still works because they happen to have the same integer value, but it's a mistake, thus the fix.
--- arch/s390/kvm/kvm-s390.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
arch/s390/kvm/kvm-s390.c +12 -12
@@ -4748,12 +4748,12 @@ static void kvm_s390_assert_primary_as(struct kvm_vcpu *vcpu)* @vcpu: the vCPU whose gmap is to be fixed up * @gfn: the guest frame number used for memslots (including fake memslots) * @gaddr: the gmap address, does not have to match @gfn for ucontrol gmaps -* @flags: FOLL_* flags +* @foll: FOLL_* flags * * Return: 0 on success, < 0 in case of error. * Context: The mm lock must not be held before calling. May sleep. */ -int __kvm_s390_handle_dat_fault (struct kvm_vcpu *vcpu,gfn_t gfn,gpa_t gaddr,unsigned int flags) +int __kvm_s390_handle_dat_fault (struct kvm_vcpu *vcpu,gfn_t gfn,gpa_t gaddr,unsigned int foll) {struct kvm_memory_slot *slot;unsigned int fault_flags;
@@ -4767,13 +4767,13 @@ int __kvm_s390_handle_dat_fault(struct kvm_vcpu *vcpu, gfn_t gfn, gpa_t gaddr, uif (!slot || slot->flags &KVM_MEMSLOT_INVALID )return vcpu_post_run_addressing_exception (vcpu); - fault_flags = flags &FOLL_WRITE ?FAULT_FLAG_WRITE :0 ; + fault_flags = foll &FOLL_WRITE ?FAULT_FLAG_WRITE :0 ;if (vcpu->arch.gmap->pfault_enabled) - flags |=FOLL_NOWAIT ; + foll |=FOLL_NOWAIT ; vmaddr =__gfn_to_hva_memslot (slot, gfn); try_again: - pfn =__kvm_faultin_pfn (slot, gfn, flags, &writable, &page); + pfn =__kvm_faultin_pfn (slot, gfn, foll, &writable, &page);/* Access outside memory, inject addressing exception */ if (is_noslot_pfn (pfn))
@@ -4789,7 +4789,7 @@ int __kvm_s390_handle_dat_fault(struct kvm_vcpu *vcpu, gfn_t gfn, gpa_t gaddr, ureturn 0 ; vcpu->stat.pfault_sync++;/* Could not setup async pfault, try again synchronously */ - flags &= ~FOLL_NOWAIT ; + foll &= ~FOLL_NOWAIT ; goto try_again; }/* Any other error */
@@ -4809,7 +4809,7 @@ int __kvm_s390_handle_dat_fault(struct kvm_vcpu *vcpu, gfn_t gfn, gpa_t gaddr, ureturn rc; } -static int vcpu_dat_fault_handler (struct kvm_vcpu *vcpu,unsigned long gaddr,unsigned int flags) +static int vcpu_dat_fault_handler (struct kvm_vcpu *vcpu,unsigned long gaddr,unsigned int foll) {unsigned long gaddr_tmp;gfn_t gfn;
@@ -4834,18 +4834,18 @@ static int vcpu_dat_fault_handler(struct kvm_vcpu *vcpu, unsigned long gaddr, un } gfn =gpa_to_gfn (gaddr_tmp); } -return __kvm_s390_handle_dat_fault (vcpu, gfn, gaddr, flags); +return __kvm_s390_handle_dat_fault (vcpu, gfn, gaddr, foll); }static int vcpu_post_run_handle_fault (struct kvm_vcpu *vcpu) { -unsigned int flags =0 ; +unsigned int foll =0 ;unsigned long gaddr;int rc; gaddr = current->thread.gmap_teid.addr *PAGE_SIZE ;if (kvm_s390_cur_gmap_fault_is_write ()) - flags =FAULT_FLAG_WRITE ; + foll =FOLL_WRITE ;switch (current->thread.gmap_int_code) {case 0 :
@@ -4887,7 +4887,7 @@ static int vcpu_post_run_handle_fault(struct kvm_vcpu *vcpu)send_sig (SIGSEGV , current,0 );if (rc != -ENXIO )break ; - flags =FAULT_FLAG_WRITE ; + foll =FOLL_WRITE ; fallthrough;case PGM_PROTECTION :case PGM_SEGMENT_TRANSLATION :
@@ -4897,7 +4897,7 @@ static int vcpu_post_run_handle_fault(struct kvm_vcpu *vcpu)case PGM_REGION_SECOND_TRANS :case PGM_REGION_THIRD_TRANS :kvm_s390_assert_primary_as (vcpu); -return vcpu_dat_fault_handler (vcpu, gaddr, flags); +return vcpu_dat_fault_handler (vcpu, gaddr, foll);default :KVM_BUG (1 , vcpu->kvm,"Unexpected program interrupt 0x%x, TEID 0x%016lx" , current->thread.gmap_int_code, current->thread.gmap_teid.val);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 828/869 s390/kvm: Mask extra bits from program interrupt code
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Claudio Imbrenda <[email protected]>
[ Upstream commit 34fb045eddd300a2d1c0d7de7e83113215c422e3 ]
The program interrupt code has some extra bits that are sometimes set by hardware for various reasons; those bits should be ignored when the program interrupt number is needed for interrupt handling.
--- arch/s390/kvm/kvm-s390.c | 2 +- arch/s390/kvm/vsie.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/s390/kvm/kvm-s390.c +1 -1
@@ -4847,7 +4847,7 @@ static int vcpu_post_run_handle_fault(struct kvm_vcpu *vcpu)if (kvm_s390_cur_gmap_fault_is_write ()) foll =FOLL_WRITE ; -switch (current->thread.gmap_int_code) { +switch (current->thread.gmap_int_code &PGM_INT_CODE_MASK ) {case 0 : vcpu->stat.exit_null++;break ;
arch/s390/kvm/vsie.c +1 -1
@@ -923,7 +923,7 @@ static int handle_fault(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page) {int rc; -if (current->thread.gmap_int_code ==PGM_PROTECTION ) +if ((current->thread.gmap_int_code &PGM_INT_CODE_MASK ) ==PGM_PROTECTION )/* we can directly forward all protection exceptions */ return inject_fault (vcpu,PGM_PROTECTION , current->thread.gmap_teid.addr *PAGE_SIZE ,1 );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 829/869 scsi: ufs: qcom : Fix NULL pointer dereference in ufs_qcom_setup_clocks
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nitin Rawat <[email protected]>
[ Upstream commit 720fa0cb59e411eca6b274f78073b6d2fe68eb45 ]
Fix a NULL pointer dereference in ufs_qcom_setup_clocks due to an uninitialized 'host' variable. The variable 'phy' is now assigned after confirming 'host' is not NULL.
Call Stack:
Unable to handle kernel NULL pointer dereference at
virtual address 0000000000000000
ufs_qcom_setup_clocks+0x28/0x148 ufs_qcom (P) ufshcd_setup_clocks (drivers/ufs/core/ufshcd-priv.h:142) ufshcd_init (drivers/ufs/core/ufshcd.c:9468) ufshcd_pltfrm_init (drivers/ufs/host/ufshcd-pltfrm.c:504) ufs_qcom_probe+0x28/0x68 ufs_qcomplatform_probe (drivers/base/platform.c:1404) really_probe (drivers/base/dd.c:579 drivers/base/dd.c:657) __driver_probe_device (drivers/base/dd.c:799) driver_probe_device (drivers/base/dd.c:829) __driver_attach (drivers/base/dd.c:1216) bus_for_each_dev (drivers/base/bus.c:370) driver_attach (drivers/base/dd.c:1234) bus_add_driver (drivers/base/bus.c:678) driver_register (drivers/base/driver.c:249) __platform_driver_register (drivers/base/platform.c:868) ufs_qcom_pltform_init+0x28/0xff8 ufs_qcom do_one_initcall (init/main.c:1274)do_init_module (kernel/module/main.c:3041) load_module (kernel/module/main.c:3511) init_module_from_file (kernel/module/main.c:3704) __arm64_sys_finit_module (kernel/module/main.c:3715.
--- drivers/ufs/host/ufs-qcom.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/ufs/host/ufs-qcom.c +3 -1
@@ -934,7 +934,7 @@ static int ufs_qcom_setup_clocks(struct ufs_hba *hba, bool on, enum ufs_notify_change_status status) {struct ufs_qcom_host *host =ufshcd_get_variant (hba); -struct phy *phy = host->generic_phy; +struct phy *phy;int err;/*
@@ -945,6 +945,8 @@ static int ufs_qcom_setup_clocks(struct ufs_hba *hba, bool on,if (!host)return 0 ; + phy = host->generic_phy; +switch (status) {case PRE_CHANGE :if (on) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 830/869 accel/ivpu: Fix race condition when mapping dmabuf
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wludzik, Jozef <[email protected]>
[ Upstream commit 63c7870fab67b2ab2bfe75e8b46f3c37b88c47a8 ]
Fix a race that can occur when multiple jobs submit the same dmabuf. This could cause the sg_table to be mapped twice, leading to undefined behavior.
--- drivers/accel/ivpu/ivpu_gem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/accel/ivpu/ivpu_gem.c +2 -1
@@ -45,12 +45,13 @@ static inline void ivpu_bo_unlock(struct ivpu_bo *bo)static struct sg_table *ivpu_bo_map_attachment (struct ivpu_device *vdev,struct ivpu_bo *bo) { -struct sg_table *sgt = bo->base.sgt; +struct sg_table *sgt;drm_WARN_ON (&vdev->drm, !bo->base.base.import_attach);ivpu_bo_lock (bo); + sgt = bo->base.sgt;if (!sgt) { sgt =dma_buf_map_attachment (bo->base.base.import_attach,DMA_BIDIRECTIONAL );if (IS_ERR (sgt))
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 831/869 KVM: SEV: Drop FOLL_WRITE for encrypted region registration
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pankaj Gupta <[email protected]>
[ Upstream commit ee1a586dd1fa2f245b3b753a3e44d9263a49240b ]
When pinning SEV guest memory, drop FOLL_WRITE and rely on FOLL_LONGTERM to break CoW, as *KVM* doesn't actually to the memory using the GUP'd pages. Omitting FOLL_WRITE fixes a regression when using file-backed guest memory that was introduced when KVM (correctly) added FOLL_LONG (e.g. to ensure anonymous memory is migrated out of MIGRATE_CMA/ZONE_MOVABLE before a long term pin).
Unfortunately, as of commits:
8ac268436e6d ("mm/gup: disallow FOLL_LONGTERM GUP-nonfast writing to file-backed mappings") a6e79df92e4a ("mm/gup: disallow FOLL_LONGTERM GUP-fast writing to file-backed mappings")
GUP uses FOLL_LONGTERM as a canary of sorts to detect pins that are likely to be problematic, and disallows WRITE+LONGTERM pins for file-backed memory. As a result, backing SEV+ guests with file-backed memory, e.g. virtio-pmem, fails due to the disallowed FOLL_LONGTERM+FOLL_WRITE combination.
Note, in the past, FOLL_WRITE was required to trigger CoW unsharing, to prevent replacing the page in the (primary MMU's) page tables during a later write fault after already having pinned a (shared) page in MAP_PRIVATE mappings. FOLL_LONGTERM does that nowadays, even without FOLL_WRITE (see gup_must_unshare()).
--- arch/x86/kvm/svm/sev.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
arch/x86/kvm/svm/sev.c +5 -1
@@ -2719,8 +2719,12 @@ int sev_mem_enc_register_region(struct kvm *kvm,if (!region)return -ENOMEM ; +/* +* Do NOT specify FOLL_WRITE, as KVM isn't using the pinned pages to +* write memory, and FOLL_LONGTERM itself triggers CoW unshare. +*/ region->pages =sev_pin_memory (kvm, range->addr, range->size, ®ion->npages, -FOLL_WRITE |FOLL_LONGTERM ); +FOLL_LONGTERM );if (IS_ERR (region->pages)) { ret =PTR_ERR (region->pages); goto e_free;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 832/869 net: Fix wild-memory-access in __register_pernet_operations() when CONFIG_NET_NS=n.
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuniyuki Iwashima <[email protected]>
[ Upstream commit f0cc3777b2db18307d9734edf2d16e046714760f ]
kernel test robot reported the splat below. [0]
Before commit fed176bf3143 ("net: Add ops_undo_single for module load/unload."), if CONFIG_NET_NS=n, ops was linked to pernet_list only when init_net had not been initialised, and ops was unlinked from pernet_list only under the same condition.
Let's say an ops is loaded before the init_net setup but unloaded after that. Then, the ops remains in pernet_list, which seems odd.
The cited commit added ops_undo_single(), which calls list_add() for ops to link it to a temporary list, so a minor change was added to __register_pernet_operations() and __unregister_pernet_operations() under CONFIG_NET_NS=n to avoid the pernet_list corruption.
However, the corruption must have been left as is.
When CONFIG_NET_NS=n, pernet_list was used to keep ops registered before the init_net setup, and after that, pernet_list was not used at all.
This was because some ops annotated with __net_initdata are cleared out of memory at some point during boot.
Then, such ops is initialised by POISON_FREE_INITMEM (0xcc), resulting in that ops->list.{next,prev} suddenly switches from a valid pointer to a weird value, 0xcccccccccccccccc.
To avoid such wild memory access, let's allow the pernet_list corruption for CONFIG_NET_NS=n.
[0]:
Oops: general protection fault, probably for non-canonical address 0xf999959999999999: 0000 [#1] SMP KASAN NOPTI KASAN: maybe wild-memory-access in range [0xccccccccccccccc8-0xcccccccccccccccf] CPU: 2 UID: 0 PID: 346 Comm: modprobe Not tainted 6.15.0-rc1-00294-ga4cba7e98e35 #85 PREEMPT(voluntary) Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 RIP: 0010:__list_add_valid_or_report (lib/list_debug.c:32) Code: 48 c1 ea 03 80 3c 02 00 0f 85 5a 01 00 00 49 39 74 24 08 0f 85 83 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 f2 48 c1 ea 03 <80> 3c 02 00 0f 85 1f 01 00 00 4c 39 26 0f 85 ab 00 00 00 4c 39 ee RSP: 0018:ff11000135b87830 EFLAGS: 00010a07 RAX: dffffc0000000000 RBX: ffffffffc02223c0 RCX: ffffffff8406fcc2 RDX: 1999999999999999 RSI: cccccccccccccccc RDI: ffffffffc02223c0 RBP: ffffffff86064e40 R08: 0000000000000001 R09: fffffbfff0a9f5b5 R10: ffffffff854fadaf R11: 676552203a54454e R12: ffffffff86064e40 R13: ffffffffc02223c0 R14: ffffffff86064e48 R15: 0000000000000021 FS: 00007f6fb0d9e1c0(0000) GS:ff11000858ea0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f6fb0eda580 CR3: 0000000122fec005 CR4: 0000000000771ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe07f0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: <TASK> register_pernet_operations (./include/linux/list.h:150 (discriminator 5) ./include/linux/list.h:183 (discriminator 5) net/core/net_namespace.c:1315 (discriminator 5) net/core/net_namespace.c:1359 (discriminator 5)) register_pernet_subsys (net/core/net_namespace.c:1401) inet6_init (net/ipv6/af_inet6.c:535) ipv6 do_one_initcall (init/main.c:1257) do_init_module (kernel/module/main.c:2942) load_module (kernel/module/main.c:3409) init_module_from_file (kernel/module/main.c:3599) idempotent_init_module (kernel/module/main.c:3611) __x64_sys_finit_module (./include/linux/file.h:62 ./include/linux/file.h:83 kernel/module/main.c:3634 kernel/module/main.c:3621 kernel/module/main.c:3621) do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) RIP: 0033:0x7f6fb0df7e5d Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 73 9f 1b 00 f7 d8 64 89 01 48 RSP: 002b:00007fffdc6a8968 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 RAX: ffffffffffffffda RBX: 000055b535721b70 RCX: 00007f6fb0df7e5d RDX: 0000000000000000 RSI: 000055b51e44aa2a RDI: 0000000000000004 RBP: 0000000000040000 R08: 0000000000000000 R09: 000055b535721b30 R10: 0000000000000004 R11: 0000000000000246 R12: 000055b51e44aa2a R13: 000055b535721bf0 R14: 000055b5357220b0 R15: 0000000000000000 </TASK> Modules linked in: ipv6(+) crc_ccitt
--- net/core/net_namespace.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
net/core/net_namespace.c +6 -6
@@ -1309,19 +1309,19 @@ static void __unregister_pernet_operations(struct pernet_operations *ops)static int __register_pernet_operations (struct list_head *list,struct pernet_operations *ops) { -list_add_tail (&ops->list, list); - -if (!init_net_initialized) +if (!init_net_initialized) { +list_add_tail (&ops->list, list);return 0 ; + }return ops_init (ops, &init_net); }static void __unregister_pernet_operations (struct pernet_operations *ops) { -list_del (&ops->list); - -if (init_net_initialized) { +if (!init_net_initialized) { +list_del (&ops->list); + }else {LIST_HEAD (net_exit_list);list_add (&init_net.exit_list, &net_exit_list);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 833/869 mpls: Set rt->rt_nhn just before returning from mpls_nh_build_multi().
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuniyuki Iwashima <[email protected]>
[ Upstream commit 3671f0419d90b98a02f313830595ab958c8b2025 ]
Commit f0914b8436c5 ("mpls: Hold dev refcnt for mpls_nh.") added change_nexthops() loop to call netdev_put() for the nexthop devices before freeing mpls_route.
Then, mpls_nh_build_multi() was also changed to avoid iterating uninitialised nexthops in mpls_rt_free_rcu().
However, setting rt->rt_nhn to 0 at the entry of mpls_nh_build_multi() makes the following change_nexthops() no-op.
Let's set rt->rt_nhn just before returning from mpls_nh_build_multi().
--- net/mpls/af_mpls.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
net/mpls/af_mpls.c +5 -3
@@ -929,8 +929,7 @@ static int mpls_nh_build_multi(struct mpls_route_config *cfg,struct nlattr *nla_via, *nla_newdst;int remaining = cfg->rc_mp_len;int err =0 ; - - rt->rt_nhn =0 ; +u8 nhs =0 ;change_nexthops (rt) {int attrlen;
@@ -966,12 +965,15 @@ static int mpls_nh_build_multi(struct mpls_route_config *cfg, rt->rt_nhn_alive--; rtnh =rtnh_next (rtnh, &remaining); - rt->rt_nhn++; + nhs++; }endfor_nexthops (rt); + rt->rt_nhn = nhs; +return 0 ; errout: + rt->rt_nhn = nhs;return err; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 834/869 media: verisilicon: Fix kernel panic due to __initconst misuse
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ming Qian <[email protected]>
[ Upstream commit e8d97c270cb46a2a88739019d0f8547adc7d97da ]
Fix a kernel panic when probing the driver as a module:
Unable to handle kernel paging request at virtual address ffffd9c18eb05000 of_find_matching_node_and_match+0x5c/0x1a0 hantro_probe+0x2f4/0x7d0 [hantro_vpu]
The imx8mq_vpu_shared_resources array is referenced by variant structures through their shared_devices field. When built as a module, __initconst causes this data to be freed after module init, but it's later accessed during probe, causing a page fault.
The imx8mq_vpu_shared_resources is referenced from non-init code, so keeping __initconst or __initconst_or_module here is wrong.
Drop the __initconst annotation and let it live in the normal .rodata section.
A bug of __initconst called from regular non-init probe code leading to bugs during probe deferrals or during unbind-bind cycles.
--- drivers/media/platform/verisilicon/imx8m_vpu_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/verisilicon/imx8m_vpu_hw.c +1 -1
@@ -361,7 +361,7 @@ const struct hantro_variant imx8mq_vpu_variant = { .num_regs = ARRAY_SIZE(imx8mq_reg_names) }; -static const struct of_device_id imx8mq_vpu_shared_resources[]__initconst = { +static const struct of_device_id imx8mq_vpu_shared_resources[] = { { .compatible ="nxp,imx8mq-vpu-g1" , }, { .compatible ="nxp,imx8mq-vpu-g2" , }, {/* sentinel */ }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 835/869 soc/tegra: pmc: Document tegra_pmc.syscore field
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thierry Reding <[email protected]>
[ Upstream commit aaca2e9933a362bcd89ec563b3e89de18460335f ]
This eliminates a warning from the documentation build targets.
Stable-dep-of: e6ad1988e568 ("soc/tegra: pmc: Add kerneldoc for wake-up variables")
--- drivers/soc/tegra/pmc.c | 1 + 1 file changed, 1 insertion(+)
drivers/soc/tegra/pmc.c +1 -0
@@ -424,6 +424,7 @@ struct tegra_pmc_soc {* @wake_sw_status_map: Bitmap to hold raw status of wakes without mask * @wake_cntrl_level_map: Bitmap to hold wake levels to be programmed in * cntrl register associated with each wake during system suspend. +* @syscore: syscore suspend/resume callbacks */ struct tegra_pmc {struct device *dev;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 836/869 soc/tegra: pmc: Add kerneldoc for wake-up variables
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jon Hunter <[email protected]>
[ Upstream commit e6ad1988e56834d641ba4aa0d58970723c1c9c9b ]
Commit e6d96073af68 ("soc/tegra: pmc: Fix unsafe generic_handle_irq() call") added the variables 'wake_work' and 'wake_status' to the 'tegra_pmc' structure but did not add the associated kerneldoc for these new variables. Add the kerneldoc for these variables.
--- drivers/soc/tegra/pmc.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/soc/tegra/pmc.c +2 -0
@@ -425,6 +425,8 @@ struct tegra_pmc_soc {* @wake_cntrl_level_map: Bitmap to hold wake levels to be programmed in * cntrl register associated with each wake during system suspend. * @syscore: syscore suspend/resume callbacks +* @wake_work: IRQ work handler for processing wake-up events. +* @wake_status: Status of wake-up events. */ struct tegra_pmc {struct device *dev;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 837/869 i3c: mipi-i3c-hci: Preserve RUN bit when aborting DMA ring
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adrian Hunter <[email protected]>
[ Upstream commit 093eb8e73c90aa0c8cfb0421aa85bd70c23488be ]
The MIPI I3C HCI specification does not require the DMA ring RUN bit (RUN_STOP) to be cleared when issuing an ABORT. That allows the DMA ring to continue to receive IBIs, although an IBI is anyway not lost because it can be received once the ring restarts if the I3C device has not given up. Note, currently ABORT is only used on a timeout error path so the change has very little effect in practice. In the more common case of a transfer error, the ring (bundle) operation is halted by the controller anyway.
Adjust the RING_CONTROL handling to set ABORT without clearing RUN_STOP, bringing the driver into alignment with the specification.
--- drivers/i3c/master/mipi-i3c-hci/dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i3c/master/mipi-i3c-hci/dma.c +1 -1
@@ -465,7 +465,7 @@ static bool hci_dma_dequeue_xfer(struct i3c_hci *hci,if (ring_status &RING_STATUS_RUNNING ) {/* stop the ring */ reinit_completion (&rh->op_done); -rh_reg_write (RING_CONTROL ,RING_CTRL_ENABLE |RING_CTRL_ABORT ); +rh_reg_write (RING_CONTROL ,rh_reg_read (RING_CONTROL ) |RING_CTRL_ABORT );wait_for_completion_timeout (&rh->op_done,HZ ); ring_status =rh_reg_read (RING_STATUS );if (ring_status &RING_STATUS_RUNNING ) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 838/869 ceph: do not skip the first folio of the next object in writeback
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hristo Venev <[email protected]>
[ Upstream commit 081a0b78ef30f5746cda3e92e28b4d4ae92901d1 ]
When ceph_process_folio_batch encounters a folio past the end of the current object, it should leave it in the batch so that it is picked up in the next iteration.
Removing the folio from the batch means that it does not get written back and remains dirty instead. This makes fsync() silently skip some of the data, delays capability release, and breaks coherence with O_DIRECT.
The link below contains instructions for reproducing the bug.
--- fs/ceph/addr.c | 1 - 1 file changed, 1 deletion(-)
fs/ceph/addr.c +0 -1
@@ -1326,7 +1326,6 @@ int ceph_process_folio_batch(struct address_space *mapping, }else if (rc == -E2BIG ) { rc =0 ;folio_unlock (folio); - ceph_wbc->fbatch.folios[i] =NULL ;break ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 839/869 ceph: fix crash after fscrypt_encrypt_pagecache_blocks() error
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Max Kellermann <[email protected]>
[ Upstream commit 249e0a47cdb46bb9eae65511c569044bd8698d7d ]
The function move_dirty_folio_in_page_array() was created by commit ce80b76dd327 ("ceph: introduce ceph_process_folio_batch() method") by moving code from ceph_writepages_start() to this function.
This new function is supposed to return an error code which is checked by the caller (now ceph_process_folio_batch()), and on error, the caller invokes redirty_page_for_writepage() and then breaks from the loop.
However, the refactoring commit has gone wrong, and it by accident, it always returns 0 (= success) because it first NULLs the pointer and then returns PTR_ERR(NULL) which is always 0. This means errors are silently ignored, leaving NULL entries in the page array, which may later crash the kernel.
The simple solution is to call PTR_ERR() before clearing the pointer.
--- fs/ceph/addr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/ceph/addr.c +4 -2
@@ -1259,7 +1259,9 @@ int ceph_move_dirty_page_in_page_array(struct address_space *mapping,0 , gfp_flags);if (IS_ERR (pages[index])) { -if (PTR_ERR (pages[index]) == -EINVAL ) { +int err =PTR_ERR (pages[index]); + +if (err == -EINVAL ) {pr_err_client (cl,"inode->i_blkbits=%hhu\n" , inode->i_blkbits); }
@@ -1268,7 +1270,7 @@ int ceph_move_dirty_page_in_page_array(struct address_space *mapping,BUG_ON (ceph_wbc->locked_pages ==0 ); pages[index] =NULL ; -return PTR_ERR (pages[index]); +return err; } }else { pages[index] = page;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 840/869 ceph: introduce ceph_submit_write() method
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Viacheslav Dubeyko <[email protected]>
[ Upstream commit 1551ec61dc551dab1bb40c516a5a096607aff774 ]
Final responsibility of ceph_writepages_start() is to submit write requests for processed dirty folios/pages. The ceph_submit_write() summarize all this logic in one method.
The generic/421 fails to finish because of the issue:
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.894678] INFO: task kworker/u48:0:11 blocked for more than 122 seconds. Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.895403] Not tainted 6.13.0-rc5+ #1
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.895867] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.896633] task:kworker/u48:0 state:D stack:0 pid:11 tgid:11 ppid:2 flags:0x00004000 Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.896641] Workqueue: writeback wb_workfn (flush-ceph-24)
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897614] Call Trace:
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897620] <TASK>
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897629] __schedule+0x443/0x16b0
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897637] schedule+0x2b/0x140
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897640] io_schedule+0x4c/0x80
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897643] folio_wait_bit_common+0x11b/0x310
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897646] ? _raw_spin_unlock_irq+0xe/0x50
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897652] ? __pfx_wake_page_function+0x10/0x10
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897655] __folio_lock+0x17/0x30
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897658] ceph_writepages_start+0xca9/0x1fb0
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897663] ? fsnotify_remove_queued_event+0x2f/0x40
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897668] do_writepages+0xd2/0x240
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897672] __writeback_single_inode+0x44/0x350
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897675] writeback_sb_inodes+0x25c/0x550
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897680] wb_writeback+0x89/0x310
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897683] ? finish_task_switch.isra.0+0x97/0x310
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897687] wb_workfn+0xb5/0x410
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897689] process_one_work+0x188/0x3d0
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897692] worker_thread+0x2b5/0x3c0
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897694] ? __pfx_worker_thread+0x10/0x10
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897696] kthread+0xe1/0x120
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897699] ? __pfx_kthread+0x10/0x10
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897701] ret_from_fork+0x43/0x70
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897705] ? __pfx_kthread+0x10/0x10
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897707] ret_from_fork_asm+0x1a/0x30
Jan 3 14:25:27 ceph-testing-0001 kernel: [ 369.897711] </TASK>
There are two problems here:
if (!ceph_inc_osd_stopping_blocker(fsc->mdsc)) {
rc = -EIO;
goto release_folios;
}(1) ceph_kill_sb() doesn't wait ending of flushing all dirty folios/pages because of racy nature of mdsc->stopping_blockers. As a result, mdsc->stopping becomes CEPH_MDSC_STOPPING_FLUSHED too early.
(2) The ceph_inc_osd_stopping_blocker(fsc->mdsc) fails to increment mdsc->stopping_blockers. Finally, already locked folios/pages are never been unlocked and the logic tries to lock the same page second time.
This patch implements refactoring of ceph_submit_write() and also it solves the second issue.
Stable-dep-of: cce7c15faaac ("ceph: always call ceph_shift_unused_folios_left()")
--- fs/ceph/addr.c | 461 +++++++++++++++++++++++++++---------------------- 1 file changed, 257 insertions(+), 204 deletions(-)
fs/ceph/addr.c +257 -204
@@ -1385,6 +1385,245 @@ int ceph_process_folio_batch(struct address_space *mapping,return rc; } +static inline +void ceph_shift_unused_folios_left (struct folio_batch *fbatch) +{ +unsigned j, n =0 ; + +/* shift unused page to beginning of fbatch */ +for (j =0 ; j <folio_batch_count (fbatch); j++) { +if (!fbatch->folios[j]) +continue ; + +if (n < j) { + fbatch->folios[n] = fbatch->folios[j]; + } + + n++; + } + + fbatch->nr = n; +} + +static +int ceph_submit_write (struct address_space *mapping, +struct writeback_control *wbc, +struct ceph_writeback_ctl *ceph_wbc) +{ +struct inode *inode = mapping->host; +struct ceph_inode_info *ci =ceph_inode (inode); +struct ceph_fs_client *fsc =ceph_inode_to_fs_client (inode); +struct ceph_client *cl = fsc->client; +struct ceph_vino vino =ceph_vino (inode); +struct ceph_osd_request *req =NULL ; +struct page *page =NULL ; +bool caching =ceph_is_cache_enabled (inode); +u64 offset; +u64 len; +unsigned i; + +new_request: + offset =ceph_fscrypt_page_offset (ceph_wbc->pages[0 ]); + len = ceph_wbc->wsize; + + req =ceph_osdc_new_request (&fsc->client->osdc, + &ci->i_layout, vino, + offset, &len,0 , ceph_wbc->num_ops, +CEPH_OSD_OP_WRITE ,CEPH_OSD_FLAG_WRITE , + ceph_wbc->snapc, ceph_wbc->truncate_seq, + ceph_wbc->truncate_size, false); +if (IS_ERR (req)) { + req =ceph_osdc_new_request (&fsc->client->osdc, + &ci->i_layout, vino, + offset, &len,0 , +min (ceph_wbc->num_ops, +CEPH_OSD_SLAB_OPS ), +CEPH_OSD_OP_WRITE , +CEPH_OSD_FLAG_WRITE , + ceph_wbc->snapc, + ceph_wbc->truncate_seq, + ceph_wbc->truncate_size, + true); +BUG_ON (IS_ERR (req)); + } + + page = ceph_wbc->pages[ceph_wbc->locked_pages -1 ]; +BUG_ON (len <ceph_fscrypt_page_offset (page) +thp_size (page) - offset); + +if (!ceph_inc_osd_stopping_blocker (fsc->mdsc)) { +for (i =0 ; i <folio_batch_count (&ceph_wbc->fbatch); i++) { +struct folio *folio = ceph_wbc->fbatch.folios[i]; + +if (!folio) +continue ; + + page = &folio->page; +redirty_page_for_writepage (wbc, page); +unlock_page (page); + } + +for (i =0 ; i < ceph_wbc->locked_pages; i++) { + page =ceph_fscrypt_pagecache_page (ceph_wbc->pages[i]); + +if (!page) +continue ; + +redirty_page_for_writepage (wbc, page); +unlock_page (page); + } + +ceph_osdc_put_request (req); +return -EIO ; + } + + req->r_callback = writepages_finish; + req->r_inode = inode; + +/* Format the osd request message and submit the write */ + len =0 ; + ceph_wbc->data_pages = ceph_wbc->pages; + ceph_wbc->op_idx =0 ; +for (i =0 ; i < ceph_wbc->locked_pages; i++) { +u64 cur_offset; + + page =ceph_fscrypt_pagecache_page (ceph_wbc->pages[i]); + cur_offset =page_offset (page); + +/* +* Discontinuity in page range? Ceph can handle that by just passing +* multiple extents in the write op. +*/ +if (offset + len != cur_offset) { +/* If it's full, stop here */ +if (ceph_wbc->op_idx +1 == req->r_num_ops) +break ; + +/* Kick off an fscache write with what we have so far. */ +ceph_fscache_write_to_cache (inode, offset, len, caching); + +/* Start a new extent */ +osd_req_op_extent_dup_last (req, ceph_wbc->op_idx, + cur_offset - offset); + +doutc (cl,"got pages at %llu~%llu\n" , offset, len); + +osd_req_op_extent_osd_data_pages (req, ceph_wbc->op_idx, + ceph_wbc->data_pages, + len,0 , + ceph_wbc->from_pool, + false); +osd_req_op_extent_update (req, ceph_wbc->op_idx, len); + + len =0 ; + offset = cur_offset; + ceph_wbc->data_pages = ceph_wbc->pages + i; + ceph_wbc->op_idx++; + } + +set_page_writeback (page); + +if (caching) +ceph_set_page_fscache (page); + + len +=thp_size (page); + } + +ceph_fscache_write_to_cache (inode, offset, len, caching); + +if (ceph_wbc->size_stable) { + len =min (len, ceph_wbc->i_size - offset); + }else if (i == ceph_wbc->locked_pages) { +/* writepages_finish() clears writeback pages +* according to the data length, so make sure +* data length covers all locked pages */ +u64 min_len = len +1 -thp_size (page); + len =get_writepages_data_length (inode, + ceph_wbc->pages[i -1 ], + offset); + len =max (len, min_len); + } + +if (IS_ENCRYPTED (inode)) + len =round_up (len,CEPH_FSCRYPT_BLOCK_SIZE ); + +doutc (cl,"got pages at %llu~%llu\n" , offset, len); + +if (IS_ENCRYPTED (inode) && + ((offset | len) & ~CEPH_FSCRYPT_BLOCK_MASK )) { +pr_warn_client (cl, +"bad encrypted write offset=%lld len=%llu\n" , + offset, len); + } + +osd_req_op_extent_osd_data_pages (req, ceph_wbc->op_idx, + ceph_wbc->data_pages, len, +0 , ceph_wbc->from_pool, false); +osd_req_op_extent_update (req, ceph_wbc->op_idx, len); + +BUG_ON (ceph_wbc->op_idx +1 != req->r_num_ops); + + ceph_wbc->from_pool = false; +if (i < ceph_wbc->locked_pages) { +BUG_ON (ceph_wbc->num_ops <= req->r_num_ops); + ceph_wbc->num_ops -= req->r_num_ops; + ceph_wbc->locked_pages -= i; + +/* allocate new pages array for next request */ + ceph_wbc->data_pages = ceph_wbc->pages; +__ceph_allocate_page_array (ceph_wbc, ceph_wbc->locked_pages); +memcpy (ceph_wbc->pages, ceph_wbc->data_pages + i, + ceph_wbc->locked_pages *sizeof (*ceph_wbc->pages)); +memset (ceph_wbc->data_pages + i,0 , + ceph_wbc->locked_pages *sizeof (*ceph_wbc->pages)); + }else { +BUG_ON (ceph_wbc->num_ops != req->r_num_ops); +/* request message now owns the pages array */ + ceph_wbc->pages =NULL ; + } + + req->r_mtime =inode_get_mtime (inode); +ceph_osdc_start_request (&fsc->client->osdc, req); + req =NULL ; + + wbc->nr_to_write -= i; +if (ceph_wbc->pages) + goto new_request; + +return 0 ; +} + +static +void ceph_wait_until_current_writes_complete (struct address_space *mapping, +struct writeback_control *wbc, +struct ceph_writeback_ctl *ceph_wbc) +{ +struct page *page; +unsigned i, nr; + +if (wbc->sync_mode !=WB_SYNC_NONE && + ceph_wbc->start_index ==0 &&/* all dirty pages were checked */ + !ceph_wbc->head_snapc) { + ceph_wbc->index =0 ; + +while ((ceph_wbc->index <= ceph_wbc->end) && + (nr =filemap_get_folios_tag (mapping, + &ceph_wbc->index, + (pgoff_t)-1 , +PAGECACHE_TAG_WRITEBACK , + &ceph_wbc->fbatch))) { +for (i =0 ; i < nr; i++) { + page = &ceph_wbc->fbatch.folios[i]->page; +if (page_snap_context (page) != ceph_wbc->snapc) +continue ; +wait_on_page_writeback (page); + } + +folio_batch_release (&ceph_wbc->fbatch); +cond_resched (); + } + } +} +/* * initiate async writeback */
@@ -1392,17 +1631,12 @@ static int ceph_writepages_start(struct address_space *mapping, struct writeback_control *wbc) {struct inode *inode = mapping->host; -struct ceph_inode_info *ci =ceph_inode (inode);struct ceph_fs_client *fsc =ceph_inode_to_fs_client (inode);struct ceph_client *cl = fsc->client; -struct ceph_vino vino =ceph_vino (inode);struct ceph_writeback_ctl ceph_wbc; -struct ceph_osd_request *req =NULL ;int rc =0 ; -bool caching =ceph_is_cache_enabled (inode); -if (wbc->sync_mode ==WB_SYNC_NONE && - fsc->write_congested) +if (wbc->sync_mode ==WB_SYNC_NONE && fsc->write_congested)return 0 ; doutc(cl, "%llx.%llx (mode=%s)\n", ceph_vinop(inode),
@@ -1429,9 +1663,6 @@ static int ceph_writepages_start(struct address_space *mapping,tag_pages_for_writeback (mapping, ceph_wbc.index, ceph_wbc.end);while (!has_writeback_done (&ceph_wbc)) { -unsigned i; -struct page *page; - ceph_wbc.locked_pages =0 ; ceph_wbc.max_pages = ceph_wbc.wsize >>PAGE_SHIFT ;
@@ -1449,6 +1680,7 @@ static int ceph_writepages_start(struct address_space *mapping,if (!ceph_wbc.nr_folios && !ceph_wbc.locked_pages)break ; +process_folio_batch: rc =ceph_process_folio_batch (mapping, wbc, &ceph_wbc);if (rc) goto release_folios;
@@ -1456,187 +1688,30 @@ static int ceph_writepages_start(struct address_space *mapping,/* did we get anything? */ if (!ceph_wbc.locked_pages) goto release_folios; -if (i) { -unsigned j, n =0 ; -/* shift unused page to beginning of fbatch */ -for (j =0 ; j < ceph_wbc.nr_folios; j++) { -if (!ceph_wbc.fbatch.folios[j]) -continue ; -if (n < j) { - ceph_wbc.fbatch.folios[n] = - ceph_wbc.fbatch.folios[j]; - } - n++; - } - ceph_wbc.fbatch.nr = n; -if (ceph_wbc.nr_folios && i == ceph_wbc.nr_folios && +if (ceph_wbc.processed_in_fbatch) { +ceph_shift_unused_folios_left (&ceph_wbc.fbatch); + +if (folio_batch_count (&ceph_wbc.fbatch) ==0 && ceph_wbc.locked_pages < ceph_wbc.max_pages) {doutc (cl,"reached end fbatch, trying for more\n" ); -folio_batch_release (&ceph_wbc.fbatch); goto get_more_pages; } } -new_request: - ceph_wbc.offset =ceph_fscrypt_page_offset (ceph_wbc.pages[0 ]); - ceph_wbc.len = ceph_wbc.wsize; - - req =ceph_osdc_new_request (&fsc->client->osdc, - &ci->i_layout, vino, - ceph_wbc.offset, &ceph_wbc.len, -0 , ceph_wbc.num_ops, -CEPH_OSD_OP_WRITE ,CEPH_OSD_FLAG_WRITE , - ceph_wbc.snapc, ceph_wbc.truncate_seq, - ceph_wbc.truncate_size, false); -if (IS_ERR (req)) { - req =ceph_osdc_new_request (&fsc->client->osdc, - &ci->i_layout, vino, - ceph_wbc.offset, &ceph_wbc.len, -0 ,min (ceph_wbc.num_ops, -CEPH_OSD_SLAB_OPS ), -CEPH_OSD_OP_WRITE , -CEPH_OSD_FLAG_WRITE , - ceph_wbc.snapc, - ceph_wbc.truncate_seq, - ceph_wbc.truncate_size, true); -BUG_ON (IS_ERR (req)); - } -BUG_ON (ceph_wbc.len < -ceph_fscrypt_page_offset (ceph_wbc.pages[ceph_wbc.locked_pages -1 ]) + -thp_size (ceph_wbc.pages[ceph_wbc.locked_pages -1 ]) - - ceph_wbc.offset); - -if (!ceph_inc_osd_stopping_blocker (fsc->mdsc)) { - rc = -EIO ; + rc =ceph_submit_write (mapping, wbc, &ceph_wbc); +if (rc) goto release_folios; - } - req->r_callback = writepages_finish; - req->r_inode = inode; - -/* Format the osd request message and submit the write */ - ceph_wbc.len =0 ; - ceph_wbc.data_pages = ceph_wbc.pages; - ceph_wbc.op_idx =0 ; -for (i =0 ; i < ceph_wbc.locked_pages; i++) { -struct page *page = -ceph_fscrypt_pagecache_page (ceph_wbc.pages[i]); - -u64 cur_offset =page_offset (page); -/* -* Discontinuity in page range? Ceph can handle that by just passing -* multiple extents in the write op. -*/ -if (ceph_wbc.offset + ceph_wbc.len != cur_offset) { -/* If it's full, stop here */ -if (ceph_wbc.op_idx +1 == req->r_num_ops) -break ; - -/* Kick off an fscache write with what we have so far. */ -ceph_fscache_write_to_cache (inode, ceph_wbc.offset, - ceph_wbc.len, caching); - -/* Start a new extent */ -osd_req_op_extent_dup_last (req, ceph_wbc.op_idx, - cur_offset - - ceph_wbc.offset); -doutc (cl,"got pages at %llu~%llu\n" , - ceph_wbc.offset, - ceph_wbc.len); -osd_req_op_extent_osd_data_pages (req, - ceph_wbc.op_idx, - ceph_wbc.data_pages, - ceph_wbc.len,0 , - ceph_wbc.from_pool, false); -osd_req_op_extent_update (req, ceph_wbc.op_idx, - ceph_wbc.len); - - ceph_wbc.len =0 ; - ceph_wbc.offset = cur_offset; - ceph_wbc.data_pages = ceph_wbc.pages + i; - ceph_wbc.op_idx++; - } -set_page_writeback (page); -if (caching) -ceph_set_page_fscache (page); - ceph_wbc.len +=thp_size (page); - } -ceph_fscache_write_to_cache (inode, ceph_wbc.offset, - ceph_wbc.len, caching); - -if (ceph_wbc.size_stable) { - ceph_wbc.len =min (ceph_wbc.len, - ceph_wbc.i_size - ceph_wbc.offset); - }else if (i == ceph_wbc.locked_pages) { -/* writepages_finish() clears writeback pages -* according to the data length, so make sure -* data length covers all locked pages */ -u64 min_len = ceph_wbc.len +1 -thp_size (page); - ceph_wbc.len = -get_writepages_data_length (inode, - ceph_wbc.pages[i -1 ], - ceph_wbc.offset); - ceph_wbc.len =max (ceph_wbc.len, min_len); - } -if (IS_ENCRYPTED (inode)) { - ceph_wbc.len =round_up (ceph_wbc.len, -CEPH_FSCRYPT_BLOCK_SIZE ); - } - -doutc (cl,"got pages at %llu~%llu\n" , - ceph_wbc.offset, ceph_wbc.len); + ceph_wbc.locked_pages =0 ; + ceph_wbc.strip_unit_end =0 ; -if (IS_ENCRYPTED (inode) && - ((ceph_wbc.offset | ceph_wbc.len) & ~CEPH_FSCRYPT_BLOCK_MASK )) -pr_warn_client (cl, -"bad encrypted write offset=%lld len=%llu\n" , - ceph_wbc.offset, ceph_wbc.len); - -osd_req_op_extent_osd_data_pages (req, ceph_wbc.op_idx, - ceph_wbc.data_pages, - ceph_wbc.len, -0 , ceph_wbc.from_pool, false); -osd_req_op_extent_update (req, ceph_wbc.op_idx, ceph_wbc.len); - -BUG_ON (ceph_wbc.op_idx +1 != req->r_num_ops); - - ceph_wbc.from_pool = false; -if (i < ceph_wbc.locked_pages) { -BUG_ON (ceph_wbc.num_ops <= req->r_num_ops); - ceph_wbc.num_ops -= req->r_num_ops; - ceph_wbc.locked_pages -= i; - -/* allocate new pages array for next request */ - ceph_wbc.data_pages = ceph_wbc.pages; - ceph_wbc.pages =kmalloc_array (ceph_wbc.locked_pages, -sizeof (*ceph_wbc.pages), -GFP_NOFS ); -if (!ceph_wbc.pages) { - ceph_wbc.from_pool = true; - ceph_wbc.pages = -mempool_alloc (ceph_wb_pagevec_pool,GFP_NOFS ); -BUG_ON (!ceph_wbc.pages); - } -memcpy (ceph_wbc.pages, ceph_wbc.data_pages + i, - ceph_wbc.locked_pages *sizeof (*ceph_wbc.pages)); -memset (ceph_wbc.data_pages + i,0 , - ceph_wbc.locked_pages *sizeof (*ceph_wbc.pages)); - }else { -BUG_ON (ceph_wbc.num_ops != req->r_num_ops); - ceph_wbc.index = ceph_wbc.pages[i -1 ]->index +1 ; -/* request message now owns the pages array */ - ceph_wbc.pages =NULL ; +if (folio_batch_count (&ceph_wbc.fbatch) >0 ) { + ceph_wbc.nr_folios = +folio_batch_count (&ceph_wbc.fbatch); + goto process_folio_batch; } - req->r_mtime =inode_get_mtime (inode); -ceph_osdc_start_request (&fsc->client->osdc, req); - req =NULL ; - - wbc->nr_to_write -= i; -if (ceph_wbc.pages) - goto new_request; -/* * We stop writing back only if we are not doing * integrity sync. In case of integrity sync we have to
@@ -1656,32 +1731,12 @@ static int ceph_writepages_start(struct address_space *mapping,if (ceph_wbc.should_loop && !ceph_wbc.done) {/* more to do; loop back to beginning of file */ doutc (cl,"looping back to beginning of file\n" ); - ceph_wbc.end = ceph_wbc.start_index -1 ;/* OK even when start_index == 0 */ +/* OK even when start_index == 0 */ + ceph_wbc.end = ceph_wbc.start_index -1 ;/* to write dirty pages associated with next snapc, * we need to wait until current writes complete */ -if (wbc->sync_mode !=WB_SYNC_NONE && - ceph_wbc.start_index ==0 &&/* all dirty pages were checked */ - !ceph_wbc.head_snapc) { -struct page *page; -unsigned i, nr; - ceph_wbc.index =0 ; -while ((ceph_wbc.index <= ceph_wbc.end) && - (nr =filemap_get_folios_tag (mapping, - &ceph_wbc.index, - (pgoff_t)-1 , -PAGECACHE_TAG_WRITEBACK , - &ceph_wbc.fbatch))) { -for (i =0 ; i < nr; i++) { - page = &ceph_wbc.fbatch.folios[i]->page; -if (page_snap_context (page) != ceph_wbc.snapc) -continue ; -wait_on_page_writeback (page); - } -folio_batch_release (&ceph_wbc.fbatch); -cond_resched (); - } - } +ceph_wait_until_current_writes_complete (mapping, wbc, &ceph_wbc); ceph_wbc.start_index =0 ; ceph_wbc.index =0 ;
@@ -1692,15 +1747,13 @@ static int ceph_writepages_start(struct address_space *mapping, mapping->writeback_index = ceph_wbc.index; out: -ceph_osdc_put_request (req);ceph_put_snap_context (ceph_wbc.last_snapc);doutc (cl,"%llx.%llx dend - startone, rc = %d\n" ,ceph_vinop (inode), rc); +return rc; } - -/* * See if a given @snapc is either writeable, or already written. */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 841/869 ceph: always call ceph_shift_unused_folios_left()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Max Kellermann <[email protected]>
[ Upstream commit cce7c15faaac79b532a07ed6ab8332280ad83762 ]
The function ceph_process_folio_batch() sets folio_batch entries to NULL, which is an illegal state. Before folio_batch_release() crashes due to this API violation, the function ceph_shift_unused_folios_left() is supposed to remove those NULLs from the array.
However, since commit ce80b76dd327 ("ceph: introduce ceph_process_folio_batch() method"), this shifting doesn't happen anymore because the "for" loop got moved to ceph_process_folio_batch(), and now the i variable that remains in ceph_writepages_start() doesn't get incremented anymore, making the shifting effectively unreachable much of the time.
Later, commit 1551ec61dc55 ("ceph: introduce ceph_submit_write() method") added more preconditions for doing the shift, replacing the i check (with something that is still just as broken):
- if ceph_process_folio_batch() fails, shifting never happens
- if ceph_move_dirty_page_in_page_array() was never called (because ceph_process_folio_batch() has returned early for some of various reasons), shifting never happens
- if processed_in_fbatch is zero (because ceph_process_folio_batch() has returned early for some of the reasons mentioned above or because ceph_move_dirty_page_in_page_array() has failed), shifting never happens
Since those two commits, any problem in ceph_process_folio_batch() could crash the kernel, e.g. this way:
BUG: kernel NULL pointer dereference, address: 0000000000000034 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 0 P4D 0 Oops: Oops: 0002 [#1] SMP NOPTI CPU: 172 UID: 0 PID: 2342707 Comm: kworker/u778:8 Not tainted 6.15.10-cm4all1-es #714 NONE Hardware name: Dell Inc. PowerEdge R7615/0G9DHV, BIOS 1.6.10 12/08/2023 Workqueue: writeback wb_workfn (flush-ceph-1) RIP: 0010:folios_put_refs+0x85/0x140 Code: 83 c5 01 39 e8 7e 76 48 63 c5 49 8b 5c c4 08 b8 01 00 00 00 4d 85 ed 74 05 41 8b 44 ad 00 48 8b 15 b0 > RSP: 0018:ffffb880af8db778 EFLAGS: 00010207 RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000003 RDX: ffffe377cc3b0000 RSI: 0000000000000000 RDI: ffffb880af8db8c0 RBP: 0000000000000000 R08: 000000000000007d R09: 000000000102b86f R10: 0000000000000001 R11: 00000000000000ac R12: ffffb880af8db8c0 R13: 0000000000000000 R14: 0000000000000000 R15: ffff9bd262c97000 FS: 0000000000000000(0000) GS:ffff9c8efc303000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000034 CR3: 0000000160958004 CR4: 0000000000770ef0 PKRU: 55555554 Call Trace: <TASK> ceph_writepages_start+0xeb9/0x1410
The crash can be reproduced easily by changing the ceph_check_page_before_write() return value to -E2BIG.
(Interestingly, the crash happens only if huge_zero_folio has already been allocated; without huge_zero_folio, is_huge_zero_folio(NULL) returns true and folios_put_refs() skips NULL entries instead of dereferencing them. That makes reproducing the bug somewhat unreliable. See
https://lore.kernel.org/[email protected]
for a discussion of this detail.)
My suggestion is to move the ceph_shift_unused_folios_left() to right after ceph_process_folio_batch() to ensure it always gets called to fix up the illegal folio_batch state.
--- fs/ceph/addr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/ceph/addr.c +1 -2
@@ -1682,6 +1682,7 @@ static int ceph_writepages_start(struct address_space *mapping, process_folio_batch: rc =ceph_process_folio_batch (mapping, wbc, &ceph_wbc); +ceph_shift_unused_folios_left (&ceph_wbc.fbatch);if (rc) goto release_folios;
@@ -1690,8 +1691,6 @@ static int ceph_writepages_start(struct address_space *mapping, goto release_folios;if (ceph_wbc.processed_in_fbatch) { -ceph_shift_unused_folios_left (&ceph_wbc.fbatch); -if (folio_batch_count (&ceph_wbc.fbatch) ==0 && ceph_wbc.locked_pages < ceph_wbc.max_pages) {doutc (cl,"reached end fbatch, trying for more\n" );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 842/869 spi: microchip-core-qspi: stop checking viability of op->max_freq in supports_op callback
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Conor Dooley <[email protected]>
[ Upstream commit 89e7353f522f5cf70cb48c01ce2dcdcb275b8022 ]
In commit 13529647743d9 ("spi: microchip-core-qspi: Support per spi-mem operation frequency switches") the logic for checking the viability of op->max_freq in mchp_coreqspi_setup_clock() was copied into mchp_coreqspi_supports_op(). Unfortunately, op->max_freq is not valid when this function is called during probe but is instead zero. Accordingly, baud_rate_val is calculated to be INT_MAX due to division by zero, causing probe of the attached memory device to fail.
Seemingly spi-microchip-core-qspi was the only driver that had such a modification made to its supports_op callback when the per_op_freq capability was added, so just remove it to restore prior functionality.
Message-ID: <20250825-during-ploy-939bdd068593@spud>
--- drivers/spi/spi-microchip-core-qspi.c | 12 ------------ 1 file changed, 12 deletions(-)
drivers/spi/spi-microchip-core-qspi.c +0 -12
@@ -486,10 +486,6 @@ static int mchp_coreqspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *ostatic bool mchp_coreqspi_supports_op (struct spi_mem *mem,const struct spi_mem_op *op) { -struct mchp_coreqspi *qspi =spi_controller_get_devdata (mem->spi->controller); -unsigned long clk_hz; -u32 baud_rate_val; -if (!spi_mem_default_supports_op (mem, op))return false;
@@ -512,14 +508,6 @@ static bool mchp_coreqspi_supports_op(struct spi_mem *mem, const struct spi_mem_return false; } - clk_hz =clk_get_rate (qspi->clk); -if (!clk_hz) -return false; - - baud_rate_val =DIV_ROUND_UP (clk_hz,2 * op->max_freq); -if (baud_rate_val >MAX_DIVIDER || baud_rate_val <MIN_DIVIDER ) -return false; -return true; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 843/869 sched/psi: Create the psimon kthread outside of cgroup_mutex
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <[email protected]>
[ Upstream commit fadeedd7cfc5d73d33fa3d7ac54b9b27aabd09d2 ]
a5b98009f16d ("sched/psi: fix race between file release and pressure write") made pressure_write() hold cgroup_mutex across psi_trigger_create(), which forks the psimon kthread for the first rtpoll trigger. As kthread creation depends on the whole fork path, the commit inadvertently created a lot of unwanted locking dependencies from cgroup_mutex.
sched_ext got hit by one: its enable path blocks forks and then grabs cgroup_mutex, so a pressure write racing a scheduler enable deadlocks, with every other fork piling up behind.
Fix it by splitting trigger creation so that the worker is forked with cgroup_mutex dropped and the kernfs active reference left broken. The latter matters because rmdir and cgroup.pressure writes drain active references under cgroup_mutex. Publishing the trigger last keeps error reporting synchronous and preserves the of->priv lifetime rules.
The trigger registered in the first stage pins the group's rtpoll machinery across the unlocked window, leaving only creation races to resolve. The catch-up poll on installation covers scheduling attempts dropped while there was no worker.
v2: Retagged sched/psi (was cgroup).
--- include/linux/psi.h | 4 ++- kernel/cgroup/cgroup.c | 23 +++++++++++++- kernel/sched/psi.c | 69 ++++++++++++++++++++++++++++++++---------- 3 files changed, 78 insertions(+), 18 deletions(-)
include/linux/psi.h +3 -1
@@ -25,7 +25,9 @@ void psi_memstall_leave(unsigned long *flags);int psi_show (struct seq_file *s,struct psi_group *group,enum psi_res res);struct psi_trigger *psi_trigger_create (struct psi_group *group,char *buf,enum psi_res res,struct file *file, -struct kernfs_open_file *of); +struct kernfs_open_file *of, +bool *need_rtpoll_worker); +int psi_trigger_create_rtpoll_worker (struct psi_group *group);void psi_trigger_destroy (struct psi_trigger *t); __poll_t psi_trigger_poll(void **trigger_ptr, struct file *file,
kernel/cgroup/cgroup.c +22 -1
@@ -3885,6 +3885,7 @@ static ssize_t pressure_write(struct kernfs_open_file *of, char *buf,struct psi_trigger *new;struct cgroup *cgrp;struct psi_group *psi; +bool need_rtpoll_worker;ssize_t ret =0 ; cgrp =cgroup_kn_lock_live (of->kn, false);
@@ -3904,12 +3905,32 @@ static ssize_t pressure_write(struct kernfs_open_file *of, char *buf, } psi =cgroup_psi (cgrp); - new =psi_trigger_create (psi, buf, res, of->file, of); + new =psi_trigger_create (psi, buf, res, of->file, of, + &need_rtpoll_worker);if (IS_ERR (new)) { ret =PTR_ERR (new); goto out_unlock; } +/* +* The worker fork must run with neither cgroup_mutex nor the file's +* kernfs active reference held. The latter is broken since +* cgroup_kn_lock_live(). @of->priv may be released while unlocked, so +* recheck before publishing @new. +*/ +if (need_rtpoll_worker) { +cgroup_unlock (); + ret =psi_trigger_create_rtpoll_worker (psi); +cgroup_lock (); + +if (!ret && !of->priv) + ret = -ENODEV ; +if (ret) { +psi_trigger_destroy (new); + goto out_unlock; + } + } +smp_store_release (&ctx->psi.trigger, new); out_unlock:
kernel/sched/psi.c +53 -16
112 lines not on this page · raw message
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 844/869 ocfs2: use correct endian in ocfs2_dinode_has_extents
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joseph Qi <[email protected]>
[ Upstream commit c9dff86eb78a4b6b02b1e407993c946ccaf9bfb4 ]
Fields in ocfs2_dinode is little endian, covert to host endian when checking those contents.
--- fs/ocfs2/inode.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
fs/ocfs2/inode.c +6 -4
@@ -236,13 +236,15 @@ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, unsigned flags,static int ocfs2_dinode_has_extents (struct ocfs2_dinode *di) {/* inodes flagged with other stuff in id2 */ -if (di->i_flags & (OCFS2_SUPER_BLOCK_FL |OCFS2_LOCAL_ALLOC_FL | -OCFS2_CHAIN_FL |OCFS2_DEALLOC_FL )) +if (le32_to_cpu (di->i_flags) & + (OCFS2_SUPER_BLOCK_FL |OCFS2_LOCAL_ALLOC_FL |OCFS2_CHAIN_FL | +OCFS2_DEALLOC_FL ))return 0 ;/* i_flags doesn't indicate when id2 is a fast symlink */ -if (S_ISLNK (di->i_mode) && di->i_size && di->i_clusters ==0 ) +if (S_ISLNK (le16_to_cpu (di->i_mode)) &&le64_to_cpu (di->i_size) && + !le32_to_cpu (di->i_clusters))return 0 ; -if (di->i_dyn_features &OCFS2_INLINE_DATA_FL ) +if (le16_to_cpu (di->i_dyn_features) &OCFS2_INLINE_DATA_FL )return 0 ;return 1 ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 845/869 netfs: release readahead folios on iterator preparation failure
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yichong Chen <[email protected]>
[ Upstream commit 87eb3d272dcbcbbfe5c1576c10e5dc72810cf1f6 ]
netfs_prepare_read_iterator() batches readahead folios in put_batch so that the folio references can be dropped after the I/O iterator has been prepared.
If rolling_buffer_load_from_ra() fails after earlier folios have been batched, the function returns immediately and leaves those references held. Release the batch before returning the error.
--- fs/netfs/buffered_read.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/netfs/buffered_read.c +3 -1
@@ -101,8 +101,10 @@ static ssize_t netfs_prepare_read_iterator(struct netfs_io_subrequest *subreq) added =rolling_buffer_load_from_ra (&rreq->buffer, rreq->ractl, &put_batch); -if (added <0 ) +if (added <0 ) { +folio_batch_release (&put_batch);return added; + } rreq->submitted += added; }folio_batch_release (&put_batch);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 846/869 netfs: Fix folio state after ENOMEM whilst under writeback iteration
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <[email protected]>
[ Upstream commit b6a713fd34b9498ee2164d5d3e8460732a392efc ]
Fix the state of the current folio when ENOMEM occurs during writeback iteration. The folio needs to be redirtied and unlocked before the terminal writeback_iter() is invoked.
--- fs/netfs/write_issue.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/netfs/write_issue.c +4 -0
@@ -582,6 +582,10 @@ int netfs_writepages(struct address_space *mapping, } error =netfs_write_folio (wreq, wbc, folio); +if (error == -ENOMEM ) { +folio_redirty_for_writepage (wbc, folio); +folio_unlock (folio); + } }while ((folio =writeback_iter (mapping, wbc, folio, &error)));netfs_end_issue_write (wreq);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 847/869 net: do not acquire dev->tx_global_lock in netdev_watchdog_up()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit d09a78a2a469e4fab75108325efb813c49520809 ]
Marek Szyprowski reported a deadlock during system resume when virtio_net driver is used.
The deadlock occurs because netif_device_attach() is called while holding dev->tx_global_lock (via netif_tx_lock_bh() in virtnet_restore_up()). netif_device_attach() calls __netdev_watchdog_up(), which now also tries to acquire dev->tx_global_lock to synchronize with dev_watchdog().
This recursive lock acquisition results in a deadlock.
Fix this by removing the tx_global_lock acquisition from netdev_watchdog_up().
The critical state (watchdog_timer and watchdog_ref_held) is already protected by dev->watchdog_lock, which was introduced in the blamed commit.
--- net/sched/sch_generic.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
net/sched/sch_generic.c +2 -5
@@ -568,9 +568,8 @@ void __netdev_watchdog_up(struct net_device *dev)return ;if (dev->watchdog_timeo <=0 ) dev->watchdog_timeo =5 *HZ ; -spin_lock_bh (&dev->tx_global_lock); -spin_lock (&dev->watchdog_lock); +spin_lock_bh (&dev->watchdog_lock);if (!mod_timer (&dev->watchdog_timer,round_jiffies (jiffies + dev->watchdog_timeo))) {if (!dev->watchdog_ref_held) {
@@ -579,9 +578,7 @@ void __netdev_watchdog_up(struct net_device *dev) dev->watchdog_ref_held = true; } } -spin_unlock (&dev->watchdog_lock); - -spin_unlock_bh (&dev->tx_global_lock); +spin_unlock_bh (&dev->watchdog_lock); }EXPORT_SYMBOL_GPL (__netdev_watchdog_up);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 848/869 s390/zcrypt: Fix memory leak with CCA cards used as accelerator
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Harald Freudenberger <[email protected]>
[ Upstream commit c8d46f17c2fc7d25c18e60c008928aecab26184d ]
Tests showed that there is a memory leak if CCA cards are used as accelerator for clear key RSA requests (ME and CRT). With the last rework for the memory allocation the AP messages are allocated by ap_init_apmsg() but for some reason on two places (ME and CRT) the older allocation was still in place. So the first allocation simple was never freed.
--- drivers/s390/crypto/zcrypt_msgtype6.c | 32 ++++++++++++--------------- 1 file changed, 14 insertions(+), 18 deletions(-)
drivers/s390/crypto/zcrypt_msgtype6.c +14 -18
@@ -956,6 +956,10 @@ static atomic_t zcrypt_step = ATOMIC_INIT(0);/* * The request distributor calls this function if it picked the CEXxC * device to handle a modexpo request. +* This function assumes that ap_msg has been initialized with +* ap_init_apmsg() and thus a valid buffer with the size of +* ap_msg->bufsize is available within ap_msg. Also the caller has +* to make sure ap_release_apmsg() is always called even on failure. * @zq: pointer to zcrypt_queue structure that identifies the * CEXxC device to the request distributor * @mex: pointer to the modexpo request buffer
@@ -967,21 +971,17 @@ static long zcrypt_msgtype6_modexpo(struct zcrypt_queue *zq,struct ap_response_type *resp_type = &ap_msg->response;int rc; - ap_msg->msg = (void *)get_zeroed_page (GFP_KERNEL ); -if (!ap_msg->msg) -return -ENOMEM ; - ap_msg->bufsize =PAGE_SIZE ; ap_msg->receive = zcrypt_msgtype6_receive; ap_msg->psmid = (((unsigned long )current->pid) <<32 ) +atomic_inc_return (&zcrypt_step); rc =icamex_msg_to_type6mex_msgx (zq, ap_msg, mex);if (rc) - goto out_free; + goto out; resp_type->type =CEXXC_RESPONSE_TYPE_ICA ;init_completion (&resp_type->work); rc =ap_queue_message (zq->queue, ap_msg);if (rc) - goto out_free; + goto out; rc =wait_for_completion_interruptible (&resp_type->work);if (rc ==0 ) { rc = ap_msg->rc;
@@ -994,15 +994,17 @@ static long zcrypt_msgtype6_modexpo(struct zcrypt_queue *zq,ap_cancel_message (zq->queue, ap_msg); } -out_free: -free_page ((unsigned long )ap_msg->msg); - ap_msg->msg =NULL ; +out:return rc; }/* * The request distributor calls this function if it picked the CEXxC * device to handle a modexpo_crt request. +* This function assumes that ap_msg has been initialized with +* ap_init_apmsg() and thus a valid buffer with the size of +* ap_msg->bufsize is available within ap_msg. Also the caller has +* to make sure ap_release_apmsg() is always called even on failure. * @zq: pointer to zcrypt_queue structure that identifies the * CEXxC device to the request distributor * @crt: pointer to the modexpoc_crt request buffer
@@ -1014,21 +1016,17 @@ static long zcrypt_msgtype6_modexpo_crt(struct zcrypt_queue *zq,struct ap_response_type *resp_type = &ap_msg->response;int rc; - ap_msg->msg = (void *)get_zeroed_page (GFP_KERNEL ); -if (!ap_msg->msg) -return -ENOMEM ; - ap_msg->bufsize =PAGE_SIZE ; ap_msg->receive = zcrypt_msgtype6_receive; ap_msg->psmid = (((unsigned long )current->pid) <<32 ) +atomic_inc_return (&zcrypt_step); rc =icacrt_msg_to_type6crt_msgx (zq, ap_msg, crt);if (rc) - goto out_free; + goto out; resp_type->type =CEXXC_RESPONSE_TYPE_ICA ;init_completion (&resp_type->work); rc =ap_queue_message (zq->queue, ap_msg);if (rc) - goto out_free; + goto out; rc =wait_for_completion_interruptible (&resp_type->work);if (rc ==0 ) { rc = ap_msg->rc;
@@ -1041,9 +1039,7 @@ static long zcrypt_msgtype6_modexpo_crt(struct zcrypt_queue *zq,ap_cancel_message (zq->queue, ap_msg); } -out_free: -free_page ((unsigned long )ap_msg->msg); - ap_msg->msg =NULL ; +out:return rc; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 849/869 EDAC/igen6: Fix the flood of invalid error reports
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qiuxu Zhuo <[email protected]>
[ Upstream commit 267e5b1d267539d9a927dc04aab6f15aca57da92 ]
The ECC_ERROR_LOG register of certain SoCs may contain the invalid value ~0, which results in a flood of invalid error reports in polling mode.
Fix the flood of invalid error reports by skipping the invalid ECC error log value ~0.
--- drivers/edac/igen6_edac.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)
drivers/edac/igen6_edac.c +15 -6
@@ -785,13 +785,22 @@ static u64 ecclog_read_and_clear(struct igen6_imc *imc) {u64 ecclog =readq (imc->window +ECC_ERROR_LOG_OFFSET ); -if (ecclog & (ECC_ERROR_LOG_CE |ECC_ERROR_LOG_UE )) { -/* Clear CE/UE bits by writing 1s */ -writeq (ecclog, imc->window +ECC_ERROR_LOG_OFFSET ); -return ecclog; - } +/* +* Quirk: The ECC_ERROR_LOG register of certain SoCs may contain +* the invalid value ~0. This will result in a flood of invalid +* error reports in polling mode. Skip it. +*/ +if (ecclog == ~0 ) +return 0 ; -return 0 ; +/* Neither a CE nor a UE. Skip it.*/ +if (!(ecclog & (ECC_ERROR_LOG_CE |ECC_ERROR_LOG_UE ))) +return 0 ; + +/* Clear CE/UE bits by writing 1s */ +writeq (ecclog, imc->window +ECC_ERROR_LOG_OFFSET ); + +return ecclog; }static void errsts_clear (struct igen6_imc *imc)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 850/869 netfilter: ctnetlink: do not expose expectation DEAD flag
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <[email protected]>
[ Upstream commit 322371b09058ad10d0282a0e7ec8eaa764e6aaac ]
Expose expectation flags included in the NF_CT_EXPECT_MASK bitmask only. The DEAD flag is internal, do not expose it.
--- net/netfilter/nf_conntrack_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_conntrack_netlink.c +1 -1
@@ -3045,7 +3045,7 @@ ctnetlink_exp_dump_expect(struct sk_buff *skb,#endif if (nla_put_be32 (skb,CTA_EXPECT_TIMEOUT ,htonl (timeout)) ||nla_put_be32 (skb,CTA_EXPECT_ID ,nf_expect_get_id (exp)) || -nla_put_be32 (skb,CTA_EXPECT_FLAGS ,htonl (exp->flags)) || +nla_put_be32 (skb,CTA_EXPECT_FLAGS ,htonl (exp->flags &NF_CT_EXPECT_MASK )) ||nla_put_be32 (skb,CTA_EXPECT_CLASS ,htonl (exp->class))) goto nla_put_failure;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 851/869 EDAC/igen6: Fix NULL pointer dereference
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qiuxu Zhuo <[email protected]>
[ Upstream commit 88efa0de3285be66969b71ec137d9dab1ee19e52 ]
A kernel panic was reported with the following kernel log:
EDAC igen6: Expected 2 mcs, but only 1 detected.
BUG: unable to handle page fault for address: 000000000000d570 ... Hardware name: Notebook V54x_6x_TU/V54x_6x_TU, BIOS Dasharo (coreboot+UEFI) v0.9.0 07/17/2024 RIP: e030:ecclog_handler+0x7e/0xf0 [igen6_edac] ... igen6_probe+0x2a0/0x343 [igen6_edac] ... igen6_init+0xc5/0xff0 [igen6_edac] ...
This issue occurred because one memory controller was disabled by the BIOS but the igen6_edac driver still checked all the memory controllers, including this absent one, to identify the source of the error. Accessing the null MMIO for the absent memory controller resulted in the oops above.
Fix this issue by reverting the configuration structure to non-const and updating the field 'res_cfg->num_imc' to reflect the number of detected memory controllers.
--- drivers/edac/igen6_edac.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/edac/igen6_edac.c +4 -2
@@ -558,7 +558,7 @@ static struct res_config mtl_p_cfg = { .err_addr_to_imc_addr = adl_err_addr_to_imc_addr, }; -static const struct pci_device_id igen6_pci_tbl[] = { +static struct pci_device_id igen6_pci_tbl[] = { {PCI_VDEVICE (INTEL ,DID_EHL_SKU5 ), (kernel_ulong_t)&ehl_cfg }, {PCI_VDEVICE (INTEL ,DID_EHL_SKU6 ), (kernel_ulong_t)&ehl_cfg }, {PCI_VDEVICE (INTEL ,DID_EHL_SKU7 ), (kernel_ulong_t)&ehl_cfg },
@@ -1347,9 +1347,11 @@ static int igen6_register_mcis(struct pci_dev *pdev, u64 mchbar)return -ENODEV ; } -if (lmc < res_cfg->num_imc) +if (lmc < res_cfg->num_imc) {igen6_printk (KERN_WARNING ,"Expected %d mcs, but only %d detected." , res_cfg->num_imc, lmc); + res_cfg->num_imc = lmc; + }return 0 ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 852/869 Revert "esp: do not unref managed frag pages in esp_ssg_unref()"
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steffen Klassert <[email protected]>
[ Upstream commit 0fda52de8bbd4ca9a852c8a7ef6536cf82bd71fd ]
This reverts commit 21697720ff43b8dfa25b8e8d9ca7f56f4597fc80.
The patch does not fix the issue completely, so revert for now and wait for an updated version.
--- net/ipv4/esp4.c | 7 ------- net/ipv6/esp6.c | 7 ------- 2 files changed, 14 deletions(-)
net/ipv4/esp4.c +0 -7
@@ -104,13 +104,6 @@ static void esp_ssg_unref(struct xfrm_state *x, void *tmp, struct sk_buff *skb)struct aead_request *req;struct scatterlist *sg; -/* Managed frags are owned by the zerocopy ubuf; the skb holds no -* per-frag page reference, so we must not drop one here. Mirrors -* the SKBFL_MANAGED_FRAG_REFS handling in skb_release_data(). -*/ -if (skb_zcopy_managed (skb)) -return ; -if (x->props.flags &XFRM_STATE_ESN ) extralen +=sizeof (struct esp_output_extra );
net/ipv6/esp6.c +0 -7
@@ -121,13 +121,6 @@ static void esp_ssg_unref(struct xfrm_state *x, void *tmp, struct sk_buff *skb)struct aead_request *req;struct scatterlist *sg; -/* Managed frags are owned by the zerocopy ubuf; the skb holds no -* per-frag page reference, so we must not drop one here. Mirrors -* the SKBFL_MANAGED_FRAG_REFS handling in skb_release_data(). -*/ -if (skb_zcopy_managed (skb)) -return ; -if (x->props.flags &XFRM_STATE_ESN ) extralen +=sizeof (struct esp_output_extra );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 853/869 mm/hugetlb_vmemmap: fix incorrect vmemmap restore in rollback
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Muchun Song <[email protected]>
[ Upstream commit c7bde43f6daf70e05a64fbca7efdf6fa93e057dc ]
vmemmap_restore_pte() rebuilds restored vmemmap pages from a tail-page template derived from compound_head(). This is wrong when the current PTE already maps a page whose contents are not tail-page metadata.
In the rollback path of vmemmap_remap_free(), the first restored PTE is backed by vmemmap_head and contains head-page metadata. Reconstructing that page from a tail-page template overwrites the head-page state and corrupts the restored vmemmap page.
Fix this by copying the full page from the page currently mapped by the PTE. Also pass vmemmap_tail to the rollback walk so only PTEs backed by the shared tail page are restored, while the head PTE remains mapped to vmemmap_head. Add VM_WARN_ON_ONCE() checks for unexpected cases.
--- mm/hugetlb_vmemmap.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-)
mm/hugetlb_vmemmap.c +18 -18
@@ -207,6 +207,8 @@ static void vmemmap_remap_pte(pte_t *pte, unsigned long addr,/* Remapping the head page requires r/w */ if (unlikely (walk->nr_walked ==0 && walk->vmemmap_head)) { +VM_WARN_ON_ONCE (!PageHead ((const struct page *)addr)); +list_del (&walk->vmemmap_head->lru);/*
@@ -218,6 +220,8 @@ static void vmemmap_remap_pte(pte_t *pte, unsigned long addr, entry =mk_pte (walk->vmemmap_head,PAGE_KERNEL ); }else { +VM_WARN_ON_ONCE (!PageTail ((const struct page *)addr)); +/* * Remap the tail pages as read-only to catch illegal write * operation to the tail pages.
@@ -232,33 +236,28 @@ static void vmemmap_remap_pte(pte_t *pte, unsigned long addr,static void vmemmap_restore_pte (pte_t *pte,unsigned long addr,struct vmemmap_remap_walk *walk) { -struct page *page; -struct page *from, *to; - - page = list_first_entry(walk->vmemmap_pages, struct page, lru); -list_del (&page->lru); +struct page *src =pte_page (ptep_get (pte)), *dst;/* -* Initialize tail pages in the newly allocated vmemmap page. -* -* There is folio-scope metadata that is encoded in the first few -* tail pages. -* -* Use the value last tail page in the page with the head page -* to initialize the rest of tail pages. +* When rolling back vmemmap_remap_free(), keep the copied head page +* mapping and restore only PTEs currently pointing at the shared tail +* page. */ - from =compound_head ((struct page *)addr) + -PAGE_SIZE /sizeof (struct page ) -1 ; - to =page_to_virt (page); -for (int i =0 ; i <PAGE_SIZE /sizeof (struct page ); i++, to++) - *to = *from; +if (walk->vmemmap_tail && walk->vmemmap_tail != src) +return ; + +VM_WARN_ON_ONCE (PageHead ((const struct page *)addr)); + + dst = list_first_entry(walk->vmemmap_pages, struct page, lru); +list_del (&dst->lru); +copy_page (page_to_virt (dst),page_to_virt (src));/* * Makes sure that preceding stores to the page contents become visible * before the set_pte_at() write. */ smp_wmb (); -set_pte_at (&init_mm, addr, pte,mk_pte (page,PAGE_KERNEL )); +set_pte_at (&init_mm, addr, pte,mk_pte (dst,PAGE_KERNEL )); }/**
@@ -324,6 +323,7 @@ static int vmemmap_remap_free(unsigned long start, unsigned long end,*/ walk = (struct vmemmap_remap_walk ) { .remap_pte = vmemmap_restore_pte, + .vmemmap_tail = vmemmap_tail, .vmemmap_pages = vmemmap_pages, .flags =0 , };
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 854/869 PM: sleep: Unblock runtime PM when device prepare fails
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shibo Zhu <[email protected]>
[ Upstream commit cb258d651d747a7f7063d40f145418bee562ceaf ]
device_prepare() blocks runtime PM for a device with runtime PM disabled before invoking its system-sleep ->prepare() callback. For a device that has never enabled runtime PM, this changes dev->power.last_status from RPM_INVALID to RPM_BLOCKED.
If the callback returns an error, dpm_prepare() does not move the device to dpm_prepared_list. Consequently, the recovery path through dpm_complete() never calls device_complete() for the failing device.
The error path drops the runtime PM usage reference, but does not clear RPM_BLOCKED. A later legitimate pm_runtime_enable() then reports:
Attempt to enable runtime PM when it is blocked
before clearing the stale state.
Call pm_runtime_unblock() on the prepare error path before dropping the runtime PM reference, matching the cleanup performed by device_complete().
The issue was reproduced with a platform test device whose ->prepare() callback returns -EIO while runtime PM has never been enabled. Before the fix, last_status remained RPM_BLOCKED after the failed suspend and the first pm_runtime_enable() produced the warning above. With the fix, last_status is restored to RPM_INVALID and the warning is absent.
--- drivers/base/power/main.c | 1 + 1 file changed, 1 insertion(+)
drivers/base/power/main.c +1 -0
@@ -1888,6 +1888,7 @@ static int device_prepare(struct device *dev, pm_message_t state)if (ret <0 ) {suspend_report_result (dev, callback, ret); +pm_runtime_unblock (dev);pm_runtime_put (dev);return ret; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 855/869 soundwire: intel_auxdevice: Fix system suspend/resume handling
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <[email protected]>
[ Upstream commit 533a8a67cc3b072a24122d1ea10a8db66a5c9393 ]
Before commit bca84a7b93fd ("PM: sleep: Use DPM_FLAG_SMART_SUSPEND conditionally") the runtime PM status of the device in intel_resume() had always been RPM_ACTIVE because setting DPM_FLAG_SMART_SUSPEND had caused the core to call pm_runtime_set_active() for that device during the "noirq" resume phase. For this reason, the pm_runtime_suspended() check in intel_resume() had never triggered and the code depending on it had never run. That had not caused any observable functional issues to appear, so effectively the code in question had never been needed.
After commit bca84a7b93fd the core does not call pm_runtime_set_active() for all devices with DPM_FLAG_SMART_SUSPEND set any more and the code depending on the pm_runtime_suspended() check in intel_resume() runs if the device is runtime-suspended prior to a system-wide suspend transition. Unfortunately, when it runs, it breaks things due to the attempt to runtime-resume bus->dev which most likely is not ready for a runtime resume at that point.
It also does other more-or-less questionable things. Namely, it calls pm_runtime_idle() for a device with a nonzero runtime PM usage counter which has no effect (all devices have nonzero runtime PM usage counters during system-wide suspend and resume). It also calls pm_runtime_mark_last_busy() for the device even though devices cannot runtime-suspend during system-wide suspend and resume (because their runtime PM usage counters are nonzero) and an analogous call is made in the same function later. Moreover, it sets the runtime PM status of the device to RPM_ACTIVE before activating it.
For the reasons listed above, remove that code altogether.
On top of that, add a pm_runtime_disable() call to intel_suspend() to prevent the device from being runtime-resumed at any point after intel_suspend() has started to manipulate it because the changes made by that function would be undone by a runtime-suspend of the device.
Next, once runtime PM has been disabled, the runtime PM status of the device cannot change, so pm_runtime_status_suspended() can be used instead of pm_runtime_suspended() in intel_suspend().
Finally, make intel_resume() call pm_runtime_set_active() at the end to set the runtime PM status of the device to "active" because it has just been activated and re-enable runtime PM for it after that.
Additionally, drop the setting of DPM_FLAG_SMART_SUSPEND from the driver because it has no effect on devices handled by it.
--- drivers/soundwire/intel_auxdevice.c | 36 +++++++++++------------------ 1 file changed, 13 insertions(+), 23 deletions(-)
drivers/soundwire/intel_auxdevice.c +13 -23
@@ -345,9 +345,6 @@ static int intel_link_probe(struct auxiliary_device *auxdev,/* use generic bandwidth allocation algorithm */ sdw->cdns.bus.compute_params = sdw_compute_params; -/* avoid resuming from pm_runtime suspend if it's not required */ -dev_pm_set_driver_flags (dev,DPM_FLAG_SMART_SUSPEND ); - ret =sdw_bus_master_add (bus, dev, dev->fwnode);if (ret) {dev_err (dev,"sdw_bus_master_add fail: %d\n" , ret);
@@ -632,7 +629,10 @@ static int __maybe_unused intel_suspend(struct device *dev)return 0 ; } -if (pm_runtime_suspended (dev)) { +/* Prevent runtime PM from racing with the code below. */ +pm_runtime_disable (dev); + +if (pm_runtime_status_suspended (dev)) {dev_dbg (dev,"pm_runtime status: suspended\n" ); clock_stop_quirks = sdw->link_res->clock_stop_quirks;
@@ -640,7 +640,7 @@ static int __maybe_unused intel_suspend(struct device *dev)if ((clock_stop_quirks &SDW_INTEL_CLK_STOP_BUS_RESET ) || !clock_stop_quirks) { -if (pm_runtime_suspended (dev->parent)) { +if (pm_runtime_status_suspended (dev->parent)) {/* * paranoia check: this should not happen with the .prepare * resume to full power
@@ -707,7 +707,6 @@ static int __maybe_unused intel_resume(struct device *dev)struct sdw_cdns *cdns =dev_get_drvdata (dev);struct sdw_intel *sdw =cdns_to_intel (cdns);struct sdw_bus *bus = &cdns->bus; -int link_flags;int ret;if (bus->prop.hw_disabled || !sdw->startup_done) {
@@ -716,23 +715,6 @@ static int __maybe_unused intel_resume(struct device *dev)return 0 ; } -if (pm_runtime_suspended (dev)) { -dev_dbg (dev,"pm_runtime status was suspended, forcing active\n" ); - -/* follow required sequence from runtime_pm.rst */ -pm_runtime_disable (dev); -pm_runtime_set_active (dev); -pm_runtime_mark_last_busy (dev); -pm_runtime_enable (dev); - -pm_runtime_resume (bus->dev); - - link_flags = md_flags >> (bus->link_id *8 ); - -if (!(link_flags &SDW_INTEL_MASTER_DISABLE_PM_RUNTIME_IDLE )) -pm_runtime_idle (dev); - } - ret =sdw_intel_link_power_up (sdw);if (ret) {dev_err (dev,"%s failed: %d\n" , __func__, ret);
@@ -752,6 +734,14 @@ static int __maybe_unused intel_resume(struct device *dev)return ret; } +/* +* Runtime PM has been disabled in intel_suspend(), so set the status +* to active because the device has just been resumed and re-enable +* runtime PM. +*/ +pm_runtime_set_active (dev); +pm_runtime_enable (dev); +/* * after system resume, the pm_runtime suspend() may kick in * during the enumeration, before any children device force the
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 856/869 gpiolib: Allow to use setters with return value for output-only gpios
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathieu Dubois-Briand <[email protected]>
[ Upstream commit b424bb88afb6719b30340f059bf50953424cdd9d ]
The gpiod_direction_output_raw_commit() function checks if any setter callback is present before doing anything. As the new GPIO setters with return values were introduced, make this check also succeed if one is present.
--- drivers/gpio/gpiolib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpiolib.c +1 -1
@@ -2761,7 +2761,7 @@ static int gpiod_direction_output_raw_commit(struct gpio_desc *desc, int value)* output-only, but if there is then not even a .set() operation it * is pretty tricky to drive the output line. */ -if (!guard.gc->set && !guard.gc->direction_output) { +if (!guard.gc->set && !guard.gc->set_rv && !guard.gc->direction_output) {gpiod_warn (desc,"%s: missing set() and direction_output() operations\n" , __func__);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 857/869 gpiolib: initialize return value in gpiochip_set_multiple()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ruoyu Wang <[email protected]>
[ Upstream commit 99dfa46baba29513d1094c8f30bc86c6ef88543a ]
gpiochip_set_multiple() falls back to setting lines one by one when the chip does not provide set_multiple(). If the fallback path receives an empty mask, the loop is skipped and ret is returned without being initialized.
Initialize ret to 0 so an empty mask is treated as a successful no-op.
--- drivers/gpio/gpiolib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpiolib.c +1 -1
@@ -3437,7 +3437,7 @@ static int gpiochip_set_multiple(struct gpio_chip *gc, unsigned long *mask, unsigned long *bits) { unsigned int i; -int ret; +int ret =0 ;lockdep_assert_held (&gc->gpiodev->srcu);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 858/869 i3c: master: svc: Fix missed IBI after false SLVSTART on NPCM845
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanley Chu <[email protected]>
[ Upstream commit fa1d4fa118f4229168e9ca88cea260c5e5a94652 ]
The NPCM845 I3C controller may raise a false SLVSTART interrupt. The handler first latches MSTATUS and then clears SLVSTART. If a real IBI request arrives after the handler latches MSTATUS but before it clears the SLVSTART interrupt status, HW sets the SLVREQ state. However, the handler still relies on the stale MSTATUS snapshot, returns early, and misses the real IBI. No further interrupt is generated for this pending IBI.
Re-read MSTATUS to obtain the latest state and avoid missing a real IBI due to this race condition.
--- drivers/i3c/master/svc-i3c-master.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/i3c/master/svc-i3c-master.c +12 -4
@@ -600,10 +600,18 @@ static irqreturn_t svc_i3c_master_irq_handler(int irq, void *dev_id)/* Clear the interrupt status */ writel (SVC_I3C_MINT_SLVSTART , master->regs +SVC_I3C_MSTATUS ); -/* Ignore the false event */ -if (svc_has_quirk (master,SVC_I3C_QUIRK_FALSE_SLVSTART ) && - !SVC_I3C_MSTATUS_STATE_SLVREQ (active)) -return IRQ_HANDLED ; +if (svc_has_quirk (master,SVC_I3C_QUIRK_FALSE_SLVSTART )) { +/* +* Re-read MSTATUS to obtain the latest state and avoid +* missing an IBI that arrives after MSTATUS is latched +* but before SLVSTART is cleared. +*/ + active =readl (master->regs +SVC_I3C_MSTATUS ); + +/* Ignore the false event */ +if (!SVC_I3C_MSTATUS_STATE_SLVREQ (active)) +return IRQ_HANDLED ; + }svc_i3c_master_disable_interrupts (master);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 859/869 i3c: master: svc: Fix npcm845 FIFO_EMPTY quirk
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanley Chu <[email protected]>
[ Upstream commit bc4a09d8e79cadccdd505f47b01903a80bc666e7 ]
In a private write transfer, the driver pre-fills the FIFO to work around the FIFO_EMPTY quirk. However, if an IBIWON event occurs, the hardware emits a NACK and the driver initiates a retry. During the retry, driver attempts to pre-fill the FIFO again if there is remaining data, but since the FIFO is already full, this leads to data loss.
Check available space in FIFO to prevent overflow.
--- drivers/i3c/master/svc-i3c-master.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
drivers/i3c/master/svc-i3c-master.c +14 -8
@@ -103,6 +103,7 @@#define SVC_I3C_MDATACTRL_TXTRIG_FIFO_NOT_FULL GENMASK(5, 4)#define SVC_I3C_MDATACTRL_RXTRIG_FIFO_NOT_EMPTY 0#define SVC_I3C_MDATACTRL_RXCOUNT (x) FIELD_GET(GENMASK(28, 24), (x)) +#define SVC_I3C_MDATACTRL_TXCOUNT (x) FIELD_GET(GENMASK(20, 16), (x))#define SVC_I3C_MDATACTRL_TXFULL BIT(30)#define SVC_I3C_MDATACTRL_RXEMPTY BIT(31)
@@ -1285,14 +1286,19 @@ static int svc_i3c_master_xfer(struct svc_i3c_master *master,* FIFO start filling as soon as possible after EmitStartAddr. */ if (svc_has_quirk (master,SVC_I3C_QUIRK_FIFO_EMPTY ) && !rnw && xfer_len) { -u32 end = xfer_len >SVC_I3C_FIFO_SIZE ?0 :SVC_I3C_MWDATAB_END ; -u32 len =min_t (u32, xfer_len,SVC_I3C_FIFO_SIZE ); - -writesb (master->regs +SVC_I3C_MWDATAB1 , out, len -1 ); -/* Mark END bit if this is the last byte */ -writel (out[len -1 ] | end, master->regs +SVC_I3C_MWDATAB ); - xfer_len -= len; - out += len; +u32 space, end, len; + + reg =readl (master->regs +SVC_I3C_MDATACTRL ); + space =SVC_I3C_FIFO_SIZE -SVC_I3C_MDATACTRL_TXCOUNT (reg); +if (space) { + end = xfer_len > space ?0 :SVC_I3C_MWDATAB_END ; + len =min_t (u32, xfer_len, space); +writesb (master->regs +SVC_I3C_MWDATAB1 , out, len -1 ); +/* Mark END bit if this is the last byte */ +writel (out[len -1 ] | end, master->regs +SVC_I3C_MWDATAB ); + xfer_len -= len; + out += len; + } } ret = readl_poll_timeout(master->regs + SVC_I3C_MSTATUS, reg,
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 860/869 i3c: master: svc: Fix i3c_master_get_free_addr return check
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanley Chu <[email protected]>
[ Upstream commit d6cb667b8e15bac47f19aec4bd81f3916b2ca9f5 ]
The return value of i3c_master_get_free_addr is assigned to a variable with wrong type, so it can't be negative. Use a signed integer for the return value. If the value is negative, break the process and propagate the error code.
This commit also fixes the uninitialized symbol 'dyn_addr', reported by Smatch static checker.
--- drivers/i3c/master/svc-i3c-master.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/i3c/master/svc-i3c-master.c +5 -4
@@ -938,7 +938,7 @@ static int svc_i3c_master_do_daa_locked(struct svc_i3c_master *master, u8 *addrs, unsigned int *count) { u64 prov_id[SVC_I3C_MAX_DEVS] = {}, nacking_prov_id = 0; -unsigned int dev_nb =0 , last_addr =0 , dyn_addr; +unsigned int dev_nb =0 , last_addr =0 , dyn_addr =0 ;u32 reg;int ret, i;
@@ -993,10 +993,11 @@ static int svc_i3c_master_do_daa_locked(struct svc_i3c_master *master,* filling within a few hundred nanoseconds, which is significantly * faster compared to the 64 SCL clock cycles. */ - dyn_addr =i3c_master_get_free_addr (&master->base, last_addr +1 ); -if (dyn_addr <0 ) -return -ENOSPC ; + ret =i3c_master_get_free_addr (&master->base, last_addr +1 ); +if (ret <0 ) +break ; + dyn_addr = ret;writel (dyn_addr, master->regs +SVC_I3C_MWDATAB );/*
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 861/869 tracing: Fix ring_buffer_read_page_size() kernel-doc
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <[email protected]>
[ Upstream commit 7e645147dfba67edb3ed3090a1ed1d89df77fc27 ]
ring_buffer_read_page_size() takes a parameter named rpage, but its kernel-doc describes page. As a result, kernel-doc reports rpage as undescribed and page as an excess parameter description.
Rename the documentation entry to match the function.
--- kernel/trace/ring_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/ring_buffer.c +1 -1
@@ -6746,7 +6746,7 @@ EXPORT_SYMBOL_GPL(ring_buffer_read_page_data);/** * ring_buffer_read_page_size - get size of the read page. -* @page: the page to get the size from +* @rpage: the page to get the size from * * Returns size of the page in bytes. */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 862/869 tracing: Fix comment in tracing_buffers_splice_read()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven Rostedt <[email protected]>
[ Upstream commit 5cbea500775dd1944995f23320af030b9b24b24b ]
The comment about returning an error if the read fails on the first iteration is slightly incorrect. It makes it sound like the only reason it could fail on a later iteration is if the subbuf order changed. That is incorrect, it could also fail if the length passed in was not a multiple of the subbuf size. Fix the comment.
--- kernel/trace/trace.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
kernel/trace/trace.c +7 -5
@@ -8107,11 +8107,13 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos, r =ring_buffer_read_page (ref->buffer, ref->rpage, len, iter->cpu_file,1 ); }else if (!i) {/* -* We failed to read because the length is too small -* or unaligned. If this is the first iteration, it's -* an invalid userspace input. Otherwise, this is due -* to a subbuf order change. Do not report an error -* and just finish the read. +* If this fails to read on the first iteration, it +* means the length was too small and an error should +* be returned to user space. Otherwise, at least +* one sub-buffer was successfully read but this failed +* due to either the length was unaligned or the +* subbuf order changed. Either case, do not report +* an error. */ ret = -EINVAL ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 863/869 dm-integrity: fix buffer overflow with keyed discard
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Cressey <[email protected]>
[ Upstream commit 59e6f919d77d72ec79cbf171256f2f7819737580 ]
Since commit 68c5c42567bc ("dm-integrity: replace forgeable discard filler with a keyed sector marker"), integrity_metadata computes a checksum for every discarded block into the "checksums" buffer. integrity_sector_checksum always writes the whole digest. So if the tag size is smaller than the digest size, the checksum of the last block that fits into the buffer is written past the end of it. For example, with hmac(sha256) and tag size 16, a 4MiB discard writes 16 bytes past the kmalloc'ed page.
Fix this by subtracting extra_space from the buffer size when computing max_blocks, like we do for writes.
--- drivers/md/dm-integrity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/dm-integrity.c +1 -1
@@ -1857,7 +1857,7 @@ static void integrity_metadata(struct work_struct *w)if (unlikely (dio->op ==REQ_OP_DISCARD )) {unsigned int bi_size = dio->bio_details.bi_iter.bi_size;unsigned int max_size =likely (checksums != checksums_onstack) ?PAGE_SIZE :HASH_MAX_DIGESTSIZE ; -unsigned int max_blocks = max_size / ic->tag_size; +unsigned int max_blocks = (max_size - extra_space) / ic->tag_size;sector_t sector = dio->range.logical_sector;if (!ic->discard_keyed)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 864/869 types: move struct rcuwait into types.h
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Suren Baghdasaryan <[email protected]>
[ Upstream commit 2c2bd11caba2a45445c1f0c722451fe29e59db79 ]
Move rcuwait struct definition into types.h so that rcuwait can be used without including rcuwait.h which includes other headers. Without this change mm_types.h can't use rcuwait due to a the following circular dependency:
mm_types.h -> rcuwait.h -> signal.h -> mm_types.h
--- include/linux/rcuwait.h | 13 +------------ include/linux/types.h | 12 ++++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-)
include/linux/rcuwait.h +1 -12
@@ -4,18 +4,7 @@#include <linux/rcupdate.h> #include <linux/sched/signal.h> - -/* -* rcuwait provides a way of blocking and waking up a single -* task in an rcu-safe manner. -* -* The only time @task is non-nil is when a user is blocked (or -* checking if it needs to) on a condition, and reset as soon as we -* know that the condition has succeeded and are awoken. -*/ -struct rcuwait { -struct task_struct __rcu *task; -}; +#include <linux/types.h> #define __RCUWAIT_INITIALIZER (name) \ { .task = NULL, }
include/linux/types.h +12 -0
@@ -248,5 +248,17 @@ typedef void (*swap_func_t)(void *a, void *b, int size);typedef int (*cmp_r_func_t )(const void *a,const void *b,const void *priv);typedef int (*cmp_func_t )(const void *a,const void *b); +/* +* rcuwait provides a way of blocking and waking up a single +* task in an rcu-safe manner. +* +* The only time @task is non-nil is when a user is blocked (or +* checking if it needs to) on a condition, and reset as soon as we +* know that the condition has succeeded and are awoken. +*/ +struct rcuwait { +struct task_struct __rcu *task; +}; +#endif /* __ASSEMBLY__ */ #endif /* _LINUX_TYPES_H */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 865/869 irqwork: Move data struct to a types header
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
[ Upstream commit c809f081fe400cb1b9898f4791c0d33146315161 ]
... to avoid header recursion hell.
--- include/linux/irq_work.h | 9 ++------- include/linux/irq_work_types.h | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 include/linux/irq_work_types.h
include/linux/irq_work.h +2 -7
@@ -2,8 +2,9 @@#ifndef _LINUX_IRQ_WORK_H#define _LINUX_IRQ_WORK_H -#include <linux/smp_types.h> +#include <linux/irq_work_types.h> #include <linux/rcuwait.h> +#include <linux/smp_types.h> /* * An entry can be in one of four states:
@@ -14,12 +15,6 @@* busy NULL, 2 -> {free, claimed} : callback in progress, can be claimed */ -struct irq_work { -struct __call_single_node node; -void (*func)(struct irq_work *); -struct rcuwait irqwait; -}; -#define __IRQ_WORK_INIT (_func, _flags) (struct irq_work){ \ .node = { .u_flags = (_flags), }, \ .func = (_func), \
include/linux/irq_work_types.h new file +14 -0
@@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_IRQ_WORK_TYPES_H +#define _LINUX_IRQ_WORK_TYPES_H + +#include <linux/smp_types.h> +#include <linux/types.h> + +struct irq_work { +struct __call_single_node node; +void (*func)(struct irq_work *); +struct rcuwait irqwait; +}; + +#endif
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 866/869 bpf, sockmap: Account for receive queue in FIONREAD without a verdict program
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mattia Meleleo <[email protected]>
[ Upstream commit 04af4efde58a4a4ef4feab7360c46af9ec0b83a0 ]
tcp_bpf_ioctl() answers SIOCINQ from psock->msg_tot_len, which only counts bytes in ingress_msg. Without a stream/skb verdict program nothing is diverted there: data stays in sk_receive_queue, so FIONREAD returns 0 even though read() returns data.
Add tcp_inq() to the reported value when the psock has no verdict program. The two queues are disjoint, so bytes redirected into ingress_msg from other sockets stay correctly accounted through msg_tot_len.
Remove unused sk_psock_msg_inq().
--- include/linux/skmsg.h | 14 -------------- net/ipv4/tcp_bpf.c | 17 ++++++++++++++++- 2 files changed, 16 insertions(+), 15 deletions(-)
include/linux/skmsg.h +0 -14
@@ -561,20 +561,6 @@ static inline bool sk_psock_strp_enabled(struct sk_psock *psock)return !!psock->saved_data_ready; } -/* for tcp only, sk is locked */ -static inline ssize_t sk_psock_msg_inq (struct sock *sk) -{ -struct sk_psock *psock; -ssize_t inq =0 ; - - psock =sk_psock_get (sk); -if (likely (psock)) { - inq =sk_psock_get_msg_len_nolock (psock); -sk_psock_put (sk, psock); - } -return inq; -} -/* for udp only, sk is not locked */ static inline ssize_t sk_msg_first_len (struct sock *sk) {
net/ipv4/tcp_bpf.c +16 -1
@@ -335,6 +335,7 @@ static int tcp_bpf_recvmsg_parser(struct sock *sk,static int tcp_bpf_ioctl (struct sock *sk,int cmd,int *karg) { +struct sk_psock *psock;bool slow;if (cmd !=SIOCINQ )
@@ -345,7 +346,21 @@ static int tcp_bpf_ioctl(struct sock *sk, int cmd, int *karg)return -EINVAL ; slow =lock_sock_fast (sk); - *karg =sk_psock_msg_inq (sk); + psock =sk_psock_get (sk); +if (unlikely (!psock)) { +unlock_sock_fast (sk, slow); +return tcp_ioctl (sk, cmd, karg); + } + *karg =sk_psock_get_msg_len_nolock (psock); +/* Without a verdict program, ingress data is never diverted to +* ingress_msg: it stays in sk_receive_queue and is read through +* the fallback to tcp_recvmsg(), so account for it like +* tcp_ioctl() does. +*/ +if (!READ_ONCE (psock->progs.stream_verdict) && + !READ_ONCE (psock->progs.skb_verdict)) + *karg +=tcp_inq (sk); +sk_psock_put (sk, psock);unlock_sock_fast (sk, slow);return 0 ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 867/869 wifi: atk9k: Revert "wifi: ath9k: reject short WMI command responses"
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Toke Høiland-Jørgensen <[email protected]>
[ Upstream commit 90201351a862182bdabfc1ad1c97b1e1b6ed5931 ]
This reverts commit 93ce8ea70451e800601bc9444aa33043de15d67b.
Mehmet reported that the offending commit breaks his AR9271 USB adapter which uses zero-length replies to commands that don't return a value. Revert the whole thing to restore the functionality.
--- drivers/net/wireless/ath/ath9k/wmi.c | 16 ++-------------- drivers/net/wireless/ath/ath9k/wmi.h | 1 - 2 files changed, 2 insertions(+), 15 deletions(-)
drivers/net/wireless/ath/ath9k/wmi.c +2 -14
@@ -206,16 +206,9 @@ static void ath9k_wmi_rsp_callback(struc {skb_pull (skb,sizeof (struct wmi_cmd_hdr )); -if (wmi->cmd_rsp_buf && wmi->cmd_rsp_len) { -if (skb->len < wmi->cmd_rsp_len) { - wmi->cmd_rsp_status = -EMSGSIZE ; - goto complete; - } +if (wmi->cmd_rsp_buf !=NULL && wmi->cmd_rsp_len !=0 )memcpy (wmi->cmd_rsp_buf, skb->data, wmi->cmd_rsp_len); - } - wmi->cmd_rsp_status =0 ; -complete:complete (&wmi->cmd_wait); }
@@ -307,7 +300,6 @@ static int ath9k_wmi_cmd_issue(struct wm/* record the rsp buffer and length */ wmi->cmd_rsp_buf = rsp_buf; wmi->cmd_rsp_len = rsp_len; - wmi->cmd_rsp_status =0 ; wmi->last_seq_id = wmi->tx_seq_id;spin_unlock_irqrestore (&wmi->wmi_lock, flags);
@@ -364,13 +356,9 @@ int ath9k_wmi_cmd(struct wmi *wmi, enumreturn -ETIMEDOUT ; } -spin_lock_irqsave (&wmi->wmi_lock, flags); - ret = wmi->cmd_rsp_status; -spin_unlock_irqrestore (&wmi->wmi_lock, flags); -mutex_unlock (&wmi->op_mutex); -return ret; +return 0 ; out:ath_dbg (common,WMI ,"WMI failure for: %s\n" ,wmi_cmd_to_name (cmd_id));
drivers/net/wireless/ath/ath9k/wmi.h +0 -1
@@ -157,7 +157,6 @@ struct wmi {u16 tx_seq_id;u8 *cmd_rsp_buf;u32 cmd_rsp_len; -int cmd_rsp_status;bool stopped;struct list_head pending_tx_events;
Greg Kroah-Hartman
maintainerPATCH 868/869 s390/uv: Dont return 0 from make_hva_secure() if the operation was not successful
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Hildenbrand <[email protected]>
commit 3ec8a8330a1aa846dffbf1d64479213366c55b54 upstream.
If s390_wiggle_split_folio() returns 0 because splitting a large folio succeeded, we will return 0 from make_hva_secure() even though a retry is required. Return -EAGAIN in that case.
Otherwise, we'll return 0 from gmap_make_secure(), and consequently from unpack_one(). In kvm_s390_pv_unpack(), we assume that unpacking succeeded and skip unpacking this page. Later on, we run into issues and fail booting the VM.
So far, this issue was only observed with follow-up patches where we split large pagecache XFS folios. Maybe it can also be triggered with shmem?
We'll cleanup s390_wiggle_split_folio() a bit next, to also return 0 if no split was required.
Message-ID: <[email protected]>
--- arch/s390/kernel/uv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/s390/kernel/uv.c +4 -1
@@ -393,8 +393,11 @@ int make_hva_secure(struct mm_struct *mmfolio_walk_end (&fw, vma);mmap_read_unlock (mm); -if (rc == -E2BIG || rc == -EBUSY ) +if (rc == -E2BIG || rc == -EBUSY ) { rc =s390_wiggle_split_folio (mm, folio, rc == -E2BIG ); +if (!rc) + rc = -EAGAIN ; + }folio_put (folio);return rc;
Greg Kroah-Hartman
maintainerPATCH 869/869 drm/panfrost: Fix scheduler workqueue bug
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Philipp Stanner <[email protected]>
commit cb345f954eacd162601e7d07ca2f0f0a17b54ee3 upstream.
When the GPU scheduler was ported to using a struct for its initialization parameters, it was overlooked that panfrost creates a distinct workqueue for timeout handling.
The pointer to this new workqueue is not initialized to the struct, resulting in NULL being passed to the scheduler, which then uses the system_wq for timeout handling.
Set the correct workqueue to the init args struct.
--- drivers/gpu/drm/panfrost/panfrost_job.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/panfrost/panfrost_job.c +1 -1
@@ -835,7 +835,6 @@ int panfrost_job_init(struct panfrost_de .num_rqs = DRM_SCHED_PRIORITY_COUNT, .credit_limit = 2, .timeout = msecs_to_jiffies(JOB_TIMEOUT_MS), - .timeout_wq = pfdev->reset.wq, .name = "pan_js", .dev = pfdev->dev, };
@@ -873,6 +872,7 @@ int panfrost_job_init(struct panfrost_de pfdev->reset.wq =alloc_ordered_workqueue ("panfrost-reset" ,0 );if (!pfdev->reset.wq)return -ENOMEM ; + args.timeout_wq = pfdev->reset.wq;for (j =0 ; j <NUM_JOB_SLOTS ; j++) { js->queue[j].fence_context =dma_fence_context_alloc (1 );
# Librecast Test Results
044/044 [ OK ] liblcrq
010/010 [ OK ] libmld
120/120 [ OK ] liblibrecast
CPU/kernel: Linux auntie 6.12.114-rc1-g1cda2e472e80 #1 SMP PREEMPT_DYNAMIC Sat Oct 17 16:40:18 -00 2026 x86_64 AMD Ryzen 9 9950X 16-Core Processor AuthenticAMD GNU/Linux
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.12.114 release. There are 869 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 Mon, 19 Oct 2026 15:59:15 +0000. Anything received after that time might be too late.
Quoted 6 lines
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.114-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.12.y
and the diffstat can be found below.>
-------------
Tested on AMD64 12-core and 4-core systems
and on Intel x86-64 4-core and x86 1-core systems
Am 17.10.2026 um 17:47 schrieb Greg Kroah-Hartman:
Quoted 4 lines
This is the start of the stable review cycle for the 6.12.114 release. There are 869 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.
Builds, boots and works on my 2-socket Ivy Bridge Xeon E5-2697v2 server. No dmesg oddities or regressions found.
Beste Grüße,
Peter Schneider
Signature · 8 lines
Climb the mountain not to plant your flag, but to embrace the challenge, enjoy the air and behold the view. Climb it so you can see the world, not so the world can see you. -- David McCullough Jr. OpenPGP: 0xA3828BD796CCE11A8CADE8866E3A92C92C3FF244 Download: https://www.peters-netzplatz.de/download/pschneider1968_pub.asc https://keys.mailvelope.com/pks/lookup?op=get&[email protected] https://keys.mailvelope.com/pks/lookup?op=get&[email protected]
Quoted 8 lines · On Sat, 17 Oct 2026 17:47:21 +0200 Greg Kroah-Hartman…
This is the start of the stable review cycle for the 6.12.114 release. There are 869 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 Mon, 19 Oct 2026 15:59:15 +0000. Anything received after that time might be too late.
Boot-tested under QEMU for Rust x86_64, arm64 and riscv64; built-tested for loongarch64:
Thanks!
Cheers,
Miguel
Quoted 4 lines · On Sat, 17 Oct 2026 17:47:21 +0200 Greg Kroah-Hartman…
This is the start of the stable review cycle for the 6.12.114 release. There are 869 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.
This rc kernel passes DAMON functionality test [1] on my test machine.
[1] https://github.com/damonitor/damon-tests/tree/next/corr
Thanks,
SJ
[...]
Built and booted 6.12.114-rc1 (1cda2e472e80) on x86_64 using defconfig + kvm_guest.config under QEMU/KVM with 2 vCPUs.
The build completed without warnings, and dmesg showed no oopses, BUGs, or WARN splats during boot.
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.12.114 release. There are 869 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.
Built, booted, and tested on hardware for x86_64:
- Intel N100
No regressions found.
Thanks!
Sean
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.12.114 release. There are 869 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 Mon, 19 Oct 2026 15:59:15 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.114-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.12.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Hi!
Quoted 4 lines
This is the start of the stable review cycle for the 6.12.114 release. There are 869 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.
CIP testing did not find any problems here:
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/tree/linux-6.12.y
Best regards,
Pavel
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.12.114 release. There are 869 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 Mon, 19 Oct 2026 15:59:15 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.114-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.12.y
and the diffstat can be found below.thanks,
greg k-h
perf fails to build for ARM/ARM64/BMIPS_GENERIC with:
util/event.c: In function 'machine__resolve':util/event.c:775:32: warning: implicit declaration of function 'perf_env__get_cpu_topology'; did you mean 'perf_env__read_cpu_topology_map'? [-Wimplicit-function-declaration]
775 | topo = perf_env__get_cpu_topology(env,
(struct perf_cpu){ al->cpu });
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| perf_env__read_cpu_topology_maputil/event.c:775:30: warning: assignment to 'struct cpu_topology_map *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
775 | topo = perf_env__get_cpu_topology(env,
(struct perf_cpu){ al->cpu });
| ^
Signature · 1 line
Florian
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.12.114 release. There are 869 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 Mon, 19 Oct 2026 15:59:15 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.114-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.12.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah