From: Michael Ellerman Date: Fri, 06 Mar 2020 00:27:32 +0000 Subject: Re: [PATCH kernel v3] powerpc/book3s64: Fix error handling in mm_iommu_do_alloc() Message-Id: <48YT381z9Zz9sRY@ozlabs.org> List-Id: In-Reply-To: <20191223060351.26359-1-aik@ozlabs.ru> References: <20191223060351.26359-1-aik@ozlabs.ru> In-Reply-To: <20191223060351.26359-1-aik@ozlabs.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Alexey Kardashevskiy , linuxppc-dev@lists.ozlabs.org Cc: Alexey Kardashevskiy , Jan Kara , kvm-ppc@vger.kernel.org, David Gibson On Mon, 2019-12-23 at 06:03:51 UTC, Alexey Kardashevskiy wrote: > The last jump to free_exit in mm_iommu_do_alloc() happens after page > pointers in struct mm_iommu_table_group_mem_t were already converted to > physical addresses. Thus calling put_page() on these physical addresses > will likely crash. > > This moves the loop which calculates the pageshift and converts page > struct pointers to physical addresses later after the point when > we cannot fail; thus eliminating the need to convert pointers back. > > Fixes: eb9d7a62c386 ("powerpc/mm_iommu: Fix potential deadlock") > Reported-by: Jan Kara > Signed-off-by: Alexey Kardashevskiy Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/c4b78169e3667413184c9a20e11b5832288a109f cheers