Thread (21 messages) 21 messages, 3 authors, 2020-12-07

Re: crypto: sun4i-ss: error with kmap

From: Corentin Labbe <clabbe.montjoie@gmail.com>
Date: 2020-12-06 21:41:46
Also in: linux-arm-kernel, linux-mm, lkml

On Sat, Dec 05, 2020 at 08:48:15PM +0100, Thomas Gleixner wrote:
Corentin,

On Sat, Dec 05 2020 at 19:43, Corentin Labbe wrote:
quoted
On Fri, Dec 04, 2020 at 09:58:21PM +0100, Thomas Gleixner wrote:
quoted
Can you please replace the debug patch with the one below and try again?
That stops the trace right on the condition.
Hello, the result could be found at http://kernel.montjoie.ovh/130739.log
Thanks for providing this. This is clearly showing where stuff goes
wrong. It starts here at 729.550001. I removed the uninteresting parts:

0d..2 147103293us : __kmap_local_page_prot <-sg_miter_next
0d..3 147103308us :__kmap_local_pfn_prot: kmap_local_pfn: 1 ffefd000

0d..3 147103311us : __kmap_local_page_prot <-sg_miter_next
0d..4 147103325us : __kmap_local_pfn_prot: kmap_local_pfn: 3 ffefb000

0d..3 147103429us : kunmap_local_indexed <-sg_miter_stop
0d..4 147103433us : kunmap_local_indexed: kunmap_local: 3 ffefd000

So this maps two pages and unmaps the first one. That's all called from
sun4i_ss_opti_poll() and the bug is clearly visible there:

	sg_miter_next(&mi);
	sg_miter_next(&mo);

release_ss:
	sg_miter_stop(&mi);
	sg_miter_stop(&mo);

Written by yourself :) Same issue in sun4i_ss_cipher_poll()

Fix below.
Unfortunatly, the crash still happen with the fix.
See http://kernel.montjoie.ovh/131321.log
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help