linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Corentin Labbe <clabbe.montjoie@gmail.com>
Cc: herbert@gondor.apana.org.au, mripard@kernel.org, wens@csie.org,
	linux-arm-kernel@lists.infradead.org,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jens Axboe <axboe@kernel.dk>,
	linux-mm@kvack.org, Andrew Morton <akpm@linuxfoundation.org>,
	Julia Lawall <julia.lawall@lip6.fr>,Matthew Wilcox
	<willy@infradead.org>
Subject: Re: crypto: sun4i-ss: error with kmap
Date: Mon, 07 Dec 2020 01:15:49 +0100	[thread overview]
Message-ID: <87ft4i79oq.fsf@nanos.tec.linutronix.de> (raw)
In-Reply-To: <20201206214053.GA8458@Red>

On Sun, Dec 06 2020 at 22:40, Corentin Labbe wrote:
> On Sat, Dec 05, 2020 at 08:48:15PM +0100, Thomas Gleixner wrote:
>> 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

And why are you not looking for the reason of this problem in your own
code yourself? It's not a regression caused by my work.

Turn on CONFIG_DEBUG_HIGHMEM on 5.10-rcX or older kernels and you will
get the very same crashes. My work just made these checks unconditional.

This was broken forever and it's not my problem that you did not enable
mandatory debug options when developing this thing.

I gave you tons of hints by now how to debug this and what to look
for. Obviously I overlooked something and here is the final hint:

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

        do {
           ....
           if (cond1)
               sg_miter_next(&mi);      <--- HINT
           ....
           if (cond2)
               sg_miter_next(&mo);
 
release_ss:
 	sg_miter_stop(&mi);
 	sg_miter_stop(&mo);

So yes, I overlooked the obvious, but as I said above it's not something
which my is failing due to my changes. It was broken forever, it just
was not tested properly. Don't blame the messenger.

My knowledge about how to use nested sg_miter correctly is close to
zero. I can and did explain you the rules of kmap_atomic/local() but
that's it.

Thanks,

        tglx


  reply	other threads:[~2020-12-07  0:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20201201130102.GA23461@Red>
     [not found] ` <87ft4phcyx.fsf@nanos.tec.linutronix.de>
     [not found]   ` <20201201135252.GA9584@Red>
     [not found]     ` <87y2ihfw6z.fsf@nanos.tec.linutronix.de>
     [not found]       ` <20201201144529.GA6786@Red>
     [not found]         ` <87v9dlfthf.fsf@nanos.tec.linutronix.de>
     [not found]           ` <20201202195501.GA29296@Red>
     [not found]             ` <877dpzexfr.fsf@nanos.tec.linutronix.de>
     [not found]               ` <20201203173846.GA16207@Red>
2020-12-03 23:34                 ` crypto: sun4i-ss: error with kmap Thomas Gleixner
2020-12-04 13:26                   ` Corentin Labbe
2020-12-04 15:08                     ` Thomas Gleixner
2020-12-04 19:27                       ` Corentin Labbe
2020-12-04 20:58                         ` Thomas Gleixner
2020-12-05 18:43                           ` Corentin Labbe
2020-12-05 19:48                             ` Thomas Gleixner
2020-12-05 20:16                               ` Julia Lawall
2020-12-06 21:40                               ` Corentin Labbe
2020-12-07  0:15                                 ` Thomas Gleixner [this message]
2020-12-07 12:18                                   ` Corentin Labbe
2020-12-07 15:53                                     ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ft4i79oq.fsf@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=akpm@linuxfoundation.org \
    --cc=axboe@kernel.dk \
    --cc=clabbe.montjoie@gmail.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=julia.lawall@lip6.fr \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mripard@kernel.org \
    --cc=wens@csie.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).