Merge tag 'powerpc-6.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:

- Prevent use-after-free in 64-bit KVM VFIO

- Add generated Power8 crypto asm to .gitignore

Thanks to Al Viro and Nathan Lynch.

* tag 'powerpc-6.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
KVM: PPC: Book3S HV: Prevent UAF in kvm_spapr_tce_attach_iommu_group()
powerpc/crypto: Add generated P8 asm to .gitignore

+15 -5
+2
arch/powerpc/crypto/.gitignore
··· 1 # SPDX-License-Identifier: GPL-2.0-only 2 aesp10-ppc.S 3 ghashp10-ppc.S
··· 1 # SPDX-License-Identifier: GPL-2.0-only 2 aesp10-ppc.S 3 + aesp8-ppc.S 4 ghashp10-ppc.S 5 + ghashp8-ppc.S
+13 -5
arch/powerpc/kvm/book3s_64_vio.c
··· 130 } 131 rcu_read_unlock(); 132 133 - fdput(f); 134 - 135 - if (!found) 136 return -EINVAL; 137 138 table_group = iommu_group_get_iommudata(grp); 139 - if (WARN_ON(!table_group)) 140 return -EFAULT; 141 142 for (i = 0; i < IOMMU_TABLE_GROUP_MAX_TABLES; ++i) { 143 struct iommu_table *tbltmp = table_group->tables[i]; ··· 160 break; 161 } 162 } 163 - if (!tbl) 164 return -EINVAL; 165 166 rcu_read_lock(); 167 list_for_each_entry_rcu(stit, &stt->iommu_tables, next) { ··· 174 /* stit is being destroyed */ 175 iommu_tce_table_put(tbl); 176 rcu_read_unlock(); 177 return -ENOTTY; 178 } 179 /* ··· 182 * its KVM reference counter and can return. 183 */ 184 rcu_read_unlock(); 185 return 0; 186 } 187 rcu_read_unlock(); ··· 190 stit = kzalloc(sizeof(*stit), GFP_KERNEL); 191 if (!stit) { 192 iommu_tce_table_put(tbl); 193 return -ENOMEM; 194 } 195 ··· 199 200 list_add_rcu(&stit->next, &stt->iommu_tables); 201 202 return 0; 203 } 204
··· 130 } 131 rcu_read_unlock(); 132 133 + if (!found) { 134 + fdput(f); 135 return -EINVAL; 136 + } 137 138 table_group = iommu_group_get_iommudata(grp); 139 + if (WARN_ON(!table_group)) { 140 + fdput(f); 141 return -EFAULT; 142 + } 143 144 for (i = 0; i < IOMMU_TABLE_GROUP_MAX_TABLES; ++i) { 145 struct iommu_table *tbltmp = table_group->tables[i]; ··· 158 break; 159 } 160 } 161 + if (!tbl) { 162 + fdput(f); 163 return -EINVAL; 164 + } 165 166 rcu_read_lock(); 167 list_for_each_entry_rcu(stit, &stt->iommu_tables, next) { ··· 170 /* stit is being destroyed */ 171 iommu_tce_table_put(tbl); 172 rcu_read_unlock(); 173 + fdput(f); 174 return -ENOTTY; 175 } 176 /* ··· 177 * its KVM reference counter and can return. 178 */ 179 rcu_read_unlock(); 180 + fdput(f); 181 return 0; 182 } 183 rcu_read_unlock(); ··· 184 stit = kzalloc(sizeof(*stit), GFP_KERNEL); 185 if (!stit) { 186 iommu_tce_table_put(tbl); 187 + fdput(f); 188 return -ENOMEM; 189 } 190 ··· 192 193 list_add_rcu(&stit->next, &stt->iommu_tables); 194 195 + fdput(f); 196 return 0; 197 } 198