From: Greg Kroah-Hartman Date: Tue, 17 Mar 2026 13:27:55 +0000 (+0100) Subject: 6.12-stable patches X-Git-Tag: v6.18.19~37 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=43f1c83d2f19f7fec36d0a94d9a47689c5dff9b8;p=thirdparty%2Fkernel%2Fstable-queue.git 6.12-stable patches added patches: btrfs-abort-transaction-on-failure-to-update-root-in-the-received-subvol-ioctl.patch btrfs-fix-transaction-abort-on-file-creation-due-to-name-hash-collision.patch btrfs-fix-transaction-abort-on-set-received-ioctl-due-to-item-overflow.patch cifs-make-default-value-of-retrans-as-zero.patch drm-amd-pm-remove-invalid-gpu_metrics.energy_accumulator-on-smu-v13.0.x.patch drm-amd-set-num-ip-blocks-to-0-if-discovery-fails.patch drm-amdgpu-fix-use-after-free-race-in-vm-acquire.patch drm-bridge-ti-sn65dsi83-fix-cha_dsi_clk_range-rounding.patch drm-i915-fix-potential-overflow-of-shmem-scatterlist-length.patch drm-msm-fix-dma_free_attrs-buffer-size.patch iio-buffer-fix-wait_queue-not-being-removed.patch iio-chemical-bme680-fix-measurement-wait-duration-calculation.patch iio-chemical-sps30_i2c-fix-buffer-size-in-sps30_i2c_read_meas.patch iio-chemical-sps30_serial-fix-buffer-size-in-sps30_serial_read_meas.patch iio-dac-ds4424-reject-128-raw-value.patch iio-frequency-adf4377-fix-duplicated-soft-reset-mask.patch iio-gyro-mpu3050-core-fix-pm_runtime-error-handling.patch iio-gyro-mpu3050-i2c-fix-pm_runtime-error-handling.patch iio-imu-inv_icm42600-fix-odr-switch-to-the-same-value.patch iio-imu-inv_icm42600-fix-odr-switch-when-turning-buffer-off.patch iio-potentiometer-mcp4131-fix-double-application-of-wiper-shift.patch iio-proximity-hx9023s-protect-against-division-by-zero-in-set_samp_freq.patch lib-bootconfig-check-bounds-before-writing-in-__xbc_open_brace.patch lib-bootconfig-fix-off-by-one-in-xbc_verify_tree-unclosed-brace-error.patch lib-bootconfig-fix-snprintf-truncation-check-in-xbc_node_compose_key_after.patch qmi_wwan-allow-max_mtu-above-hard_mtu-to-control-rx_urb_size.patch s390-dasd-copy-detected-format-information-to-secondary-device.patch s390-dasd-move-quiesce-state-with-pprc-swap.patch scsi-core-fix-error-handling-for-scsi_alloc_sdev.patch smb-client-fix-atomic-open-with-o_direct-o_sync.patch smb-client-fix-iface-port-assignment-in-parse_server_interfaces.patch smb-client-fix-in-place-encryption-corruption-in-smb2_write.patch tracing-fix-enabling-multiple-events-on-the-kernel-command-line-and-bootconfig.patch tracing-fix-trace_buf_size-cmdline-parameter-with-sizes-2g.patch x86-apic-disable-x2apic-on-resume-if-the-kernel-expects-so.patch xfs-ensure-dquot-item-is-deleted-from-ail-only-after-log-shutdown.patch xfs-fix-returned-valued-from-xfs_defer_can_append.patch xfs-fix-undersized-l_iclog_roundoff-values.patch --- diff --git a/queue-6.12/btrfs-abort-transaction-on-failure-to-update-root-in-the-received-subvol-ioctl.patch b/queue-6.12/btrfs-abort-transaction-on-failure-to-update-root-in-the-received-subvol-ioctl.patch new file mode 100644 index 0000000000..ee963c7213 --- /dev/null +++ b/queue-6.12/btrfs-abort-transaction-on-failure-to-update-root-in-the-received-subvol-ioctl.patch @@ -0,0 +1,36 @@ +From 0f475ee0ebce5c9492b260027cd95270191675fa Mon Sep 17 00:00:00 2001 +From: Filipe Manana +Date: Fri, 27 Feb 2026 00:02:33 +0000 +Subject: btrfs: abort transaction on failure to update root in the received subvol ioctl + +From: Filipe Manana + +commit 0f475ee0ebce5c9492b260027cd95270191675fa upstream. + +If we failed to update the root we don't abort the transaction, which is +wrong since we already used the transaction to remove an item from the +uuid tree. + +Fixes: dd5f9615fc5c ("Btrfs: maintain subvolume items in the UUID tree") +CC: stable@vger.kernel.org # 3.12+ +Reviewed-by: Anand Jain +Signed-off-by: Filipe Manana +Reviewed-by: David Sterba +Signed-off-by: David Sterba +Signed-off-by: Greg Kroah-Hartman +--- + fs/btrfs/ioctl.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/fs/btrfs/ioctl.c ++++ b/fs/btrfs/ioctl.c +@@ -4152,7 +4152,8 @@ static long _btrfs_ioctl_set_received_su + + ret = btrfs_update_root(trans, fs_info->tree_root, + &root->root_key, &root->root_item); +- if (ret < 0) { ++ if (unlikely(ret < 0)) { ++ btrfs_abort_transaction(trans, ret); + btrfs_end_transaction(trans); + goto out; + } diff --git a/queue-6.12/btrfs-fix-transaction-abort-on-file-creation-due-to-name-hash-collision.patch b/queue-6.12/btrfs-fix-transaction-abort-on-file-creation-due-to-name-hash-collision.patch new file mode 100644 index 0000000000..c9a7a32c8e --- /dev/null +++ b/queue-6.12/btrfs-fix-transaction-abort-on-file-creation-due-to-name-hash-collision.patch @@ -0,0 +1,189 @@ +From 2d1ababdedd4ba38867c2500eb7f95af5ddeeef7 Mon Sep 17 00:00:00 2001 +From: Filipe Manana +Date: Thu, 26 Feb 2026 11:05:43 +0000 +Subject: btrfs: fix transaction abort on file creation due to name hash collision + +From: Filipe Manana + +commit 2d1ababdedd4ba38867c2500eb7f95af5ddeeef7 upstream. + +If we attempt to create several files with names that result in the same +hash, we have to pack them in same dir item and that has a limit inherent +to the leaf size. However if we reach that limit, we trigger a transaction +abort and turns the filesystem into RO mode. This allows for a malicious +user to disrupt a system, without the need to have administration +privileges/capabilities. + +Reproducer: + + $ cat exploit-hash-collisions.sh + #!/bin/bash + + DEV=/dev/sdi + MNT=/mnt/sdi + + # Use smallest node size to make the test faster and require fewer file + # names that result in hash collision. + mkfs.btrfs -f --nodesize 4K $DEV + mount $DEV $MNT + + # List of names that result in the same crc32c hash for btrfs. + declare -a names=( + 'foobar' + '%a8tYkxfGMLWRGr55QSeQc4PBNH9PCLIvR6jZnkDtUUru1t@RouaUe_L:@xGkbO3nCwvLNYeK9vhE628gss:T$yZjZ5l-Nbd6CbC$M=hqE-ujhJICXyIxBvYrIU9-TDC' + 'AQci3EUB%shMsg-N%frgU:02ByLs=IPJU0OpgiWit5nexSyxZDncY6WB:=zKZuk5Zy0DD$Ua78%MelgBuMqaHGyKsJUFf9s=UW80PcJmKctb46KveLSiUtNmqrMiL9-Y0I_l5Fnam04CGIg=8@U:Z' + 'CvVqJpJzueKcuA$wqwePfyu7VxuWNN3ho$p0zi2H8QFYK$7YlEqOhhb%:hHgjhIjW5vnqWHKNP4' + 'ET:vk@rFU4tsvMB0$C_p=xQHaYZjvoF%-BTc%wkFW8yaDAPcCYoR%x$FH5O:' + 'HwTon%v7SGSP4FE08jBwwiu5aot2CFKXHTeEAa@38fUcNGOWvE@Mz6WBeDH_VooaZ6AgsXPkVGwy9l@@ZbNXabUU9csiWrrOp0MWUdfi$EZ3w9GkIqtz7I_eOsByOkBOO' + 'Ij%2VlFGXSuPvxJGf5UWy6O@1svxGha%b@=%wjkq:CIgE6u7eJOjmQY5qTtxE2Rjbis9@us' + 'KBkjG5%9R8K9sOG8UTnAYjxLNAvBmvV5vz3IiZaPmKuLYO03-6asI9lJ_j4@6Xo$KZicaLWJ3Pv8XEwVeUPMwbHYWwbx0pYvNlGMO9F:ZhHAwyctnGy%_eujl%WPd4U2BI7qooOSr85J-C2V$LfY' + 'NcRfDfuUQ2=zP8K3CCF5dFcpfiOm6mwenShsAb_F%n6GAGC7fT2JFFn:c35X-3aYwoq7jNX5$ZJ6hI3wnZs$7KgGi7wjulffhHNUxAT0fRRLF39vJ@NvaEMxsMO' + 'Oj42AQAEzRoTxa5OuSKIr=A_lwGMy132v4g3Pdq1GvUG9874YseIFQ6QU' + 'Ono7avN5GjC:_6dBJ_' + 'WHmN2gnmaN-9dVDy4aWo:yNGFzz8qsJyJhWEWcud7$QzN2D9R0efIWWEdu5kwWr73NZm4=@CoCDxrrZnRITr-kGtU_cfW2:%2_am' + 'WiFnuTEhAG9FEC6zopQmj-A-$LDQ0T3WULz%ox3UZAPybSV6v1Z$b4L_XBi4M4BMBtJZpz93r9xafpB77r:lbwvitWRyo$odnAUYlYMmU4RvgnNd--e=I5hiEjGLETTtaScWlQp8mYsBovZwM2k' + 'XKyH=OsOAF3p%uziGF_ZVr$ivrvhVgD@1u%5RtrV-gl_vqAwHkK@x7YwlxX3qT6WKKQ%PR56NrUBU2dOAOAdzr2=5nJuKPM-T-$ZpQfCL7phxQbUcb:BZOTPaFExc-qK-gDRCDW2' + 'd3uUR6OFEwZr%ns1XH_@tbxA@cCPmbBRLdyh7p6V45H$P2$F%w0RqrD3M0g8aGvWpoTFMiBdOTJXjD:JF7=h9a_43xBywYAP%r$SPZi%zDg%ql-KvkdUCtF9OLaQlxmd' + 'ePTpbnit%hyNm@WELlpKzNZYOzOTf8EQ$sEfkMy1VOfIUu3coyvIr13-Y7Sv5v-Ivax2Go_GQRFMU1b3362nktT9WOJf3SpT%z8sZmM3gvYQBDgmKI%%RM-G7hyrhgYflOw%z::ZRcv5O:lDCFm' + 'evqk743Y@dvZAiG5J05L_ROFV@$2%rVWJ2%3nxV72-W7$e$-SK3tuSHA2mBt$qloC5jwNx33GmQUjD%akhBPu=VJ5g$xhlZiaFtTrjeeM5x7dt4cHpX0cZkmfImndYzGmvwQG:$euFYmXn$_2rA9mKZ' + 'gkgUtnihWXsZQTEkrMAWIxir09k3t7jk_IK25t1:cy1XWN0GGqC%FrySdcmU7M8MuPO_ppkLw3=Dfr0UuBAL4%GFk2$Ma10V1jDRGJje%Xx9EV2ERaWKtjpwiZwh0gCSJsj5UL7CR8RtW5opCVFKGGy8Cky' + 'hNgsG_8lNRik3PvphqPm0yEH3P%%fYG:kQLY=6O-61Wa6nrV_WVGR6TLB09vHOv%g4VQRP8Gzx7VXUY1qvZyS' + 'isA7JVzN12xCxVPJZ_qoLm-pTBuhjjHMvV7o=F:EaClfYNyFGlsfw-Kf%uxdqW-kwk1sPl2vhbjyHU1A6$hz' + 'kiJ_fgcdZFDiOptjgH5PN9-PSyLO4fbk_:u5_2tz35lV_iXiJ6cx7pwjTtKy-XGaQ5IefmpJ4N_ZqGsqCsKuqOOBgf9LkUdffHet@Wu' + 'lvwtxyhE9:%Q3UxeHiViUyNzJsy:fm38pg_b6s25JvdhOAT=1s0$pG25x=LZ2rlHTszj=gN6M4zHZYr_qrB49i=pA--@WqWLIuX7o1S_SfS@2FSiUZN' + 'rC24cw3UBDZ=5qJBUMs9e$=S4Y94ni%Z8639vnrGp=0Hv4z3dNFL0fBLmQ40=EYIY:Z=SLc@QLMSt2zsss2ZXrP7j4=' + 'uwGl2s-fFrf@GqS=DQqq2I0LJSsOmM%xzTjS:lzXguE3wChdMoHYtLRKPvfaPOZF2fER@j53evbKa7R%A7r4%YEkD=kicJe@SFiGtXHbKe4gCgPAYbnVn' + 'UG37U6KKua2bgc:IHzRs7BnB6FD:2Mt5Cc5NdlsW%$1tyvnfz7S27FvNkroXwAW:mBZLA1@qa9WnDbHCDmQmfPMC9z-Eq6QT0jhhPpqyymaD:R02ghwYo%yx7SAaaq-:x33LYpei$5g8DMl3C' + 'y2vjek0FE1PDJC0qpfnN:x8k2wCFZ9xiUF2ege=JnP98R%wxjKkdfEiLWvQzmnW' + '8-HCSgH5B%K7P8_jaVtQhBXpBk:pE-$P7ts58U0J@iR9YZntMPl7j$s62yAJO@_9eanFPS54b=UTw$94C-t=HLxT8n6o9P=QnIxq-f1=Ne2dvhe6WbjEQtc' + 'YPPh:IFt2mtR6XWSmjHptXL_hbSYu8bMw-JP8@PNyaFkdNFsk$M=xfL6LDKCDM-mSyGA_2MBwZ8Dr4=R1D%7-mCaaKGxb990jzaagRktDTyp' + '9hD2ApKa_t_7x-a@GCG28kY:7$M@5udI1myQ$x5udtggvagmCQcq9QXWRC5hoB0o-_zHQUqZI5rMcz_kbMgvN5jr63LeYA4Cj-c6F5Ugmx6DgVf@2Jqm%MafecpgooqreJ53P-QTS' + ) + + # Now create files with all those names in the same parent directory. + # It should not fail since a 4K leaf has enough space for them. + for name in "${names[@]}"; do + touch $MNT/$name + done + + # Now add one more file name that causes a crc32c hash collision. + # This should fail, but it should not turn the filesystem into RO mode + # (which could be exploited by malicious users) due to a transaction + # abort. + touch $MNT/'W6tIm-VK2@BGC@IBfcgg6j_p:pxp_QUqtWpGD5Ok_GmijKOJJt' + + # Check that we are able to create another file, with a name that does not cause + # a crc32c hash collision. + echo -n "hello world" > $MNT/baz + + # Unmount and mount again, verify file baz exists and with the right content. + umount $MNT + mount $DEV $MNT + echo "File baz content: $(cat $MNT/baz)" + + umount $MNT + +When running the reproducer: + + $ ./exploit-hash-collisions.sh + (...) + touch: cannot touch '/mnt/sdi/W6tIm-VK2@BGC@IBfcgg6j_p:pxp_QUqtWpGD5Ok_GmijKOJJt': Value too large for defined data type + ./exploit-hash-collisions.sh: line 57: /mnt/sdi/baz: Read-only file system + cat: /mnt/sdi/baz: No such file or directory + File baz content: + +And the transaction abort stack trace in dmesg/syslog: + + $ dmesg + (...) + [758240.509761] ------------[ cut here ]------------ + [758240.510668] BTRFS: Transaction aborted (error -75) + [758240.511577] WARNING: fs/btrfs/inode.c:6854 at btrfs_create_new_inode+0x805/0xb50 [btrfs], CPU#6: touch/888644 + [758240.513513] Modules linked in: btrfs dm_zero (...) + [758240.523221] CPU: 6 UID: 0 PID: 888644 Comm: touch Tainted: G W 6.19.0-rc8-btrfs-next-225+ #1 PREEMPT(full) + [758240.524621] Tainted: [W]=WARN + [758240.525037] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.2-0-gea1b7a073390-prebuilt.qemu.org 04/01/2014 + [758240.526331] RIP: 0010:btrfs_create_new_inode+0x80b/0xb50 [btrfs] + [758240.527093] Code: 0f 82 cf (...) + [758240.529211] RSP: 0018:ffffce64418fbb48 EFLAGS: 00010292 + [758240.529935] RAX: 00000000ffffffd3 RBX: 0000000000000000 RCX: 00000000ffffffb5 + [758240.531040] RDX: 0000000d04f33e06 RSI: 00000000ffffffb5 RDI: ffffffffc0919dd0 + [758240.531920] RBP: ffffce64418fbc10 R08: 0000000000000000 R09: 00000000ffffffb5 + [758240.532928] R10: 0000000000000000 R11: ffff8e52c0000000 R12: ffff8e53eee7d0f0 + [758240.533818] R13: ffff8e57f70932a0 R14: ffff8e5417629568 R15: 0000000000000000 + [758240.534664] FS: 00007f1959a2a740(0000) GS:ffff8e5b27cae000(0000) knlGS:0000000000000000 + [758240.535821] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 + [758240.536644] CR2: 00007f1959b10ce0 CR3: 000000012a2cc005 CR4: 0000000000370ef0 + [758240.537517] Call Trace: + [758240.537828] + [758240.538099] btrfs_create_common+0xbf/0x140 [btrfs] + [758240.538760] path_openat+0x111a/0x15b0 + [758240.539252] do_filp_open+0xc2/0x170 + [758240.539699] ? preempt_count_add+0x47/0xa0 + [758240.540200] ? __virt_addr_valid+0xe4/0x1a0 + [758240.540800] ? __check_object_size+0x1b3/0x230 + [758240.541661] ? alloc_fd+0x118/0x180 + [758240.542315] do_sys_openat2+0x70/0xd0 + [758240.543012] __x64_sys_openat+0x50/0xa0 + [758240.543723] do_syscall_64+0x50/0xf20 + [758240.544462] entry_SYSCALL_64_after_hwframe+0x76/0x7e + [758240.545397] RIP: 0033:0x7f1959abc687 + [758240.546019] Code: 48 89 fa (...) + [758240.548522] RSP: 002b:00007ffe16ff8690 EFLAGS: 00000202 ORIG_RAX: 0000000000000101 + [758240.566278] RAX: ffffffffffffffda RBX: 00007f1959a2a740 RCX: 00007f1959abc687 + [758240.567068] RDX: 0000000000000941 RSI: 00007ffe16ffa333 RDI: ffffffffffffff9c + [758240.567860] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 + [758240.568707] R10: 00000000000001b6 R11: 0000000000000202 R12: 0000561eec7c4b90 + [758240.569712] R13: 0000561eec7c311f R14: 00007ffe16ffa333 R15: 0000000000000000 + [758240.570758] + [758240.571040] ---[ end trace 0000000000000000 ]--- + [758240.571681] BTRFS: error (device sdi state A) in btrfs_create_new_inode:6854: errno=-75 unknown + [758240.572899] BTRFS info (device sdi state EA): forced readonly + +Fix this by checking for hash collision, and if the adding a new name is +possible, early in btrfs_create_new_inode() before we do any tree updates, +so that we don't need to abort the transaction if we cannot add the new +name due to the leaf size limit. + +A test case for fstests will be sent soon. + +Fixes: caae78e03234 ("btrfs: move common inode creation code into btrfs_create_new_inode()") +CC: stable@vger.kernel.org # 6.1+ +Reviewed-by: Boris Burkov +Reviewed-by: Qu Wenruo +Signed-off-by: Filipe Manana +Reviewed-by: David Sterba +Signed-off-by: David Sterba +Signed-off-by: Greg Kroah-Hartman +--- + fs/btrfs/inode.c | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +--- a/fs/btrfs/inode.c ++++ b/fs/btrfs/inode.c +@@ -6358,6 +6358,25 @@ int btrfs_create_new_inode(struct btrfs_ + int ret; + bool xa_reserved = false; + ++ if (!args->orphan && !args->subvol) { ++ /* ++ * Before anything else, check if we can add the name to the ++ * parent directory. We want to avoid a dir item overflow in ++ * case we have an existing dir item due to existing name ++ * hash collisions. We do this check here before we call ++ * btrfs_add_link() down below so that we can avoid a ++ * transaction abort (which could be exploited by malicious ++ * users). ++ * ++ * For subvolumes we already do this in btrfs_mksubvol(). ++ */ ++ ret = btrfs_check_dir_item_collision(BTRFS_I(dir)->root, ++ btrfs_ino(BTRFS_I(dir)), ++ name); ++ if (ret < 0) ++ return ret; ++ } ++ + path = btrfs_alloc_path(); + if (!path) + return -ENOMEM; diff --git a/queue-6.12/btrfs-fix-transaction-abort-on-set-received-ioctl-due-to-item-overflow.patch b/queue-6.12/btrfs-fix-transaction-abort-on-set-received-ioctl-due-to-item-overflow.patch new file mode 100644 index 0000000000..ef432ccd82 --- /dev/null +++ b/queue-6.12/btrfs-fix-transaction-abort-on-set-received-ioctl-due-to-item-overflow.patch @@ -0,0 +1,133 @@ +From 87f2c46003fce4d739138aab4af1942b1afdadac Mon Sep 17 00:00:00 2001 +From: Filipe Manana +Date: Thu, 26 Feb 2026 23:41:07 +0000 +Subject: btrfs: fix transaction abort on set received ioctl due to item overflow + +From: Filipe Manana + +commit 87f2c46003fce4d739138aab4af1942b1afdadac upstream. + +If the set received ioctl fails due to an item overflow when attempting to +add the BTRFS_UUID_KEY_RECEIVED_SUBVOL we have to abort the transaction +since we did some metadata updates before. + +This means that if a user calls this ioctl with the same received UUID +field for a lot of subvolumes, we will hit the overflow, trigger the +transaction abort and turn the filesystem into RO mode. A malicious user +could exploit this, and this ioctl does not even requires that a user +has admin privileges (CAP_SYS_ADMIN), only that he/she owns the subvolume. + +Fix this by doing an early check for item overflow before starting a +transaction. This is also race safe because we are holding the subvol_sem +semaphore in exclusive (write) mode. + +A test case for fstests will follow soon. + +Fixes: dd5f9615fc5c ("Btrfs: maintain subvolume items in the UUID tree") +CC: stable@vger.kernel.org # 3.12+ +Reviewed-by: Anand Jain +Signed-off-by: Filipe Manana +Reviewed-by: David Sterba +Signed-off-by: David Sterba +Signed-off-by: Greg Kroah-Hartman +--- + fs/btrfs/ioctl.c | 21 +++++++++++++++++++-- + fs/btrfs/uuid-tree.c | 38 ++++++++++++++++++++++++++++++++++++++ + fs/btrfs/uuid-tree.h | 2 ++ + 3 files changed, 59 insertions(+), 2 deletions(-) + +--- a/fs/btrfs/ioctl.c ++++ b/fs/btrfs/ioctl.c +@@ -4097,6 +4097,25 @@ static long _btrfs_ioctl_set_received_su + goto out; + } + ++ received_uuid_changed = memcmp(root_item->received_uuid, sa->uuid, ++ BTRFS_UUID_SIZE); ++ ++ /* ++ * Before we attempt to add the new received uuid, check if we have room ++ * for it in case there's already an item. If the size of the existing ++ * item plus this root's ID (u64) exceeds the maximum item size, we can ++ * return here without the need to abort a transaction. If we don't do ++ * this check, the btrfs_uuid_tree_add() call below would fail with ++ * -EOVERFLOW and result in a transaction abort. Malicious users could ++ * exploit this to turn the fs into RO mode. ++ */ ++ if (received_uuid_changed && !btrfs_is_empty_uuid(sa->uuid)) { ++ ret = btrfs_uuid_tree_check_overflow(fs_info, sa->uuid, ++ BTRFS_UUID_KEY_RECEIVED_SUBVOL); ++ if (ret < 0) ++ goto out; ++ } ++ + /* + * 1 - root item + * 2 - uuid items (received uuid + subvol uuid) +@@ -4112,8 +4131,6 @@ static long _btrfs_ioctl_set_received_su + sa->rtime.sec = ct.tv_sec; + sa->rtime.nsec = ct.tv_nsec; + +- received_uuid_changed = memcmp(root_item->received_uuid, sa->uuid, +- BTRFS_UUID_SIZE); + if (received_uuid_changed && + !btrfs_is_empty_uuid(root_item->received_uuid)) { + ret = btrfs_uuid_tree_remove(trans, root_item->received_uuid, +--- a/fs/btrfs/uuid-tree.c ++++ b/fs/btrfs/uuid-tree.c +@@ -229,6 +229,44 @@ out: + return ret; + } + ++/* ++ * Check if we can add one root ID to a UUID key. ++ * If the key does not yet exists, we can, otherwise only if extended item does ++ * not exceeds the maximum item size permitted by the leaf size. ++ * ++ * Returns 0 on success, negative value on error. ++ */ ++int btrfs_uuid_tree_check_overflow(struct btrfs_fs_info *fs_info, ++ const u8 *uuid, u8 type) ++{ ++ BTRFS_PATH_AUTO_FREE(path); ++ int ret; ++ u32 item_size; ++ struct btrfs_key key; ++ ++ if (WARN_ON_ONCE(!fs_info->uuid_root)) ++ return -EINVAL; ++ ++ path = btrfs_alloc_path(); ++ if (!path) ++ return -ENOMEM; ++ ++ btrfs_uuid_to_key(uuid, type, &key); ++ ret = btrfs_search_slot(NULL, fs_info->uuid_root, &key, path, 0, 0); ++ if (ret < 0) ++ return ret; ++ if (ret > 0) ++ return 0; ++ ++ item_size = btrfs_item_size(path->nodes[0], path->slots[0]); ++ ++ if (sizeof(struct btrfs_item) + item_size + sizeof(u64) > ++ BTRFS_LEAF_DATA_SIZE(fs_info)) ++ return -EOVERFLOW; ++ ++ return 0; ++} ++ + static int btrfs_uuid_iter_rem(struct btrfs_root *uuid_root, u8 *uuid, u8 type, + u64 subid) + { +--- a/fs/btrfs/uuid-tree.h ++++ b/fs/btrfs/uuid-tree.h +@@ -12,6 +12,8 @@ int btrfs_uuid_tree_add(struct btrfs_tra + u64 subid); + int btrfs_uuid_tree_remove(struct btrfs_trans_handle *trans, const u8 *uuid, u8 type, + u64 subid); ++int btrfs_uuid_tree_check_overflow(struct btrfs_fs_info *fs_info, ++ const u8 *uuid, u8 type); + int btrfs_uuid_tree_iterate(struct btrfs_fs_info *fs_info); + int btrfs_create_uuid_tree(struct btrfs_fs_info *fs_info); + int btrfs_uuid_scan_kthread(void *data); diff --git a/queue-6.12/cifs-make-default-value-of-retrans-as-zero.patch b/queue-6.12/cifs-make-default-value-of-retrans-as-zero.patch new file mode 100644 index 0000000000..ff6b1f8171 --- /dev/null +++ b/queue-6.12/cifs-make-default-value-of-retrans-as-zero.patch @@ -0,0 +1,34 @@ +From e3beefd3af09f8e460ddaf39063d3d7664d7ab59 Mon Sep 17 00:00:00 2001 +From: Shyam Prasad N +Date: Wed, 11 Mar 2026 10:48:54 +0530 +Subject: cifs: make default value of retrans as zero + +From: Shyam Prasad N + +commit e3beefd3af09f8e460ddaf39063d3d7664d7ab59 upstream. + +When retrans mount option was introduced, the default value was set +as 1. However, in the light of some bugs that this has exposed recently +we should change it to 0 and retain the old behaviour before this option +was introduced. + +Cc: +Reviewed-by: Bharath SM +Signed-off-by: Shyam Prasad N +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman +--- + fs/smb/client/fs_context.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/smb/client/fs_context.c ++++ b/fs/smb/client/fs_context.c +@@ -1847,7 +1847,7 @@ int smb3_init_fs_context(struct fs_conte + ctx->backupuid_specified = false; /* no backup intent for a user */ + ctx->backupgid_specified = false; /* no backup intent for a group */ + +- ctx->retrans = 1; ++ ctx->retrans = 0; + ctx->reparse_type = CIFS_REPARSE_TYPE_DEFAULT; + + /* diff --git a/queue-6.12/drm-amd-pm-remove-invalid-gpu_metrics.energy_accumulator-on-smu-v13.0.x.patch b/queue-6.12/drm-amd-pm-remove-invalid-gpu_metrics.energy_accumulator-on-smu-v13.0.x.patch new file mode 100644 index 0000000000..50ece843b4 --- /dev/null +++ b/queue-6.12/drm-amd-pm-remove-invalid-gpu_metrics.energy_accumulator-on-smu-v13.0.x.patch @@ -0,0 +1,62 @@ +From 68785c5e79e0fc1eacf63026fbba32be3867f410 Mon Sep 17 00:00:00 2001 +From: Yang Wang +Date: Wed, 25 Feb 2026 22:51:06 -0500 +Subject: drm/amd/pm: remove invalid gpu_metrics.energy_accumulator on smu v13.0.x + +From: Yang Wang + +commit 68785c5e79e0fc1eacf63026fbba32be3867f410 upstream. + +v1: +The metrics->EnergyAccumulator field has been deprecated on newer pmfw. + +v2: +add smu 13.0.0/13.0.7/13.0.10 support. + +Signed-off-by: Yang Wang +Acked-by: Alex Deucher +Signed-off-by: Alex Deucher +(cherry picked from commit 8de9edb35976fa56565dc8fbb5d1310e8e10187c) +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 8 +++++++- + drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 3 ++- + 2 files changed, 9 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c ++++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +@@ -2033,6 +2033,7 @@ static ssize_t smu_v13_0_0_get_gpu_metri + (struct gpu_metrics_v1_3 *)smu_table->gpu_metrics_table; + SmuMetricsExternal_t metrics_ext; + SmuMetrics_t *metrics = &metrics_ext.SmuMetrics; ++ uint32_t mp1_ver = amdgpu_ip_version(smu->adev, MP1_HWIP, 0); + int ret = 0; + + ret = smu_cmn_get_metrics_table(smu, +@@ -2057,7 +2058,12 @@ static ssize_t smu_v13_0_0_get_gpu_metri + metrics->Vcn1ActivityPercentage); + + gpu_metrics->average_socket_power = metrics->AverageSocketPower; +- gpu_metrics->energy_accumulator = metrics->EnergyAccumulator; ++ ++ if ((mp1_ver == IP_VERSION(13, 0, 0) && smu->smc_fw_version <= 0x004e1e00) || ++ (mp1_ver == IP_VERSION(13, 0, 10) && smu->smc_fw_version <= 0x00500800)) ++ gpu_metrics->energy_accumulator = metrics->EnergyAccumulator; ++ else ++ gpu_metrics->energy_accumulator = UINT_MAX; + + if (metrics->AverageGfxActivity <= SMU_13_0_0_BUSY_THRESHOLD) + gpu_metrics->average_gfxclk_frequency = metrics->AverageGfxclkFrequencyPostDs; +--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c ++++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +@@ -2043,7 +2043,8 @@ static ssize_t smu_v13_0_7_get_gpu_metri + metrics->Vcn1ActivityPercentage); + + gpu_metrics->average_socket_power = metrics->AverageSocketPower; +- gpu_metrics->energy_accumulator = metrics->EnergyAccumulator; ++ gpu_metrics->energy_accumulator = smu->smc_fw_version <= 0x00521400 ? ++ metrics->EnergyAccumulator : UINT_MAX; + + if (metrics->AverageGfxActivity <= SMU_13_0_7_BUSY_THRESHOLD) + gpu_metrics->average_gfxclk_frequency = metrics->AverageGfxclkFrequencyPostDs; diff --git a/queue-6.12/drm-amd-set-num-ip-blocks-to-0-if-discovery-fails.patch b/queue-6.12/drm-amd-set-num-ip-blocks-to-0-if-discovery-fails.patch new file mode 100644 index 0000000000..8627ebe342 --- /dev/null +++ b/queue-6.12/drm-amd-set-num-ip-blocks-to-0-if-discovery-fails.patch @@ -0,0 +1,53 @@ +From 3646ff28780b4c52c5b5081443199e7a430110e5 Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Tue, 10 Mar 2026 11:58:22 -0500 +Subject: drm/amd: Set num IP blocks to 0 if discovery fails + +From: Mario Limonciello + +commit 3646ff28780b4c52c5b5081443199e7a430110e5 upstream. + +If discovery has failed for any reason (such as no support for a block) +then there is no need to unwind all the IP blocks in fini. In this +condition there can actually be failures during the unwind too. + +Reset num_ip_blocks to zero during failure path and skip the unnecessary +cleanup path. + +Suggested-by: Lijo Lazar +Reviewed-by: Lijo Lazar +Signed-off-by: Mario Limonciello +Signed-off-by: Alex Deucher +(cherry picked from commit fae5984296b981c8cc3acca35b701c1f332a6cd8) +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 +++- + drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 +- + 2 files changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +@@ -2570,8 +2570,10 @@ static int amdgpu_device_ip_early_init(s + break; + default: + r = amdgpu_discovery_set_ip_blocks(adev); +- if (r) ++ if (r) { ++ adev->num_ip_blocks = 0; + return r; ++ } + break; + } + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +@@ -82,7 +82,7 @@ void amdgpu_driver_unload_kms(struct drm + { + struct amdgpu_device *adev = drm_to_adev(dev); + +- if (adev == NULL) ++ if (adev == NULL || !adev->num_ip_blocks) + return; + + amdgpu_unregister_gpu_instance(adev); diff --git a/queue-6.12/drm-amdgpu-fix-use-after-free-race-in-vm-acquire.patch b/queue-6.12/drm-amdgpu-fix-use-after-free-race-in-vm-acquire.patch new file mode 100644 index 0000000000..eb8a4e939f --- /dev/null +++ b/queue-6.12/drm-amdgpu-fix-use-after-free-race-in-vm-acquire.patch @@ -0,0 +1,45 @@ +From 2c1030f2e84885cc58bffef6af67d5b9d2e7098f Mon Sep 17 00:00:00 2001 +From: Alysa Liu +Date: Thu, 5 Feb 2026 11:21:45 -0500 +Subject: drm/amdgpu: Fix use-after-free race in VM acquire + +From: Alysa Liu + +commit 2c1030f2e84885cc58bffef6af67d5b9d2e7098f upstream. + +Replace non-atomic vm->process_info assignment with cmpxchg() +to prevent race when parent/child processes sharing a drm_file +both try to acquire the same VM after fork(). + +Reviewed-by: Harish Kasiviswanathan +Signed-off-by: Alysa Liu +Signed-off-by: Alex Deucher +(cherry picked from commit c7c573275ec20db05be769288a3e3bb2250ec618) +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +@@ -1403,7 +1403,10 @@ static int init_kfd_vm(struct amdgpu_vm + *process_info = info; + } + +- vm->process_info = *process_info; ++ if (cmpxchg(&vm->process_info, NULL, *process_info) != NULL) { ++ ret = -EINVAL; ++ goto already_acquired; ++ } + + /* Validate page directory and attach eviction fence */ + ret = amdgpu_bo_reserve(vm->root.bo, true); +@@ -1443,6 +1446,7 @@ validate_pd_fail: + amdgpu_bo_unreserve(vm->root.bo); + reserve_pd_fail: + vm->process_info = NULL; ++already_acquired: + if (info) { + dma_fence_put(&info->eviction_fence->base); + *process_info = NULL; diff --git a/queue-6.12/drm-bridge-ti-sn65dsi83-fix-cha_dsi_clk_range-rounding.patch b/queue-6.12/drm-bridge-ti-sn65dsi83-fix-cha_dsi_clk_range-rounding.patch new file mode 100644 index 0000000000..73d9641a93 --- /dev/null +++ b/queue-6.12/drm-bridge-ti-sn65dsi83-fix-cha_dsi_clk_range-rounding.patch @@ -0,0 +1,50 @@ +From 2f22702dc0fee06a240404e0f7ead5b789b253d8 Mon Sep 17 00:00:00 2001 +From: Luca Ceresoli +Date: Thu, 26 Feb 2026 17:16:44 +0100 +Subject: drm/bridge: ti-sn65dsi83: fix CHA_DSI_CLK_RANGE rounding + +From: Luca Ceresoli + +commit 2f22702dc0fee06a240404e0f7ead5b789b253d8 upstream. + +The DSI frequency must be in the range: + + (CHA_DSI_CLK_RANGE * 5 MHz) <= DSI freq < ((CHA_DSI_CLK_RANGE + 1) * 5 MHz) + +So the register value should point to the lower range value, but +DIV_ROUND_UP() rounds the division to the higher range value, resulting in +an excess of 1 (unless the frequency is an exact multiple of 5 MHz). + +For example for a 437100000 MHz clock CHA_DSI_CLK_RANGE should be 87 (0x57): + + (87 * 5 = 435) <= 437.1 < (88 * 5 = 440) + +but current code returns 88 (0x58). + +Fix the computation by removing the DIV_ROUND_UP(). + +Fixes: ceb515ba29ba ("drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver") +Cc: stable@vger.kernel.org +Reviewed-by: Marek Vasut +Link: https://patch.msgid.link/20260226-ti-sn65dsi83-dual-lvds-fixes-and-test-pattern-v1-1-2e15f5a9a6a0@bootlin.com +Signed-off-by: Luca Ceresoli +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/bridge/ti-sn65dsi83.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c ++++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c +@@ -303,9 +303,9 @@ static u8 sn65dsi83_get_dsi_range(struct + * DSI_CLK = mode clock * bpp / dsi_data_lanes / 2 + * the 2 is there because the bus is DDR. + */ +- return DIV_ROUND_UP(clamp((unsigned int)mode->clock * +- mipi_dsi_pixel_format_to_bpp(ctx->dsi->format) / +- ctx->dsi->lanes / 2, 40000U, 500000U), 5000U); ++ return clamp((unsigned int)mode->clock * ++ mipi_dsi_pixel_format_to_bpp(ctx->dsi->format) / ++ ctx->dsi->lanes / 2, 40000U, 500000U) / 5000U; + } + + static u8 sn65dsi83_get_dsi_div(struct sn65dsi83 *ctx) diff --git a/queue-6.12/drm-i915-fix-potential-overflow-of-shmem-scatterlist-length.patch b/queue-6.12/drm-i915-fix-potential-overflow-of-shmem-scatterlist-length.patch new file mode 100644 index 0000000000..33fefeb585 --- /dev/null +++ b/queue-6.12/drm-i915-fix-potential-overflow-of-shmem-scatterlist-length.patch @@ -0,0 +1,91 @@ +From 029ae067431ab9d0fca479bdabe780fa436706ea Mon Sep 17 00:00:00 2001 +From: Janusz Krzysztofik +Date: Tue, 24 Feb 2026 10:49:06 +0100 +Subject: drm/i915: Fix potential overflow of shmem scatterlist length + +From: Janusz Krzysztofik + +commit 029ae067431ab9d0fca479bdabe780fa436706ea upstream. + +When a scatterlists table of a GEM shmem object of size 4 GB or more is +populated with pages allocated from a folio, unsigned int .length +attribute of a scatterlist may get overflowed if total byte length of +pages allocated to that single scatterlist happens to reach or cross the +4GB limit. As a consequence, users of the object may suffer from hitting +unexpected, premature end of the object's backing pages. + +[278.780187] ------------[ cut here ]------------ +[278.780377] WARNING: CPU: 1 PID: 2326 at drivers/gpu/drm/i915/i915_mm.c:55 remap_sg+0x199/0x1d0 [i915] +... +[278.780654] CPU: 1 UID: 0 PID: 2326 Comm: gem_mmap_offset Tainted: G S U 6.17.0-rc1-CI_DRM_16981-ged823aaa0607+ #1 PREEMPT(voluntary) +[278.780656] Tainted: [S]=CPU_OUT_OF_SPEC, [U]=USER +[278.780658] Hardware name: Intel Corporation Meteor Lake Client Platform/MTL-P LP5x T3 RVP, BIOS MTLPFWI1.R00.3471.D91.2401310918 01/31/2024 +[278.780659] RIP: 0010:remap_sg+0x199/0x1d0 [i915] +... +[278.780786] Call Trace: +[278.780787] +[278.780788] ? __apply_to_page_range+0x3e6/0x910 +[278.780795] ? __pfx_remap_sg+0x10/0x10 [i915] +[278.780906] apply_to_page_range+0x14/0x30 +[278.780908] remap_io_sg+0x14d/0x260 [i915] +[278.781013] vm_fault_cpu+0xd2/0x330 [i915] +[278.781137] __do_fault+0x3a/0x1b0 +[278.781140] do_fault+0x322/0x640 +[278.781143] __handle_mm_fault+0x938/0xfd0 +[278.781150] handle_mm_fault+0x12c/0x300 +[278.781152] ? lock_mm_and_find_vma+0x4b/0x760 +[278.781155] do_user_addr_fault+0x2d6/0x8e0 +[278.781160] exc_page_fault+0x96/0x2c0 +[278.781165] asm_exc_page_fault+0x27/0x30 +... + +That issue was apprehended by the author of a change that introduced it, +and potential risk even annotated with a comment, but then never addressed. + +When adding folio pages to a scatterlist table, take care of byte length +of any single scatterlist not exceeding max_segment. + +Fixes: 0b62af28f249b ("i915: convert shmem_sg_free_table() to use a folio_batch") +Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/14809 +Cc: Matthew Wilcox (Oracle) +Cc: Andrew Morton +Cc: stable@vger.kernel.org # v6.5+ +Signed-off-by: Janusz Krzysztofik +Reviewed-by: Andi Shyti +Signed-off-by: Andi Shyti +Link: https://lore.kernel.org/r/20260224094944.2447913-2-janusz.krzysztofik@linux.intel.com +(cherry picked from commit 06249b4e691a75694c014a61708c007fb5755f60) +Signed-off-by: Tvrtko Ursulin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +--- a/drivers/gpu/drm/i915/gem/i915_gem_shmem.c ++++ b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c +@@ -151,8 +151,12 @@ int shmem_sg_alloc_table(struct drm_i915 + } + } while (1); + +- nr_pages = min_t(unsigned long, +- folio_nr_pages(folio), page_count - i); ++ nr_pages = min_array(((unsigned long[]) { ++ folio_nr_pages(folio), ++ page_count - i, ++ max_segment / PAGE_SIZE, ++ }), 3); ++ + if (!i || + sg->length >= max_segment || + folio_pfn(folio) != next_pfn) { +@@ -162,7 +166,9 @@ int shmem_sg_alloc_table(struct drm_i915 + st->nents++; + sg_set_folio(sg, folio, nr_pages * PAGE_SIZE, 0); + } else { +- /* XXX: could overflow? */ ++ nr_pages = min_t(unsigned long, nr_pages, ++ (max_segment - sg->length) / PAGE_SIZE); ++ + sg->length += nr_pages * PAGE_SIZE; + } + next_pfn = folio_pfn(folio) + nr_pages; diff --git a/queue-6.12/drm-msm-fix-dma_free_attrs-buffer-size.patch b/queue-6.12/drm-msm-fix-dma_free_attrs-buffer-size.patch new file mode 100644 index 0000000000..0defdd9836 --- /dev/null +++ b/queue-6.12/drm-msm-fix-dma_free_attrs-buffer-size.patch @@ -0,0 +1,38 @@ +From e4eb6e4dd6348dd00e19c2275e3fbaed304ca3bd Mon Sep 17 00:00:00 2001 +From: Thomas Fourier +Date: Thu, 26 Feb 2026 10:57:11 +0100 +Subject: drm/msm: Fix dma_free_attrs() buffer size + +From: Thomas Fourier + +commit e4eb6e4dd6348dd00e19c2275e3fbaed304ca3bd upstream. + +The gpummu->table buffer is alloc'd with size TABLE_SIZE + 32 in +a2xx_gpummu_new() but freed with size TABLE_SIZE in +a2xx_gpummu_destroy(). + +Change the free size to match the allocation. + +Fixes: c2052a4e5c99 ("drm/msm: implement a2xx mmu") +Cc: +Signed-off-by: Thomas Fourier +Reviewed-by: Dmitry Baryshkov +Patchwork: https://patchwork.freedesktop.org/patch/707340/ +Message-ID: <20260226095714.12126-2-fourier.thomas@gmail.com> +Signed-off-by: Rob Clark +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/msm/adreno/a2xx_gpummu.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/msm/adreno/a2xx_gpummu.c ++++ b/drivers/gpu/drm/msm/adreno/a2xx_gpummu.c +@@ -79,7 +79,7 @@ static void a2xx_gpummu_destroy(struct m + { + struct a2xx_gpummu *gpummu = to_a2xx_gpummu(mmu); + +- dma_free_attrs(mmu->dev, TABLE_SIZE, gpummu->table, gpummu->pt_base, ++ dma_free_attrs(mmu->dev, TABLE_SIZE + 32, gpummu->table, gpummu->pt_base, + DMA_ATTR_FORCE_CONTIGUOUS); + + kfree(gpummu); diff --git a/queue-6.12/iio-buffer-fix-wait_queue-not-being-removed.patch b/queue-6.12/iio-buffer-fix-wait_queue-not-being-removed.patch new file mode 100644 index 0000000000..d81f222c9e --- /dev/null +++ b/queue-6.12/iio-buffer-fix-wait_queue-not-being-removed.patch @@ -0,0 +1,41 @@ +From 064234044056c93a3719d6893e6e5a26a94a61b6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Nuno=20S=C3=A1?= +Date: Mon, 16 Feb 2026 13:24:27 +0000 +Subject: iio: buffer: Fix wait_queue not being removed +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Nuno Sá + +commit 064234044056c93a3719d6893e6e5a26a94a61b6 upstream. + +In the edge case where the IIO device is unregistered while we're +buffering, we were directly returning an error without removing the wait +queue. Instead, set 'ret' and break out of the loop. + +Fixes: 9eeee3b0bf19 ("iio: Add output buffer support") +Signed-off-by: Nuno Sá +Reviewed-by: David Lechner +Cc: +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/industrialio-buffer.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/iio/industrialio-buffer.c ++++ b/drivers/iio/industrialio-buffer.c +@@ -228,8 +228,10 @@ static ssize_t iio_buffer_write(struct f + written = 0; + add_wait_queue(&rb->pollq, &wait); + do { +- if (!indio_dev->info) +- return -ENODEV; ++ if (!indio_dev->info) { ++ ret = -ENODEV; ++ break; ++ } + + if (!iio_buffer_space_available(rb)) { + if (signal_pending(current)) { diff --git a/queue-6.12/iio-chemical-bme680-fix-measurement-wait-duration-calculation.patch b/queue-6.12/iio-chemical-bme680-fix-measurement-wait-duration-calculation.patch new file mode 100644 index 0000000000..63a0b7cd2b --- /dev/null +++ b/queue-6.12/iio-chemical-bme680-fix-measurement-wait-duration-calculation.patch @@ -0,0 +1,41 @@ +From f55b9510cd9437da3a0efa08b089caeb47595ff1 Mon Sep 17 00:00:00 2001 +From: Chris Spencer +Date: Thu, 5 Feb 2026 14:55:45 +0000 +Subject: iio: chemical: bme680: Fix measurement wait duration calculation + +From: Chris Spencer + +commit f55b9510cd9437da3a0efa08b089caeb47595ff1 upstream. + +This function refers to the Bosch BME680 API as the source of the +calculation, but one of the constants does not match the Bosch +implementation. This appears to be a simple transposition of two digits, +resulting in a wait time that is too short. This can cause the following +'device measurement cycle incomplete' check to occasionally fail, returning +EBUSY to user space. + +Adjust the constant to match the Bosch implementation and resolve the EBUSY +errors. + +Fixes: 4241665e6ea0 ("iio: chemical: bme680: Fix sensor data read operation") +Link: https://github.com/boschsensortec/BME68x_SensorAPI/blob/v4.4.8/bme68x.c#L521 +Signed-off-by: Chris Spencer +Acked-by: Vasileios Amoiridis +Cc: stable@vger.kernel.org +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/chemical/bme680_core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/iio/chemical/bme680_core.c ++++ b/drivers/iio/chemical/bme680_core.c +@@ -543,7 +543,7 @@ static int bme680_wait_for_eoc(struct bm + * + heater duration + */ + int wait_eoc_us = ((data->oversampling_temp + data->oversampling_press + +- data->oversampling_humid) * 1936) + (477 * 4) + ++ data->oversampling_humid) * 1963) + (477 * 4) + + (477 * 5) + 1000 + (data->heater_dur * 1000); + + usleep_range(wait_eoc_us, wait_eoc_us + 100); diff --git a/queue-6.12/iio-chemical-sps30_i2c-fix-buffer-size-in-sps30_i2c_read_meas.patch b/queue-6.12/iio-chemical-sps30_i2c-fix-buffer-size-in-sps30_i2c_read_meas.patch new file mode 100644 index 0000000000..50b420693d --- /dev/null +++ b/queue-6.12/iio-chemical-sps30_i2c-fix-buffer-size-in-sps30_i2c_read_meas.patch @@ -0,0 +1,35 @@ +From 216345f98cae7fcc84f49728c67478ac00321c87 Mon Sep 17 00:00:00 2001 +From: Antoniu Miclaus +Date: Thu, 12 Feb 2026 14:46:07 +0200 +Subject: iio: chemical: sps30_i2c: fix buffer size in sps30_i2c_read_meas() + +From: Antoniu Miclaus + +commit 216345f98cae7fcc84f49728c67478ac00321c87 upstream. + +sizeof(num) evaluates to sizeof(size_t) (8 bytes on 64-bit) instead +of the intended __be32 element size (4 bytes). Use sizeof(*meas) to +correctly match the buffer element type. + +Fixes: 8f3f13085278 ("iio: sps30: separate core and interface specific code") +Signed-off-by: Antoniu Miclaus +Acked-by: Tomasz Duszynski +Reviewed-by: Andy Shevchenko +Cc: +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/chemical/sps30_i2c.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/iio/chemical/sps30_i2c.c ++++ b/drivers/iio/chemical/sps30_i2c.c +@@ -171,7 +171,7 @@ static int sps30_i2c_read_meas(struct sp + if (!sps30_i2c_meas_ready(state)) + return -ETIMEDOUT; + +- return sps30_i2c_command(state, SPS30_I2C_READ_MEAS, NULL, 0, meas, sizeof(num) * num); ++ return sps30_i2c_command(state, SPS30_I2C_READ_MEAS, NULL, 0, meas, sizeof(*meas) * num); + } + + static int sps30_i2c_clean_fan(struct sps30_state *state) diff --git a/queue-6.12/iio-chemical-sps30_serial-fix-buffer-size-in-sps30_serial_read_meas.patch b/queue-6.12/iio-chemical-sps30_serial-fix-buffer-size-in-sps30_serial_read_meas.patch new file mode 100644 index 0000000000..0612261223 --- /dev/null +++ b/queue-6.12/iio-chemical-sps30_serial-fix-buffer-size-in-sps30_serial_read_meas.patch @@ -0,0 +1,36 @@ +From c3914ce1963c4db25e186112c90fa5d2361e9e0a Mon Sep 17 00:00:00 2001 +From: Antoniu Miclaus +Date: Thu, 12 Feb 2026 14:46:08 +0200 +Subject: iio: chemical: sps30_serial: fix buffer size in sps30_serial_read_meas() + +From: Antoniu Miclaus + +commit c3914ce1963c4db25e186112c90fa5d2361e9e0a upstream. + +sizeof(num) evaluates to sizeof(size_t) which is 8 bytes on 64-bit, +but the buffer elements are only 4 bytes. The same function already +uses sizeof(*meas) on line 312, making the mismatch evident. Use +sizeof(*meas) consistently. + +Fixes: b2e171f5a5c6 ("iio: sps30: add support for serial interface") +Signed-off-by: Antoniu Miclaus +Acked-by: Tomasz Duszynski +Reviewed-by: Andy Shevchenko +Cc: +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/chemical/sps30_serial.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/iio/chemical/sps30_serial.c ++++ b/drivers/iio/chemical/sps30_serial.c +@@ -303,7 +303,7 @@ static int sps30_serial_read_meas(struct + if (msleep_interruptible(1000)) + return -EINTR; + +- ret = sps30_serial_command(state, SPS30_SERIAL_READ_MEAS, NULL, 0, meas, num * sizeof(num)); ++ ret = sps30_serial_command(state, SPS30_SERIAL_READ_MEAS, NULL, 0, meas, num * sizeof(*meas)); + if (ret < 0) + return ret; + /* if measurements aren't ready sensor returns empty frame */ diff --git a/queue-6.12/iio-dac-ds4424-reject-128-raw-value.patch b/queue-6.12/iio-dac-ds4424-reject-128-raw-value.patch new file mode 100644 index 0000000000..cc82abbb5f --- /dev/null +++ b/queue-6.12/iio-dac-ds4424-reject-128-raw-value.patch @@ -0,0 +1,39 @@ +From 5187e03b817c26c1c3bcb2645a612ea935c4be89 Mon Sep 17 00:00:00 2001 +From: Oleksij Rempel +Date: Wed, 4 Feb 2026 15:00:33 +0100 +Subject: iio: dac: ds4424: reject -128 RAW value + +From: Oleksij Rempel + +commit 5187e03b817c26c1c3bcb2645a612ea935c4be89 upstream. + +The DS442x DAC uses sign-magnitude encoding, so -128 cannot be represented +in hardware (7-bit magnitude). + +Previously, passing -128 resulted in a truncated value that programmed +0mA (magnitude 0) instead of the expected maximum negative current, +effectively failing silently. + +Reject -128 to avoid producing the wrong current. + +Fixes: d632a2bd8ffc ("iio: dac: ds4422/ds4424 dac driver") +Cc: stable@vger.kernel.org +Signed-off-by: Oleksij Rempel +Reviewed-by: Andy Shevchenko +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/dac/ds4424.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/iio/dac/ds4424.c ++++ b/drivers/iio/dac/ds4424.c +@@ -141,7 +141,7 @@ static int ds4424_write_raw(struct iio_d + + switch (mask) { + case IIO_CHAN_INFO_RAW: +- if (val < S8_MIN || val > S8_MAX) ++ if (val <= S8_MIN || val > S8_MAX) + return -EINVAL; + + if (val > 0) { diff --git a/queue-6.12/iio-frequency-adf4377-fix-duplicated-soft-reset-mask.patch b/queue-6.12/iio-frequency-adf4377-fix-duplicated-soft-reset-mask.patch new file mode 100644 index 0000000000..89acb2d301 --- /dev/null +++ b/queue-6.12/iio-frequency-adf4377-fix-duplicated-soft-reset-mask.patch @@ -0,0 +1,39 @@ +From 6c8bf4b604a8a6346ca71f1c027fa01c2c2e04cb Mon Sep 17 00:00:00 2001 +From: SeungJu Cheon +Date: Sat, 24 Jan 2026 04:47:58 +0900 +Subject: iio: frequency: adf4377: Fix duplicated soft reset mask + +From: SeungJu Cheon + +commit 6c8bf4b604a8a6346ca71f1c027fa01c2c2e04cb upstream. + +The regmap_read_poll_timeout() uses ADF4377_0000_SOFT_RESET_R_MSK +twice instead of checking both SOFT_RESET_MSK (bit 0) and +SOFT_RESET_R_MSK (bit 7). This causes an incomplete reset status check. + +The code first sets both SOFT_RESET and SOFT_RESET_R bits to 1 via +regmap_update_bits(), then polls for them to be cleared. Since we set +both bits before polling, we should be waiting for both to clear. + +Fix by using both masks as done in regmap_update_bits() above. + +Fixes: eda549e2e524 ("iio: frequency: adf4377: add support for ADF4377") +Signed-off-by: SeungJu Cheon +Cc: Stable@vger.kernel.org +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/frequency/adf4377.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/iio/frequency/adf4377.c ++++ b/drivers/iio/frequency/adf4377.c +@@ -501,7 +501,7 @@ static int adf4377_soft_reset(struct adf + return ret; + + return regmap_read_poll_timeout(st->regmap, 0x0, read_val, +- !(read_val & (ADF4377_0000_SOFT_RESET_R_MSK | ++ !(read_val & (ADF4377_0000_SOFT_RESET_MSK | + ADF4377_0000_SOFT_RESET_R_MSK)), 200, 200 * 100); + } + diff --git a/queue-6.12/iio-gyro-mpu3050-core-fix-pm_runtime-error-handling.patch b/queue-6.12/iio-gyro-mpu3050-core-fix-pm_runtime-error-handling.patch new file mode 100644 index 0000000000..ce7a5cbee8 --- /dev/null +++ b/queue-6.12/iio-gyro-mpu3050-core-fix-pm_runtime-error-handling.patch @@ -0,0 +1,66 @@ +From acc3949aab3e8094641a9c7c2768de1958c88378 Mon Sep 17 00:00:00 2001 +From: Antoniu Miclaus +Date: Mon, 16 Feb 2026 11:57:56 +0200 +Subject: iio: gyro: mpu3050-core: fix pm_runtime error handling + +From: Antoniu Miclaus + +commit acc3949aab3e8094641a9c7c2768de1958c88378 upstream. + +The return value of pm_runtime_get_sync() is not checked, allowing +the driver to access hardware that may fail to resume. The device +usage count is also unconditionally incremented. Use +pm_runtime_resume_and_get() which propagates errors and avoids +incrementing the usage count on failure. + +In preenable, add pm_runtime_put_autosuspend() on set_8khz_samplerate() +failure since postdisable does not run when preenable fails. + +Fixes: 3904b28efb2c ("iio: gyro: Add driver for the MPU-3050 gyroscope") +Reviewed-by: Linus Walleij +Signed-off-by: Antoniu Miclaus +Cc: +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/gyro/mpu3050-core.c | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +--- a/drivers/iio/gyro/mpu3050-core.c ++++ b/drivers/iio/gyro/mpu3050-core.c +@@ -322,7 +322,9 @@ static int mpu3050_read_raw(struct iio_d + } + case IIO_CHAN_INFO_RAW: + /* Resume device */ +- pm_runtime_get_sync(mpu3050->dev); ++ ret = pm_runtime_resume_and_get(mpu3050->dev); ++ if (ret) ++ return ret; + mutex_lock(&mpu3050->lock); + + ret = mpu3050_set_8khz_samplerate(mpu3050); +@@ -648,14 +650,20 @@ out_trigger_unlock: + static int mpu3050_buffer_preenable(struct iio_dev *indio_dev) + { + struct mpu3050 *mpu3050 = iio_priv(indio_dev); ++ int ret; + +- pm_runtime_get_sync(mpu3050->dev); ++ ret = pm_runtime_resume_and_get(mpu3050->dev); ++ if (ret) ++ return ret; + + /* Unless we have OUR trigger active, run at full speed */ +- if (!mpu3050->hw_irq_trigger) +- return mpu3050_set_8khz_samplerate(mpu3050); ++ if (!mpu3050->hw_irq_trigger) { ++ ret = mpu3050_set_8khz_samplerate(mpu3050); ++ if (ret) ++ pm_runtime_put_autosuspend(mpu3050->dev); ++ } + +- return 0; ++ return ret; + } + + static int mpu3050_buffer_postdisable(struct iio_dev *indio_dev) diff --git a/queue-6.12/iio-gyro-mpu3050-i2c-fix-pm_runtime-error-handling.patch b/queue-6.12/iio-gyro-mpu3050-i2c-fix-pm_runtime-error-handling.patch new file mode 100644 index 0000000000..c3a4dad030 --- /dev/null +++ b/queue-6.12/iio-gyro-mpu3050-i2c-fix-pm_runtime-error-handling.patch @@ -0,0 +1,37 @@ +From 91f950b4cbb1aa9ea4eb3999f1463e8044b717fb Mon Sep 17 00:00:00 2001 +From: Antoniu Miclaus +Date: Mon, 16 Feb 2026 11:57:55 +0200 +Subject: iio: gyro: mpu3050-i2c: fix pm_runtime error handling + +From: Antoniu Miclaus + +commit 91f950b4cbb1aa9ea4eb3999f1463e8044b717fb upstream. + +The return value of pm_runtime_get_sync() is not checked, and the +function always returns success. This allows I2C mux operations to +proceed even when the device fails to resume. + +Use pm_runtime_resume_and_get() and propagate its return value to +properly handle resume failures. + +Fixes: 3904b28efb2c ("iio: gyro: Add driver for the MPU-3050 gyroscope") +Signed-off-by: Antoniu Miclaus +Cc: +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/gyro/mpu3050-i2c.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/iio/gyro/mpu3050-i2c.c ++++ b/drivers/iio/gyro/mpu3050-i2c.c +@@ -19,8 +19,7 @@ static int mpu3050_i2c_bypass_select(str + struct mpu3050 *mpu3050 = i2c_mux_priv(mux); + + /* Just power up the device, that is all that is needed */ +- pm_runtime_get_sync(mpu3050->dev); +- return 0; ++ return pm_runtime_resume_and_get(mpu3050->dev); + } + + static int mpu3050_i2c_bypass_deselect(struct i2c_mux_core *mux, u32 chan_id) diff --git a/queue-6.12/iio-imu-inv_icm42600-fix-odr-switch-to-the-same-value.patch b/queue-6.12/iio-imu-inv_icm42600-fix-odr-switch-to-the-same-value.patch new file mode 100644 index 0000000000..bf6810bcf7 --- /dev/null +++ b/queue-6.12/iio-imu-inv_icm42600-fix-odr-switch-to-the-same-value.patch @@ -0,0 +1,49 @@ +From c9f3a593137d862d424130343e77d4b5260a4f5a Mon Sep 17 00:00:00 2001 +From: Jean-Baptiste Maneyrol +Date: Fri, 30 Jan 2026 16:38:47 +0100 +Subject: iio: imu: inv_icm42600: fix odr switch to the same value + +From: Jean-Baptiste Maneyrol + +commit c9f3a593137d862d424130343e77d4b5260a4f5a upstream. + +ODR switch is done in 2 steps when FIFO is on : change the ODR register +value and acknowledge change when reading the FIFO ODR change flag. +When we are switching to the same odr value, we end up waiting for a +FIFO ODR flag that is never happening. + +Fix the issue by doing nothing and exiting properly when we are +switching to the same ODR value. + +Fixes: ec74ae9fd37c ("iio: imu: inv_icm42600: add accurate timestamping") +Signed-off-by: Jean-Baptiste Maneyrol +Cc: stable@vger.kernel.org +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c | 2 ++ + drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c | 2 ++ + 2 files changed, 4 insertions(+) + +--- a/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c ++++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c +@@ -454,6 +454,8 @@ static int inv_icm42600_accel_write_odr( + return -EINVAL; + + conf.odr = inv_icm42600_accel_odr_conv[idx / 2]; ++ if (conf.odr == st->conf.accel.odr) ++ return 0; + + pm_runtime_get_sync(dev); + mutex_lock(&st->lock); +--- a/drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c ++++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c +@@ -361,6 +361,8 @@ static int inv_icm42600_gyro_write_odr(s + return -EINVAL; + + conf.odr = inv_icm42600_gyro_odr_conv[idx / 2]; ++ if (conf.odr == st->conf.gyro.odr) ++ return 0; + + pm_runtime_get_sync(dev); + mutex_lock(&st->lock); diff --git a/queue-6.12/iio-imu-inv_icm42600-fix-odr-switch-when-turning-buffer-off.patch b/queue-6.12/iio-imu-inv_icm42600-fix-odr-switch-when-turning-buffer-off.patch new file mode 100644 index 0000000000..9d3cb61244 --- /dev/null +++ b/queue-6.12/iio-imu-inv_icm42600-fix-odr-switch-when-turning-buffer-off.patch @@ -0,0 +1,46 @@ +From ffd32db8263d2d785a2c419486a450dc80693235 Mon Sep 17 00:00:00 2001 +From: Jean-Baptiste Maneyrol +Date: Fri, 30 Jan 2026 17:10:23 +0100 +Subject: iio: imu: inv_icm42600: fix odr switch when turning buffer off + +From: Jean-Baptiste Maneyrol + +commit ffd32db8263d2d785a2c419486a450dc80693235 upstream. + +ODR switch is done in 2 steps when FIFO is on : change the ODR register +value and acknowledge change when reading the FIFO ODR change flag. +When we are switching odr and turning buffer off just afterward, we are +losing the FIFO ODR change flag and ODR switch is blocked. + +Fix the issue by force applying any waiting ODR change when turning +buffer off. + +Fixes: ec74ae9fd37c ("iio: imu: inv_icm42600: add accurate timestamping") +Signed-off-by: Jean-Baptiste Maneyrol +Cc: stable@vger.kernel.org +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c ++++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c +@@ -389,6 +389,8 @@ out_unlock: + static int inv_icm42600_buffer_postdisable(struct iio_dev *indio_dev) + { + struct inv_icm42600_state *st = iio_device_get_drvdata(indio_dev); ++ struct inv_icm42600_sensor_state *sensor_st = iio_priv(indio_dev); ++ struct inv_sensors_timestamp *ts = &sensor_st->ts; + struct device *dev = regmap_get_device(st->map); + unsigned int sensor; + unsigned int *watermark; +@@ -410,6 +412,8 @@ static int inv_icm42600_buffer_postdisab + + mutex_lock(&st->lock); + ++ inv_sensors_timestamp_apply_odr(ts, 0, 0, 0); ++ + ret = inv_icm42600_buffer_set_fifo_en(st, st->fifo.en & ~sensor); + if (ret) + goto out_unlock; diff --git a/queue-6.12/iio-potentiometer-mcp4131-fix-double-application-of-wiper-shift.patch b/queue-6.12/iio-potentiometer-mcp4131-fix-double-application-of-wiper-shift.patch new file mode 100644 index 0000000000..8fd5d29095 --- /dev/null +++ b/queue-6.12/iio-potentiometer-mcp4131-fix-double-application-of-wiper-shift.patch @@ -0,0 +1,40 @@ +From 85e4614524dca6c0a43874f475a17de2b9725648 Mon Sep 17 00:00:00 2001 +From: Lukas Schmid +Date: Mon, 2 Feb 2026 21:15:35 +0100 +Subject: iio: potentiometer: mcp4131: fix double application of wiper shift + +From: Lukas Schmid + +commit 85e4614524dca6c0a43874f475a17de2b9725648 upstream. + +The MCP4131 wiper address is shifted twice when preparing the SPI +command in mcp4131_write_raw(). + +The address is already shifted when assigned to the local variable +"address", but is then shifted again when written to data->buf[0]. +This results in an incorrect command being sent to the device and +breaks wiper writes to the second channel. + +Remove the second shift and use the pre-shifted address directly +when composing the SPI transfer. + +Fixes: 22d199a53910 ("iio: potentiometer: add driver for Microchip MCP413X/414X/415X/416X/423X/424X/425X/426X") +Signed-off-by: Lukas Schmid # +Cc: +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/potentiometer/mcp4131.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/iio/potentiometer/mcp4131.c ++++ b/drivers/iio/potentiometer/mcp4131.c +@@ -222,7 +222,7 @@ static int mcp4131_write_raw(struct iio_ + + mutex_lock(&data->lock); + +- data->buf[0] = address << MCP4131_WIPER_SHIFT; ++ data->buf[0] = address; + data->buf[0] |= MCP4131_WRITE | (val >> 8); + data->buf[1] = val & 0xFF; /* 8 bits here */ + diff --git a/queue-6.12/iio-proximity-hx9023s-protect-against-division-by-zero-in-set_samp_freq.patch b/queue-6.12/iio-proximity-hx9023s-protect-against-division-by-zero-in-set_samp_freq.patch new file mode 100644 index 0000000000..0336ebc1e9 --- /dev/null +++ b/queue-6.12/iio-proximity-hx9023s-protect-against-division-by-zero-in-set_samp_freq.patch @@ -0,0 +1,33 @@ +From a318cfc0853706f1d6ce682dba660bc455d674ef Mon Sep 17 00:00:00 2001 +From: Yasin Lee +Date: Fri, 13 Feb 2026 23:14:44 +0800 +Subject: iio: proximity: hx9023s: Protect against division by zero in set_samp_freq + +From: Yasin Lee + +commit a318cfc0853706f1d6ce682dba660bc455d674ef upstream. + +Avoid division by zero when sampling frequency is unspecified. + +Fixes: 60df548277b7 ("iio: proximity: Add driver support for TYHX's HX9023S capacitive proximity sensor") +Signed-off-by: Yasin Lee +Reviewed-by: Andy Shevchenko +Cc: +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/proximity/hx9023s.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/iio/proximity/hx9023s.c ++++ b/drivers/iio/proximity/hx9023s.c +@@ -708,6 +708,9 @@ static int hx9023s_set_samp_freq(struct + struct device *dev = regmap_get_device(data->regmap); + unsigned int i, period_ms; + ++ if (!val && !val2) ++ return -EINVAL; ++ + period_ms = div_u64(NANO, (val * MEGA + val2)); + + for (i = 0; i < ARRAY_SIZE(hx9023s_samp_freq_table); i++) { diff --git a/queue-6.12/lib-bootconfig-check-bounds-before-writing-in-__xbc_open_brace.patch b/queue-6.12/lib-bootconfig-check-bounds-before-writing-in-__xbc_open_brace.patch new file mode 100644 index 0000000000..46ce281f01 --- /dev/null +++ b/queue-6.12/lib-bootconfig-check-bounds-before-writing-in-__xbc_open_brace.patch @@ -0,0 +1,42 @@ +From 560f763baa0f2c9a44da4294c06af071405ac46f Mon Sep 17 00:00:00 2001 +From: Josh Law +Date: Thu, 12 Mar 2026 19:11:42 +0000 +Subject: lib/bootconfig: check bounds before writing in __xbc_open_brace() + +From: Josh Law + +commit 560f763baa0f2c9a44da4294c06af071405ac46f upstream. + +The bounds check for brace_index happens after the array write. +While the current call pattern prevents an actual out-of-bounds +access (the previous call would have returned an error), the +write-before-check pattern is fragile and would become a real +out-of-bounds write if the error return were ever not propagated. + +Move the bounds check before the array write so the function is +self-contained and safe regardless of caller behavior. + +Link: https://lore.kernel.org/all/20260312191143.28719-3-objecting@objecting.org/ + +Fixes: ead1e19ad905 ("lib/bootconfig: Fix a bug of breaking existing tree nodes") +Cc: stable@vger.kernel.org +Signed-off-by: Josh Law +Signed-off-by: Masami Hiramatsu (Google) +Signed-off-by: Greg Kroah-Hartman +--- + lib/bootconfig.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/lib/bootconfig.c ++++ b/lib/bootconfig.c +@@ -532,9 +532,9 @@ static char *skip_spaces_until_newline(c + static int __init __xbc_open_brace(char *p) + { + /* Push the last key as open brace */ +- open_brace[brace_index++] = xbc_node_index(last_parent); + if (brace_index >= XBC_DEPTH_MAX) + return xbc_parse_error("Exceed max depth of braces", p); ++ open_brace[brace_index++] = xbc_node_index(last_parent); + + return 0; + } diff --git a/queue-6.12/lib-bootconfig-fix-off-by-one-in-xbc_verify_tree-unclosed-brace-error.patch b/queue-6.12/lib-bootconfig-fix-off-by-one-in-xbc_verify_tree-unclosed-brace-error.patch new file mode 100644 index 0000000000..406f95c9f9 --- /dev/null +++ b/queue-6.12/lib-bootconfig-fix-off-by-one-in-xbc_verify_tree-unclosed-brace-error.patch @@ -0,0 +1,43 @@ +From 39ebc8d7f561e1b64eca87353ef9b18e2825e591 Mon Sep 17 00:00:00 2001 +From: Josh Law +Date: Thu, 12 Mar 2026 19:11:41 +0000 +Subject: lib/bootconfig: fix off-by-one in xbc_verify_tree() unclosed brace error + +From: Josh Law + +commit 39ebc8d7f561e1b64eca87353ef9b18e2825e591 upstream. + +__xbc_open_brace() pushes entries with post-increment +(open_brace[brace_index++]), so brace_index always points one past +the last valid entry. xbc_verify_tree() reads open_brace[brace_index] +to report which brace is unclosed, but this is one past the last +pushed entry and contains stale/zero data, causing the error message +to reference the wrong node. + +Use open_brace[brace_index - 1] to correctly identify the unclosed +brace. brace_index is known to be > 0 here since we are inside the +if (brace_index) guard. + +Link: https://lore.kernel.org/all/20260312191143.28719-2-objecting@objecting.org/ + +Fixes: ead1e19ad905 ("lib/bootconfig: Fix a bug of breaking existing tree nodes") +Cc: stable@vger.kernel.org +Signed-off-by: Josh Law +Reviewed-by: Steven Rostedt (Google) +Signed-off-by: Masami Hiramatsu (Google) +Signed-off-by: Greg Kroah-Hartman +--- + lib/bootconfig.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/lib/bootconfig.c ++++ b/lib/bootconfig.c +@@ -791,7 +791,7 @@ static int __init xbc_verify_tree(void) + + /* Brace closing */ + if (brace_index) { +- n = &xbc_nodes[open_brace[brace_index]]; ++ n = &xbc_nodes[open_brace[brace_index - 1]]; + return xbc_parse_error("Brace is not closed", + xbc_node_get_data(n)); + } diff --git a/queue-6.12/lib-bootconfig-fix-snprintf-truncation-check-in-xbc_node_compose_key_after.patch b/queue-6.12/lib-bootconfig-fix-snprintf-truncation-check-in-xbc_node_compose_key_after.patch new file mode 100644 index 0000000000..4ddd6efb08 --- /dev/null +++ b/queue-6.12/lib-bootconfig-fix-snprintf-truncation-check-in-xbc_node_compose_key_after.patch @@ -0,0 +1,40 @@ +From 1120a36bb1e9b9e22de75ecb4ef0b998f73a97f1 Mon Sep 17 00:00:00 2001 +From: Josh Law +Date: Thu, 12 Mar 2026 19:11:43 +0000 +Subject: lib/bootconfig: fix snprintf truncation check in xbc_node_compose_key_after() + +From: Josh Law + +commit 1120a36bb1e9b9e22de75ecb4ef0b998f73a97f1 upstream. + +snprintf() returns the number of characters that would have been +written excluding the NUL terminator. Output is truncated when the +return value is >= the buffer size, not just > the buffer size. + +When ret == size, the current code takes the non-truncated path, +advancing buf by ret and reducing size to 0. This is wrong because +the output was actually truncated (the last character was replaced by +NUL). Fix by using >= so the truncation path is taken correctly. + +Link: https://lore.kernel.org/all/20260312191143.28719-4-objecting@objecting.org/ + +Fixes: 76db5a27a827 ("bootconfig: Add Extra Boot Config support") +Cc: stable@vger.kernel.org +Signed-off-by: Josh Law +Signed-off-by: Masami Hiramatsu (Google) +Signed-off-by: Greg Kroah-Hartman +--- + lib/bootconfig.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/lib/bootconfig.c ++++ b/lib/bootconfig.c +@@ -316,7 +316,7 @@ int __init xbc_node_compose_key_after(st + depth ? "." : ""); + if (ret < 0) + return ret; +- if (ret > size) { ++ if (ret >= size) { + size = 0; + } else { + size -= ret; diff --git a/queue-6.12/qmi_wwan-allow-max_mtu-above-hard_mtu-to-control-rx_urb_size.patch b/queue-6.12/qmi_wwan-allow-max_mtu-above-hard_mtu-to-control-rx_urb_size.patch new file mode 100644 index 0000000000..279ad4291f --- /dev/null +++ b/queue-6.12/qmi_wwan-allow-max_mtu-above-hard_mtu-to-control-rx_urb_size.patch @@ -0,0 +1,90 @@ +From 55f854dd5bdd8e19b936a00ef1f8d776ac32c7b0 Mon Sep 17 00:00:00 2001 +From: Laurent Vivier +Date: Wed, 4 Mar 2026 14:43:38 +0100 +Subject: qmi_wwan: allow max_mtu above hard_mtu to control rx_urb_size + +From: Laurent Vivier + +commit 55f854dd5bdd8e19b936a00ef1f8d776ac32c7b0 upstream. + +Commit c7159e960f14 ("usbnet: limit max_mtu based on device's hard_mtu") +capped net->max_mtu to the device's hard_mtu in usbnet_probe(). While +this correctly prevents oversized packets on standard USB network +devices, it breaks the qmi_wwan driver. + +qmi_wwan relies on userspace (e.g. ModemManager) setting a large MTU on +the wwan0 interface to configure rx_urb_size via usbnet_change_mtu(). +QMI modems negotiate USB transfer sizes of 16,383 or 32,767 bytes, and +the USB receive buffers must be sized accordingly. With max_mtu capped +to hard_mtu (~1500 bytes), userspace can no longer raise the MTU, the +receive buffers remain small, and download speeds drop from >300 Mbps +to ~0.8 Mbps. + +Introduce a FLAG_NOMAXMTU driver flag that allows individual usbnet +drivers to opt out of the max_mtu cap. Set this flag in qmi_wwan's +driver_info structures to restore the previous behavior for QMI devices, +while keeping the safety fix in place for all other usbnet drivers. + +Fixes: c7159e960f14 ("usbnet: limit max_mtu based on device's hard_mtu") +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/lkml/CAPh3n803k8JcBPV5qEzUB-oKzWkAs-D5CU7z=Vd_nLRCr5ZqQg@mail.gmail.com/ +Reported-by: Koen Vandeputte +Tested-by: Daniele Palmas +Signed-off-by: Laurent Vivier +Link: https://patch.msgid.link/20260304134338.1785002-1-lvivier@redhat.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/usb/qmi_wwan.c | 4 ++-- + drivers/net/usb/usbnet.c | 7 ++++--- + include/linux/usb/usbnet.h | 1 + + 3 files changed, 7 insertions(+), 5 deletions(-) + +--- a/drivers/net/usb/qmi_wwan.c ++++ b/drivers/net/usb/qmi_wwan.c +@@ -928,7 +928,7 @@ err: + + static const struct driver_info qmi_wwan_info = { + .description = "WWAN/QMI device", +- .flags = FLAG_WWAN | FLAG_SEND_ZLP, ++ .flags = FLAG_WWAN | FLAG_NOMAXMTU | FLAG_SEND_ZLP, + .bind = qmi_wwan_bind, + .unbind = qmi_wwan_unbind, + .manage_power = qmi_wwan_manage_power, +@@ -937,7 +937,7 @@ static const struct driver_info qmi_wwan + + static const struct driver_info qmi_wwan_info_quirk_dtr = { + .description = "WWAN/QMI device", +- .flags = FLAG_WWAN | FLAG_SEND_ZLP, ++ .flags = FLAG_WWAN | FLAG_NOMAXMTU | FLAG_SEND_ZLP, + .bind = qmi_wwan_bind, + .unbind = qmi_wwan_unbind, + .manage_power = qmi_wwan_manage_power, +--- a/drivers/net/usb/usbnet.c ++++ b/drivers/net/usb/usbnet.c +@@ -1797,11 +1797,12 @@ usbnet_probe (struct usb_interface *udev + if ((dev->driver_info->flags & FLAG_NOARP) != 0) + net->flags |= IFF_NOARP; + +- if (net->max_mtu > (dev->hard_mtu - net->hard_header_len)) ++ if ((dev->driver_info->flags & FLAG_NOMAXMTU) == 0 && ++ net->max_mtu > (dev->hard_mtu - net->hard_header_len)) + net->max_mtu = dev->hard_mtu - net->hard_header_len; + +- if (net->mtu > net->max_mtu) +- net->mtu = net->max_mtu; ++ if (net->mtu > (dev->hard_mtu - net->hard_header_len)) ++ net->mtu = dev->hard_mtu - net->hard_header_len; + + } else if (!info->in || !info->out) + status = usbnet_get_endpoints (dev, udev); +--- a/include/linux/usb/usbnet.h ++++ b/include/linux/usb/usbnet.h +@@ -130,6 +130,7 @@ struct driver_info { + #define FLAG_MULTI_PACKET 0x2000 + #define FLAG_RX_ASSEMBLE 0x4000 /* rx packets may span >1 frames */ + #define FLAG_NOARP 0x8000 /* device can't do ARP */ ++#define FLAG_NOMAXMTU 0x10000 /* allow max_mtu above hard_mtu */ + + /* init device ... can sleep, or cause probe() failure */ + int (*bind)(struct usbnet *, struct usb_interface *); diff --git a/queue-6.12/s390-dasd-copy-detected-format-information-to-secondary-device.patch b/queue-6.12/s390-dasd-copy-detected-format-information-to-secondary-device.patch new file mode 100644 index 0000000000..7e84260b03 --- /dev/null +++ b/queue-6.12/s390-dasd-copy-detected-format-information-to-secondary-device.patch @@ -0,0 +1,74 @@ +From 4c527c7e030672efd788d0806d7a68972a7ba3c1 Mon Sep 17 00:00:00 2001 +From: Stefan Haberland +Date: Tue, 10 Mar 2026 15:23:30 +0100 +Subject: s390/dasd: Copy detected format information to secondary device + +From: Stefan Haberland + +commit 4c527c7e030672efd788d0806d7a68972a7ba3c1 upstream. + +During online processing for a DASD device an IO operation is started to +determine the format of the device. CDL format contains specifically +sized blocks at the beginning of the disk. + +For a PPRC secondary device no real IO operation is possible therefore +this IO request can not be started and this step is skipped for online +processing of secondary devices. This is generally fine since the +secondary is a copy of the primary device. + +In case of an additional partition detection that is run after a swap +operation the format information is needed to properly drive partition +detection IO. + +Currently the information is not passed leading to IO errors during +partition detection and a wrongly detected partition table which in turn +might lead to data corruption on the disk with the wrong partition table. + +Fix by passing the format information from primary to secondary device. + +Fixes: 413862caad6f ("s390/dasd: add copy pair swap capability") +Cc: stable@vger.kernel.org #6.1 +Reviewed-by: Jan Hoeppner +Acked-by: Eduard Shishkin +Signed-off-by: Stefan Haberland +Link: https://patch.msgid.link/20260310142330.4080106-3-sth@linux.ibm.com +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + drivers/s390/block/dasd_eckd.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/drivers/s390/block/dasd_eckd.c ++++ b/drivers/s390/block/dasd_eckd.c +@@ -6145,6 +6145,7 @@ static void copy_pair_set_active(struct + static int dasd_eckd_copy_pair_swap(struct dasd_device *device, char *prim_busid, + char *sec_busid) + { ++ struct dasd_eckd_private *prim_priv, *sec_priv; + struct dasd_device *primary, *secondary; + struct dasd_copy_relation *copy; + struct dasd_block *block; +@@ -6165,6 +6166,9 @@ static int dasd_eckd_copy_pair_swap(stru + if (!secondary) + return DASD_COPYPAIRSWAP_SECONDARY; + ++ prim_priv = primary->private; ++ sec_priv = secondary->private; ++ + /* + * usually the device should be quiesced for swap + * for paranoia stop device and requeue requests again +@@ -6197,6 +6201,13 @@ static int dasd_eckd_copy_pair_swap(stru + dasd_device_remove_stop_bits(primary, DASD_STOPPED_QUIESCE); + } + ++ /* ++ * The secondary device never got through format detection, but since it ++ * is a copy of the primary device, the format is exactly the same; ++ * therefore, the detected layout can simply be copied. ++ */ ++ sec_priv->uses_cdl = prim_priv->uses_cdl; ++ + /* re-enable device */ + dasd_device_remove_stop_bits(primary, DASD_STOPPED_PPRC); + dasd_device_remove_stop_bits(secondary, DASD_STOPPED_PPRC); diff --git a/queue-6.12/s390-dasd-move-quiesce-state-with-pprc-swap.patch b/queue-6.12/s390-dasd-move-quiesce-state-with-pprc-swap.patch new file mode 100644 index 0000000000..347f99823f --- /dev/null +++ b/queue-6.12/s390-dasd-move-quiesce-state-with-pprc-swap.patch @@ -0,0 +1,46 @@ +From 40e9cd4ae8ec43b107ed2bff422a8fa39dcf4e4b Mon Sep 17 00:00:00 2001 +From: Stefan Haberland +Date: Tue, 10 Mar 2026 15:23:29 +0100 +Subject: s390/dasd: Move quiesce state with pprc swap + +From: Stefan Haberland + +commit 40e9cd4ae8ec43b107ed2bff422a8fa39dcf4e4b upstream. + +Quiesce and resume is a mechanism to suspend operations on DASD devices. +In the context of a controlled copy pair swap operation, the quiesce +operation is usually issued before the actual swap and a resume +afterwards. + +During the swap operation, the underlying device is exchanged. Therefore, +the quiesce flag must be moved to the secondary device to ensure a +consistent quiesce state after the swap. + +The secondary device itself cannot be suspended separately because there +is no separate block device representation for it. + +Fixes: 413862caad6f ("s390/dasd: add copy pair swap capability") +Cc: stable@vger.kernel.org #6.1 +Reviewed-by: Jan Hoeppner +Signed-off-by: Stefan Haberland +Link: https://patch.msgid.link/20260310142330.4080106-2-sth@linux.ibm.com +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + drivers/s390/block/dasd_eckd.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/s390/block/dasd_eckd.c ++++ b/drivers/s390/block/dasd_eckd.c +@@ -6192,6 +6192,11 @@ static int dasd_eckd_copy_pair_swap(stru + dev_name(&secondary->cdev->dev), rc); + } + ++ if (primary->stopped & DASD_STOPPED_QUIESCE) { ++ dasd_device_set_stop_bits(secondary, DASD_STOPPED_QUIESCE); ++ dasd_device_remove_stop_bits(primary, DASD_STOPPED_QUIESCE); ++ } ++ + /* re-enable device */ + dasd_device_remove_stop_bits(primary, DASD_STOPPED_PPRC); + dasd_device_remove_stop_bits(secondary, DASD_STOPPED_PPRC); diff --git a/queue-6.12/scsi-core-fix-error-handling-for-scsi_alloc_sdev.patch b/queue-6.12/scsi-core-fix-error-handling-for-scsi_alloc_sdev.patch new file mode 100644 index 0000000000..349887f3d1 --- /dev/null +++ b/queue-6.12/scsi-core-fix-error-handling-for-scsi_alloc_sdev.patch @@ -0,0 +1,41 @@ +From 4ce7ada40c008fa21b7e52ab9d04e8746e2e9325 Mon Sep 17 00:00:00 2001 +From: Junxiao Bi +Date: Wed, 4 Mar 2026 08:46:03 -0800 +Subject: scsi: core: Fix error handling for scsi_alloc_sdev() + +From: Junxiao Bi + +commit 4ce7ada40c008fa21b7e52ab9d04e8746e2e9325 upstream. + +After scsi_sysfs_device_initialize() was called, error paths must call +__scsi_remove_device(). + +Fixes: 1ac22c8eae81 ("scsi: core: Fix refcount leak for tagset_refcnt") +Cc: stable@vger.kernel.org +Signed-off-by: Junxiao Bi +Reviewed-by: John Garry +Reviewed-by: Bart Van Assche +Link: https://patch.msgid.link/20260304164603.51528-1-junxiao.bi@oracle.com +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/scsi_scan.c | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +--- a/drivers/scsi/scsi_scan.c ++++ b/drivers/scsi/scsi_scan.c +@@ -353,12 +353,8 @@ static struct scsi_device *scsi_alloc_sd + * default device queue depth to figure out sbitmap shift + * since we use this queue depth most of times. + */ +- if (scsi_realloc_sdev_budget_map(sdev, depth)) { +- kref_put(&sdev->host->tagset_refcnt, scsi_mq_free_tags); +- put_device(&starget->dev); +- kfree(sdev); +- goto out; +- } ++ if (scsi_realloc_sdev_budget_map(sdev, depth)) ++ goto out_device_destroy; + + scsi_change_queue_depth(sdev, depth); + diff --git a/queue-6.12/series b/queue-6.12/series index 081e962415..16cbe26bcd 100644 --- a/queue-6.12/series +++ b/queue-6.12/series @@ -174,3 +174,41 @@ net-nexthop-fix-percpu-use-after-free-in-remove_nh_grp_entry.patch net-ncsi-fix-skb-leak-in-error-paths.patch net-ethernet-arc-emac-quiesce-interrupts-before-requesting-irq.patch net-dsa-microchip-fix-error-path-in-ptp-irq-setup.patch +drm-amd-pm-remove-invalid-gpu_metrics.energy_accumulator-on-smu-v13.0.x.patch +drm-amdgpu-fix-use-after-free-race-in-vm-acquire.patch +drm-amd-set-num-ip-blocks-to-0-if-discovery-fails.patch +drm-bridge-ti-sn65dsi83-fix-cha_dsi_clk_range-rounding.patch +drm-i915-fix-potential-overflow-of-shmem-scatterlist-length.patch +drm-msm-fix-dma_free_attrs-buffer-size.patch +tracing-fix-enabling-multiple-events-on-the-kernel-command-line-and-bootconfig.patch +tracing-fix-trace_buf_size-cmdline-parameter-with-sizes-2g.patch +qmi_wwan-allow-max_mtu-above-hard_mtu-to-control-rx_urb_size.patch +cifs-make-default-value-of-retrans-as-zero.patch +xfs-fix-returned-valued-from-xfs_defer_can_append.patch +xfs-fix-undersized-l_iclog_roundoff-values.patch +xfs-ensure-dquot-item-is-deleted-from-ail-only-after-log-shutdown.patch +s390-dasd-move-quiesce-state-with-pprc-swap.patch +s390-dasd-copy-detected-format-information-to-secondary-device.patch +lib-bootconfig-fix-off-by-one-in-xbc_verify_tree-unclosed-brace-error.patch +scsi-core-fix-error-handling-for-scsi_alloc_sdev.patch +x86-apic-disable-x2apic-on-resume-if-the-kernel-expects-so.patch +lib-bootconfig-fix-snprintf-truncation-check-in-xbc_node_compose_key_after.patch +lib-bootconfig-check-bounds-before-writing-in-__xbc_open_brace.patch +smb-client-fix-atomic-open-with-o_direct-o_sync.patch +smb-client-fix-in-place-encryption-corruption-in-smb2_write.patch +smb-client-fix-iface-port-assignment-in-parse_server_interfaces.patch +btrfs-fix-transaction-abort-on-file-creation-due-to-name-hash-collision.patch +btrfs-fix-transaction-abort-on-set-received-ioctl-due-to-item-overflow.patch +btrfs-abort-transaction-on-failure-to-update-root-in-the-received-subvol-ioctl.patch +iio-dac-ds4424-reject-128-raw-value.patch +iio-frequency-adf4377-fix-duplicated-soft-reset-mask.patch +iio-chemical-sps30_serial-fix-buffer-size-in-sps30_serial_read_meas.patch +iio-chemical-sps30_i2c-fix-buffer-size-in-sps30_i2c_read_meas.patch +iio-potentiometer-mcp4131-fix-double-application-of-wiper-shift.patch +iio-chemical-bme680-fix-measurement-wait-duration-calculation.patch +iio-buffer-fix-wait_queue-not-being-removed.patch +iio-gyro-mpu3050-core-fix-pm_runtime-error-handling.patch +iio-gyro-mpu3050-i2c-fix-pm_runtime-error-handling.patch +iio-imu-inv_icm42600-fix-odr-switch-to-the-same-value.patch +iio-imu-inv_icm42600-fix-odr-switch-when-turning-buffer-off.patch +iio-proximity-hx9023s-protect-against-division-by-zero-in-set_samp_freq.patch diff --git a/queue-6.12/smb-client-fix-atomic-open-with-o_direct-o_sync.patch b/queue-6.12/smb-client-fix-atomic-open-with-o_direct-o_sync.patch new file mode 100644 index 0000000000..280604d03b --- /dev/null +++ b/queue-6.12/smb-client-fix-atomic-open-with-o_direct-o_sync.patch @@ -0,0 +1,102 @@ +From 4a7d2729dc99437dbb880a64c47828c0d191b308 Mon Sep 17 00:00:00 2001 +From: Paulo Alcantara +Date: Sat, 7 Mar 2026 18:20:16 -0300 +Subject: smb: client: fix atomic open with O_DIRECT & O_SYNC + +From: Paulo Alcantara + +commit 4a7d2729dc99437dbb880a64c47828c0d191b308 upstream. + +When user application requests O_DIRECT|O_SYNC along with O_CREAT on +open(2), CREATE_NO_BUFFER and CREATE_WRITE_THROUGH bits were missed in +CREATE request when performing an atomic open, thus leading to +potentially data integrity issues. + +Fix this by setting those missing bits in CREATE request when +O_DIRECT|O_SYNC has been specified in cifs_do_create(). + +Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") +Signed-off-by: Paulo Alcantara (Red Hat) +Reviewed-by: David Howells +Acked-by: Henrique Carvalho +Cc: Tom Talpey +Cc: linux-cifs@vger.kernel.org +Cc: stable@vger.kernel.org +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman +--- + fs/smb/client/cifsglob.h | 11 +++++++++++ + fs/smb/client/dir.c | 1 + + fs/smb/client/file.c | 18 +++--------------- + 3 files changed, 15 insertions(+), 15 deletions(-) + +--- a/fs/smb/client/cifsglob.h ++++ b/fs/smb/client/cifsglob.h +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + #include "cifs_fs_sb.h" + #include "cifsacl.h" + #include +@@ -2317,4 +2318,14 @@ static inline bool cifs_ses_exiting(stru + return ret; + } + ++static inline int cifs_open_create_options(unsigned int oflags, int opts) ++{ ++ /* O_SYNC also has bit for O_DSYNC so following check picks up either */ ++ if (oflags & O_SYNC) ++ opts |= CREATE_WRITE_THROUGH; ++ if (oflags & O_DIRECT) ++ opts |= CREATE_NO_BUFFER; ++ return opts; ++} ++ + #endif /* _CIFS_GLOB_H */ +--- a/fs/smb/client/dir.c ++++ b/fs/smb/client/dir.c +@@ -304,6 +304,7 @@ static int cifs_do_create(struct inode * + goto out; + } + ++ create_options |= cifs_open_create_options(oflags, create_options); + /* + * if we're not using unix extensions, see if we need to set + * ATTR_READONLY on the create call +--- a/fs/smb/client/file.c ++++ b/fs/smb/client/file.c +@@ -570,15 +570,8 @@ static int cifs_nt_open(const char *full + *********************************************************************/ + + disposition = cifs_get_disposition(f_flags); +- + /* BB pass O_SYNC flag through on file attributes .. BB */ +- +- /* O_SYNC also has bit for O_DSYNC so following check picks up either */ +- if (f_flags & O_SYNC) +- create_options |= CREATE_WRITE_THROUGH; +- +- if (f_flags & O_DIRECT) +- create_options |= CREATE_NO_BUFFER; ++ create_options |= cifs_open_create_options(f_flags, create_options); + + retry_open: + oparms = (struct cifs_open_parms) { +@@ -1228,13 +1221,8 @@ cifs_reopen_file(struct cifsFileInfo *cf + rdwr_for_fscache = 1; + + desired_access = cifs_convert_flags(cfile->f_flags, rdwr_for_fscache); +- +- /* O_SYNC also has bit for O_DSYNC so following check picks up either */ +- if (cfile->f_flags & O_SYNC) +- create_options |= CREATE_WRITE_THROUGH; +- +- if (cfile->f_flags & O_DIRECT) +- create_options |= CREATE_NO_BUFFER; ++ create_options |= cifs_open_create_options(cfile->f_flags, ++ create_options); + + if (server->ops->get_lease_key) + server->ops->get_lease_key(inode, &cfile->fid); diff --git a/queue-6.12/smb-client-fix-iface-port-assignment-in-parse_server_interfaces.patch b/queue-6.12/smb-client-fix-iface-port-assignment-in-parse_server_interfaces.patch new file mode 100644 index 0000000000..8650119d1b --- /dev/null +++ b/queue-6.12/smb-client-fix-iface-port-assignment-in-parse_server_interfaces.patch @@ -0,0 +1,74 @@ +From d4c7210d2f3ea481a6481f03040a64d9077a6172 Mon Sep 17 00:00:00 2001 +From: Henrique Carvalho +Date: Wed, 11 Mar 2026 20:17:23 -0300 +Subject: smb: client: fix iface port assignment in parse_server_interfaces + +From: Henrique Carvalho + +commit d4c7210d2f3ea481a6481f03040a64d9077a6172 upstream. + +parse_server_interfaces() initializes interface socket addresses with +CIFS_PORT. When the mount uses a non-default port this overwrites the +configured destination port. + +Later, cifs_chan_update_iface() copies this sockaddr into server->dstaddr, +causing reconnect attempts to use the wrong port after server interface +updates. + +Use the existing port from server->dstaddr instead. + +Cc: stable@vger.kernel.org +Fixes: fe856be475f7 ("CIFS: parse and store info on iface queries") +Tested-by: Dr. Thomas Orgis +Reviewed-by: Enzo Matsumiya +Signed-off-by: Henrique Carvalho +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman +--- + fs/smb/client/smb2ops.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +--- a/fs/smb/client/smb2ops.c ++++ b/fs/smb/client/smb2ops.c +@@ -628,6 +628,7 @@ parse_server_interfaces(struct network_i + struct iface_info_ipv6 *p6; + struct cifs_server_iface *info = NULL, *iface = NULL, *niface = NULL; + struct cifs_server_iface tmp_iface; ++ __be16 port; + ssize_t bytes_left; + size_t next = 0; + int nb_iface = 0; +@@ -662,6 +663,15 @@ parse_server_interfaces(struct network_i + goto out; + } + ++ spin_lock(&ses->server->srv_lock); ++ if (ses->server->dstaddr.ss_family == AF_INET) ++ port = ((struct sockaddr_in *)&ses->server->dstaddr)->sin_port; ++ else if (ses->server->dstaddr.ss_family == AF_INET6) ++ port = ((struct sockaddr_in6 *)&ses->server->dstaddr)->sin6_port; ++ else ++ port = cpu_to_be16(CIFS_PORT); ++ spin_unlock(&ses->server->srv_lock); ++ + while (bytes_left >= (ssize_t)sizeof(*p)) { + memset(&tmp_iface, 0, sizeof(tmp_iface)); + /* default to 1Gbps when link speed is unset */ +@@ -682,7 +692,7 @@ parse_server_interfaces(struct network_i + memcpy(&addr4->sin_addr, &p4->IPv4Address, 4); + + /* [MS-SMB2] 2.2.32.5.1.1 Clients MUST ignore these */ +- addr4->sin_port = cpu_to_be16(CIFS_PORT); ++ addr4->sin_port = port; + + cifs_dbg(FYI, "%s: ipv4 %pI4\n", __func__, + &addr4->sin_addr); +@@ -696,7 +706,7 @@ parse_server_interfaces(struct network_i + /* [MS-SMB2] 2.2.32.5.1.2 Clients MUST ignore these */ + addr6->sin6_flowinfo = 0; + addr6->sin6_scope_id = 0; +- addr6->sin6_port = cpu_to_be16(CIFS_PORT); ++ addr6->sin6_port = port; + + cifs_dbg(FYI, "%s: ipv6 %pI6\n", __func__, + &addr6->sin6_addr); diff --git a/queue-6.12/smb-client-fix-in-place-encryption-corruption-in-smb2_write.patch b/queue-6.12/smb-client-fix-in-place-encryption-corruption-in-smb2_write.patch new file mode 100644 index 0000000000..523bf3355d --- /dev/null +++ b/queue-6.12/smb-client-fix-in-place-encryption-corruption-in-smb2_write.patch @@ -0,0 +1,53 @@ +From d78840a6a38d312dc1a51a65317bb67e46f0b929 Mon Sep 17 00:00:00 2001 +From: Bharath SM +Date: Mon, 9 Mar 2026 16:00:49 +0530 +Subject: smb: client: fix in-place encryption corruption in SMB2_write() + +From: Bharath SM + +commit d78840a6a38d312dc1a51a65317bb67e46f0b929 upstream. + +SMB2_write() places write payload in iov[1..n] as part of rq_iov. +smb3_init_transform_rq() pointer-shares rq_iov, so crypt_message() +encrypts iov[1] in-place, replacing the original plaintext with +ciphertext. On a replayable error, the retry sends the same iov[1] +which now contains ciphertext instead of the original data, +resulting in corruption. + +The corruption is most likely to be observed when connections are +unstable, as reconnects trigger write retries that re-send the +already-encrypted data. + +This affects SFU mknod, MF symlinks, etc. On kernels before +6.10 (prior to the netfs conversion), sync writes also used +this path and were similarly affected. The async write path +wasn't unaffected as it uses rq_iter which gets deep-copied. + +Fix by moving the write payload into rq_iter via iov_iter_kvec(), +so smb3_init_transform_rq() deep-copies it before encryption. + +Cc: stable@vger.kernel.org #6.3+ +Acked-by: Henrique Carvalho +Acked-by: Shyam Prasad N +Acked-by: Paulo Alcantara (Red Hat) +Signed-off-by: Bharath SM +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman +--- + fs/smb/client/smb2pdu.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/fs/smb/client/smb2pdu.c ++++ b/fs/smb/client/smb2pdu.c +@@ -5163,7 +5163,10 @@ replay_again: + + memset(&rqst, 0, sizeof(struct smb_rqst)); + rqst.rq_iov = iov; +- rqst.rq_nvec = n_vec + 1; ++ /* iov[0] is the SMB header; move payload to rq_iter for encryption safety */ ++ rqst.rq_nvec = 1; ++ iov_iter_kvec(&rqst.rq_iter, ITER_SOURCE, &iov[1], n_vec, ++ io_parms->length); + + if (retries) + smb2_set_replay(server, &rqst); diff --git a/queue-6.12/tracing-fix-enabling-multiple-events-on-the-kernel-command-line-and-bootconfig.patch b/queue-6.12/tracing-fix-enabling-multiple-events-on-the-kernel-command-line-and-bootconfig.patch new file mode 100644 index 0000000000..42e10f1071 --- /dev/null +++ b/queue-6.12/tracing-fix-enabling-multiple-events-on-the-kernel-command-line-and-bootconfig.patch @@ -0,0 +1,48 @@ +From 3b1679e086bb869ca02722f6bd29b3573a6a0e7e Mon Sep 17 00:00:00 2001 +From: Andrei-Alexandru Tachici +Date: Mon, 2 Mar 2026 11:27:34 +0100 +Subject: tracing: Fix enabling multiple events on the kernel command line and bootconfig + +From: Andrei-Alexandru Tachici + +commit 3b1679e086bb869ca02722f6bd29b3573a6a0e7e upstream. + +Multiple events can be enabled on the kernel command line via a comma +separator. But if the are specified one at a time, then only the last +event is enabled. This is because the event names are saved in a temporary +buffer, and each call by the init cmdline code will reset that buffer. + +This also affects names in the boot config file, as it may call the +callback multiple times with an example of: + + kernel.trace_event = ":mod:rproc_qcom_common", ":mod:qrtr", ":mod:qcom_aoss" + +Change the cmdline callback function to append a comma and the next value +if the temporary buffer already has content. + +Cc: stable@vger.kernel.org +Cc: Masami Hiramatsu +Cc: Mathieu Desnoyers +Link: https://patch.msgid.link/20260302-trace-events-allow-multiple-modules-v1-1-ce4436e37fb8@oss.qualcomm.com +Signed-off-by: Andrei-Alexandru Tachici +Signed-off-by: Steven Rostedt (Google) +Signed-off-by: Greg Kroah-Hartman +--- + kernel/trace/trace_events.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/kernel/trace/trace_events.c ++++ b/kernel/trace/trace_events.c +@@ -3999,7 +3999,11 @@ static char bootup_event_buf[COMMAND_LIN + + static __init int setup_trace_event(char *str) + { +- strscpy(bootup_event_buf, str, COMMAND_LINE_SIZE); ++ if (bootup_event_buf[0] != '\0') ++ strlcat(bootup_event_buf, ",", COMMAND_LINE_SIZE); ++ ++ strlcat(bootup_event_buf, str, COMMAND_LINE_SIZE); ++ + trace_set_ring_buffer_expanded(NULL); + disable_tracing_selftest("running event tracing"); + diff --git a/queue-6.12/tracing-fix-trace_buf_size-cmdline-parameter-with-sizes-2g.patch b/queue-6.12/tracing-fix-trace_buf_size-cmdline-parameter-with-sizes-2g.patch new file mode 100644 index 0000000000..399d71a09d --- /dev/null +++ b/queue-6.12/tracing-fix-trace_buf_size-cmdline-parameter-with-sizes-2g.patch @@ -0,0 +1,61 @@ +From d008ba8be8984760e36d7dcd4adbd5a41a645708 Mon Sep 17 00:00:00 2001 +From: Calvin Owens +Date: Fri, 6 Mar 2026 19:19:25 -0800 +Subject: tracing: Fix trace_buf_size= cmdline parameter with sizes >= 2G + +From: Calvin Owens + +commit d008ba8be8984760e36d7dcd4adbd5a41a645708 upstream. + +Some of the sizing logic through tracer_alloc_buffers() uses int +internally, causing unexpected behavior if the user passes a value that +does not fit in an int (on my x86 machine, the result is uselessly tiny +buffers). + +Fix by plumbing the parameter's real type (unsigned long) through to the +ring buffer allocation functions, which already use unsigned long. + +It has always been possible to create larger ring buffers via the sysfs +interface: this only affects the cmdline parameter. + +Cc: stable@vger.kernel.org +Cc: Masami Hiramatsu +Cc: Mathieu Desnoyers +Link: https://patch.msgid.link/bff42a4288aada08bdf74da3f5b67a2c28b761f8.1772852067.git.calvin@wbinvd.org +Fixes: 73c5162aa362 ("tracing: keep ring buffer to minimum size till used") +Signed-off-by: Calvin Owens +Signed-off-by: Steven Rostedt (Google) +Signed-off-by: Greg Kroah-Hartman +--- + kernel/trace/trace.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/kernel/trace/trace.c ++++ b/kernel/trace/trace.c +@@ -9227,7 +9227,7 @@ static void + init_tracer_tracefs(struct trace_array *tr, struct dentry *d_tracer); + + static int +-allocate_trace_buffer(struct trace_array *tr, struct array_buffer *buf, int size) ++allocate_trace_buffer(struct trace_array *tr, struct array_buffer *buf, unsigned long size) + { + enum ring_buffer_flags rb_flags; + +@@ -9277,7 +9277,7 @@ static void free_trace_buffer(struct arr + } + } + +-static int allocate_trace_buffers(struct trace_array *tr, int size) ++static int allocate_trace_buffers(struct trace_array *tr, unsigned long size) + { + int ret; + +@@ -10479,7 +10479,7 @@ __init static void enable_instances(void + + __init static int tracer_alloc_buffers(void) + { +- int ring_buf_size; ++ unsigned long ring_buf_size; + int ret = -ENOMEM; + + diff --git a/queue-6.12/x86-apic-disable-x2apic-on-resume-if-the-kernel-expects-so.patch b/queue-6.12/x86-apic-disable-x2apic-on-resume-if-the-kernel-expects-so.patch new file mode 100644 index 0000000000..201d300a7f --- /dev/null +++ b/queue-6.12/x86-apic-disable-x2apic-on-resume-if-the-kernel-expects-so.patch @@ -0,0 +1,86 @@ +From 8cc7dd77a1466f0ec58c03478b2e735a5b289b96 Mon Sep 17 00:00:00 2001 +From: Shashank Balaji +Date: Fri, 6 Mar 2026 14:46:28 +0900 +Subject: x86/apic: Disable x2apic on resume if the kernel expects so + +From: Shashank Balaji + +commit 8cc7dd77a1466f0ec58c03478b2e735a5b289b96 upstream. + +When resuming from s2ram, firmware may re-enable x2apic mode, which may have +been disabled by the kernel during boot either because it doesn't support IRQ +remapping or for other reasons. This causes the kernel to continue using the +xapic interface, while the hardware is in x2apic mode, which causes hangs. +This happens on defconfig + bare metal + s2ram. + +Fix this in lapic_resume() by disabling x2apic if the kernel expects it to be +disabled, i.e. when x2apic_mode = 0. + +The ACPI v6.6 spec, Section 16.3 [1] says firmware restores either the +pre-sleep configuration or initial boot configuration for each CPU, including +MSR state: + + When executing from the power-on reset vector as a result of waking from an + S2 or S3 sleep state, the platform firmware performs only the hardware + initialization required to restore the system to either the state the + platform was in prior to the initial operating system boot, or to the + pre-sleep configuration state. In multiprocessor systems, non-boot + processors should be placed in the same state as prior to the initial + operating system boot. + + (further ahead) + + If this is an S2 or S3 wake, then the platform runtime firmware restores + minimum context of the system before jumping to the waking vector. This + includes: + + CPU configuration. Platform runtime firmware restores the pre-sleep + configuration or initial boot configuration of each CPU (MSR, MTRR, + firmware update, SMBase, and so on). Interrupts must be disabled (for + IA-32 processors, disabled by CLI instruction). + + (and other things) + +So at least as per the spec, re-enablement of x2apic by the firmware is +allowed if "x2apic on" is a part of the initial boot configuration. + + [1] https://uefi.org/specs/ACPI/6.6/16_Waking_and_Sleeping.html#initialization + + [ bp: Massage. ] + +Fixes: 6e1cb38a2aef ("x64, x2apic/intr-remap: add x2apic support, including enabling interrupt-remapping") +Co-developed-by: Rahul Bukte +Signed-off-by: Rahul Bukte +Signed-off-by: Shashank Balaji +Signed-off-by: Borislav Petkov (AMD) +Reviewed-by: Thomas Gleixner +Reviewed-by: Sohil Mehta +Cc: stable@vger.kernel.org +Link: https://patch.msgid.link/20260306-x2apic-fix-v2-1-bee99c12efa3@sony.com +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/kernel/apic/apic.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/arch/x86/kernel/apic/apic.c ++++ b/arch/x86/kernel/apic/apic.c +@@ -1887,6 +1887,7 @@ void __init check_x2apic(void) + + static inline void try_to_enable_x2apic(int remap_mode) { } + static inline void __x2apic_enable(void) { } ++static inline void __x2apic_disable(void) { } + #endif /* !CONFIG_X86_X2APIC */ + + void __init enable_IR_x2apic(void) +@@ -2449,6 +2450,11 @@ static void lapic_resume(void) + if (x2apic_mode) { + __x2apic_enable(); + } else { ++ if (x2apic_enabled()) { ++ pr_warn_once("x2apic: re-enabled by firmware during resume. Disabling\n"); ++ __x2apic_disable(); ++ } ++ + /* + * Make sure the APICBASE points to the right address + * diff --git a/queue-6.12/xfs-ensure-dquot-item-is-deleted-from-ail-only-after-log-shutdown.patch b/queue-6.12/xfs-ensure-dquot-item-is-deleted-from-ail-only-after-log-shutdown.patch new file mode 100644 index 0000000000..7f09fa0852 --- /dev/null +++ b/queue-6.12/xfs-ensure-dquot-item-is-deleted-from-ail-only-after-log-shutdown.patch @@ -0,0 +1,65 @@ +From 186ac39b8a7d3ec7ce9c5dd45e5c2730177f375c Mon Sep 17 00:00:00 2001 +From: Long Li +Date: Thu, 5 Mar 2026 16:49:22 +0800 +Subject: xfs: ensure dquot item is deleted from AIL only after log shutdown + +From: Long Li + +commit 186ac39b8a7d3ec7ce9c5dd45e5c2730177f375c upstream. + +In xfs_qm_dqflush(), when a dquot flush fails due to corruption +(the out_abort error path), the original code removed the dquot log +item from the AIL before calling xfs_force_shutdown(). This ordering +introduces a subtle race condition that can lead to data loss after +a crash. + +The AIL tracks the oldest dirty metadata in the journal. The position +of the tail item in the AIL determines the log tail LSN, which is the +oldest LSN that must be preserved for crash recovery. When an item is +removed from the AIL, the log tail can advance past the LSN of that item. + +The race window is as follows: if the dquot item happens to be at +the tail of the log, removing it from the AIL allows the log tail +to advance. If a concurrent log write is sampling the tail LSN at +the same time and subsequently writes a complete checkpoint (i.e., +one containing a commit record) to disk before the shutdown takes +effect, the journal will no longer protect the dquot's last +modification. On the next mount, log recovery will not replay the +dquot changes, even though they were never written back to disk, +resulting in silent data loss. + +Fix this by calling xfs_force_shutdown() before xfs_trans_ail_delete() +in the out_abort path. Once the log is shut down, no new log writes +can complete with an updated tail LSN, making it safe to remove the +dquot item from the AIL. + +Cc: stable@vger.kernel.org +Fixes: b707fffda6a3 ("xfs: abort consistently on dquot flush failure") +Signed-off-by: Long Li +Reviewed-by: Carlos Maiolino +Reviewed-by: Christoph Hellwig +Signed-off-by: Carlos Maiolino +Signed-off-by: Greg Kroah-Hartman +--- + fs/xfs/xfs_dquot.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/fs/xfs/xfs_dquot.c ++++ b/fs/xfs/xfs_dquot.c +@@ -1472,9 +1472,15 @@ xfs_qm_dqflush( + return 0; + + out_abort: ++ /* ++ * Shut down the log before removing the dquot item from the AIL. ++ * Otherwise, the log tail may advance past this item's LSN while ++ * log writes are still in progress, making these unflushed changes ++ * unrecoverable on the next mount. ++ */ ++ xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); + dqp->q_flags &= ~XFS_DQFLAG_DIRTY; + xfs_trans_ail_delete(lip, 0); +- xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); + xfs_dqfunlock(dqp); + return error; + } diff --git a/queue-6.12/xfs-fix-returned-valued-from-xfs_defer_can_append.patch b/queue-6.12/xfs-fix-returned-valued-from-xfs_defer_can_append.patch new file mode 100644 index 0000000000..1847a679dd --- /dev/null +++ b/queue-6.12/xfs-fix-returned-valued-from-xfs_defer_can_append.patch @@ -0,0 +1,36 @@ +From 54fcd2f95f8d216183965a370ec69e1aab14f5da Mon Sep 17 00:00:00 2001 +From: Carlos Maiolino +Date: Wed, 4 Mar 2026 19:54:27 +0100 +Subject: xfs: fix returned valued from xfs_defer_can_append + +From: Carlos Maiolino + +commit 54fcd2f95f8d216183965a370ec69e1aab14f5da upstream. + +xfs_defer_can_append returns a bool, it shouldn't be returning +a NULL. + +Found by code inspection. + +Fixes: 4dffb2cbb483 ("xfs: allow pausing of pending deferred work items") +Cc: # v6.8 +Signed-off-by: Carlos Maiolino +Reviewed-by: Darrick J. Wong +Acked-by: Souptick Joarder +Signed-off-by: Carlos Maiolino +Signed-off-by: Greg Kroah-Hartman +--- + fs/xfs/libxfs/xfs_defer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/xfs/libxfs/xfs_defer.c ++++ b/fs/xfs/libxfs/xfs_defer.c +@@ -809,7 +809,7 @@ xfs_defer_can_append( + + /* Paused items cannot absorb more work */ + if (dfp->dfp_flags & XFS_DEFER_PAUSED) +- return NULL; ++ return false; + + /* Already full? */ + if (ops->max_items && dfp->dfp_count >= ops->max_items) diff --git a/queue-6.12/xfs-fix-undersized-l_iclog_roundoff-values.patch b/queue-6.12/xfs-fix-undersized-l_iclog_roundoff-values.patch new file mode 100644 index 0000000000..c14c2bad15 --- /dev/null +++ b/queue-6.12/xfs-fix-undersized-l_iclog_roundoff-values.patch @@ -0,0 +1,66 @@ +From 52a8a1ba883defbfe3200baa22cf4cd21985d51a Mon Sep 17 00:00:00 2001 +From: "Darrick J. Wong" +Date: Wed, 4 Mar 2026 20:26:20 -0800 +Subject: xfs: fix undersized l_iclog_roundoff values + +From: Darrick J. Wong + +commit 52a8a1ba883defbfe3200baa22cf4cd21985d51a upstream. + +If the superblock doesn't list a log stripe unit, we set the incore log +roundoff value to 512. This leads to corrupt logs and unmountable +filesystems in generic/617 on a disk with 4k physical sectors... + +XFS (sda1): Mounting V5 Filesystem ff3121ca-26e6-4b77-b742-aaff9a449e1c +XFS (sda1): Torn write (CRC failure) detected at log block 0x318e. Truncating head block from 0x3197. +XFS (sda1): failed to locate log tail +XFS (sda1): log mount/recovery failed: error -74 +XFS (sda1): log mount failed +XFS (sda1): Mounting V5 Filesystem ff3121ca-26e6-4b77-b742-aaff9a449e1c +XFS (sda1): Ending clean mount + +...on the current xfsprogs for-next which has a broken mkfs. xfs_info +shows this... + +meta-data=/dev/sda1 isize=512 agcount=4, agsize=644992 blks + = sectsz=4096 attr=2, projid32bit=1 + = crc=1 finobt=1, sparse=1, rmapbt=1 + = reflink=1 bigtime=1 inobtcount=1 nrext64=1 + = exchange=1 metadir=1 +data = bsize=4096 blocks=2579968, imaxpct=25 + = sunit=0 swidth=0 blks +naming =version 2 bsize=4096 ascii-ci=0, ftype=1, parent=1 +log =internal log bsize=4096 blocks=16384, version=2 + = sectsz=4096 sunit=0 blks, lazy-count=1 +realtime =none extsz=4096 blocks=0, rtextents=0 + = rgcount=0 rgsize=268435456 extents + = zoned=0 start=0 reserved=0 + +...observe that the log section has sectsz=4096 sunit=0, which means +that the roundoff factor is 512, not 4096 as you'd expect. We should +fix mkfs not to generate broken filesystems, but anyone can fuzz the +ondisk superblock so we should be more cautious. I think the inadequate +logic predates commit a6a65fef5ef8d0, but that's clearly going to +require a different backport. + +Cc: stable@vger.kernel.org # v5.14 +Fixes: a6a65fef5ef8d0 ("xfs: log stripe roundoff is a property of the log") +Signed-off-by: Darrick J. Wong +Reviewed-by: Christoph Hellwig +Signed-off-by: Carlos Maiolino +Signed-off-by: Greg Kroah-Hartman +--- + fs/xfs/xfs_log.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/fs/xfs/xfs_log.c ++++ b/fs/xfs/xfs_log.c +@@ -1396,6 +1396,8 @@ xlog_alloc_log( + + if (xfs_has_logv2(mp) && mp->m_sb.sb_logsunit > 1) + log->l_iclog_roundoff = mp->m_sb.sb_logsunit; ++ else if (mp->m_sb.sb_logsectsize > 0) ++ log->l_iclog_roundoff = mp->m_sb.sb_logsectsize; + else + log->l_iclog_roundoff = BBSIZE; +