From 45e7775c05079a3d26a207e5e4241b916c3ca8ac Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Thu, 9 May 2024 06:09:33 -0400 Subject: [PATCH] Fixes for 6.8 Signed-off-by: Sasha Levin --- ...ng-of-synchronizing-bitmap-and-inode.patch | 53 ++++++++++++++++++ ...ip-don-t-unconditionally-print-valid.patch | 39 ++++++++++++++ ...2-check-for-non-null-vcpu-in-vgic_v2.patch | 54 +++++++++++++++++++ queue-6.8/series | 3 ++ 4 files changed, 149 insertions(+) create mode 100644 queue-6.8/exfat-fix-timing-of-synchronizing-bitmap-and-inode.patch create mode 100644 queue-6.8/firmware-microchip-don-t-unconditionally-print-valid.patch create mode 100644 queue-6.8/kvm-arm64-vgic-v2-check-for-non-null-vcpu-in-vgic_v2.patch diff --git a/queue-6.8/exfat-fix-timing-of-synchronizing-bitmap-and-inode.patch b/queue-6.8/exfat-fix-timing-of-synchronizing-bitmap-and-inode.patch new file mode 100644 index 00000000000..03209bc06f8 --- /dev/null +++ b/queue-6.8/exfat-fix-timing-of-synchronizing-bitmap-and-inode.patch @@ -0,0 +1,53 @@ +From b5b7ee44b4596212d7bbba547d3e1cbb99695f3f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 31 Mar 2024 23:38:17 +0900 +Subject: exfat: fix timing of synchronizing bitmap and inode + +From: Yuezhang Mo + +[ Upstream commit d7ed5232f0f16181506373d73e711190d5e0c868 ] + +Commit(f55c096f62f1 exfat: do not zero the extended part) changed +the timing of synchronizing bitmap and inode in exfat_cont_expand(). +The change caused xfstests generic/013 to fail if 'dirsync' or 'sync' +is enabled. So this commit restores the timing. + +Fixes: f55c096f62f1 ("exfat: do not zero the extended part") +Signed-off-by: Yuezhang Mo +Signed-off-by: Namjae Jeon +Signed-off-by: Sasha Levin +--- + fs/exfat/file.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/fs/exfat/file.c b/fs/exfat/file.c +index cc00f1a7a1e18..9adfc38ca7dac 100644 +--- a/fs/exfat/file.c ++++ b/fs/exfat/file.c +@@ -51,7 +51,7 @@ static int exfat_cont_expand(struct inode *inode, loff_t size) + clu.flags = ei->flags; + + ret = exfat_alloc_cluster(inode, new_num_clusters - num_clusters, +- &clu, IS_DIRSYNC(inode)); ++ &clu, inode_needs_sync(inode)); + if (ret) + return ret; + +@@ -77,12 +77,11 @@ static int exfat_cont_expand(struct inode *inode, loff_t size) + ei->i_size_aligned = round_up(size, sb->s_blocksize); + ei->i_size_ondisk = ei->i_size_aligned; + inode->i_blocks = round_up(size, sbi->cluster_size) >> 9; ++ mark_inode_dirty(inode); + +- if (IS_DIRSYNC(inode)) ++ if (IS_SYNC(inode)) + return write_inode_now(inode, 1); + +- mark_inode_dirty(inode); +- + return 0; + + free_clu: +-- +2.43.0 + diff --git a/queue-6.8/firmware-microchip-don-t-unconditionally-print-valid.patch b/queue-6.8/firmware-microchip-don-t-unconditionally-print-valid.patch new file mode 100644 index 00000000000..4d32f950d56 --- /dev/null +++ b/queue-6.8/firmware-microchip-don-t-unconditionally-print-valid.patch @@ -0,0 +1,39 @@ +From 3e623ad27f4389be0328e6e61389b0071ce75e6a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 10 Apr 2024 12:58:05 +0100 +Subject: firmware: microchip: don't unconditionally print validation success + +From: Conor Dooley + +[ Upstream commit 6e3b7e862ea4e4ff1be1d153ae07dfe150ed8896 ] + +If validation fails, both prints are made. Skip the success one in the +failure case. + +Fixes: ec5b0f1193ad ("firmware: microchip: add PolarFire SoC Auto Update support") +Signed-off-by: Conor Dooley +Signed-off-by: Sasha Levin +--- + drivers/firmware/microchip/mpfs-auto-update.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/firmware/microchip/mpfs-auto-update.c b/drivers/firmware/microchip/mpfs-auto-update.c +index fbeeaee4ac856..23134ffc4dfc6 100644 +--- a/drivers/firmware/microchip/mpfs-auto-update.c ++++ b/drivers/firmware/microchip/mpfs-auto-update.c +@@ -206,10 +206,12 @@ static int mpfs_auto_update_verify_image(struct fw_upload *fw_uploader) + if (ret | response->resp_status) { + dev_warn(priv->dev, "Verification of Upgrade Image failed!\n"); + ret = ret ? ret : -EBADMSG; ++ goto free_message; + } + + dev_info(priv->dev, "Verification of Upgrade Image passed!\n"); + ++free_message: + devm_kfree(priv->dev, message); + free_response: + devm_kfree(priv->dev, response); +-- +2.43.0 + diff --git a/queue-6.8/kvm-arm64-vgic-v2-check-for-non-null-vcpu-in-vgic_v2.patch b/queue-6.8/kvm-arm64-vgic-v2-check-for-non-null-vcpu-in-vgic_v2.patch new file mode 100644 index 00000000000..a536b0bf423 --- /dev/null +++ b/queue-6.8/kvm-arm64-vgic-v2-check-for-non-null-vcpu-in-vgic_v2.patch @@ -0,0 +1,54 @@ +From 86cddded007f92d29e1b04fce9d17898cc0da20f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 24 Apr 2024 17:39:58 +0000 +Subject: KVM: arm64: vgic-v2: Check for non-NULL vCPU in vgic_v2_parse_attr() + +From: Oliver Upton + +[ Upstream commit 6ddb4f372fc63210034b903d96ebbeb3c7195adb ] + +vgic_v2_parse_attr() is responsible for finding the vCPU that matches +the user-provided CPUID, which (of course) may not be valid. If the ID +is invalid, kvm_get_vcpu_by_id() returns NULL, which isn't handled +gracefully. + +Similar to the GICv3 uaccess flow, check that kvm_get_vcpu_by_id() +actually returns something and fail the ioctl if not. + +Cc: stable@vger.kernel.org +Fixes: 7d450e282171 ("KVM: arm/arm64: vgic-new: Add userland access to VGIC dist registers") +Reported-by: Alexander Potapenko +Tested-by: Alexander Potapenko +Reviewed-by: Alexander Potapenko +Reviewed-by: Marc Zyngier +Link: https://lore.kernel.org/r/20240424173959.3776798-2-oliver.upton@linux.dev +Signed-off-by: Oliver Upton +Signed-off-by: Sasha Levin +--- + arch/arm64/kvm/vgic/vgic-kvm-device.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/arch/arm64/kvm/vgic/vgic-kvm-device.c b/arch/arm64/kvm/vgic/vgic-kvm-device.c +index f48b8dab8b3d2..1d26bb5b02f4b 100644 +--- a/arch/arm64/kvm/vgic/vgic-kvm-device.c ++++ b/arch/arm64/kvm/vgic/vgic-kvm-device.c +@@ -338,12 +338,12 @@ int kvm_register_vgic_device(unsigned long type) + int vgic_v2_parse_attr(struct kvm_device *dev, struct kvm_device_attr *attr, + struct vgic_reg_attr *reg_attr) + { +- int cpuid; ++ int cpuid = FIELD_GET(KVM_DEV_ARM_VGIC_CPUID_MASK, attr->attr); + +- cpuid = FIELD_GET(KVM_DEV_ARM_VGIC_CPUID_MASK, attr->attr); +- +- reg_attr->vcpu = kvm_get_vcpu_by_id(dev->kvm, cpuid); + reg_attr->addr = attr->attr & KVM_DEV_ARM_VGIC_OFFSET_MASK; ++ reg_attr->vcpu = kvm_get_vcpu_by_id(dev->kvm, cpuid); ++ if (!reg_attr->vcpu) ++ return -EINVAL; + + return 0; + } +-- +2.43.0 + diff --git a/queue-6.8/series b/queue-6.8/series index 07e55fc3f1c..6afe0df6d50 100644 --- a/queue-6.8/series +++ b/queue-6.8/series @@ -91,3 +91,6 @@ powerpc-pseries-make-max-polling-consistent-for-long.patch powerpc-pseries-iommu-lpar-panics-during-boot-up-wit.patch edac-versal-do-not-log-total-error-counts.patch swiotlb-initialise-restricted-pool-list_head-when-sw.patch +kvm-arm64-vgic-v2-check-for-non-null-vcpu-in-vgic_v2.patch +exfat-fix-timing-of-synchronizing-bitmap-and-inode.patch +firmware-microchip-don-t-unconditionally-print-valid.patch -- 2.47.2