lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMuHMdXA3omJ+YRVMS6yfj8avsEo47DjpFPADBvQZuT+CfWMtA@mail.gmail.com>
Date:   Wed, 29 Jan 2020 10:25:09 +0100
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Gilad Ben-Yossef <gilad@...yossef.com>
Cc:     Geert Uytterhoeven <geert+renesas@...der.be>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        "David S . Miller" <davem@...emloft.net>,
        Linux Crypto Mailing List <linux-crypto@...r.kernel.org>,
        Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
        Linux kernel mailing list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] [RFC] crypto: ccree - fix retry handling in cc_send_sync_request()

Hi Gilad,

On Wed, Jan 29, 2020 at 10:11 AM Gilad Ben-Yossef <gilad@...yossef.com> wrote:
> On Tue, Jan 28, 2020 at 9:09 PM Geert Uytterhoeven
> <geert+renesas@...der.be> wrote:
> > If cc_queues_status() indicates that the queue is full,
> > cc_send_sync_request() should loop and retry.
> >
> > However, cc_queues_status() returns either 0 (for success), or -ENOSPC
> > (for queue full), while cc_send_sync_request() checks for real errors by
> > comparing with -EAGAIN.  Hence -ENOSPC is always considered a real
> > error, and the code never retries the operation.
> >
> > Fix this by just removing the check, as cc_queues_status() never returns
> > any other error value than -ENOSPC.
>
> Thank you for spotting this!
>
> The error is simply checking for the wrong error value.
> We should be checking for -ENOSPC!
>
> What this does aims to do is wait for the hardware queue to free up if
> we were asked to queue a synchronous request and there was no room in
> the hardware queue.
> The cc_queue_status() function used to return -EAGAIN in this scenario
> and this was missed in the change.
>
> I'm curious as to how you found this - did you run into some problem
> and traced it to this?

I didn't run into a specific problem, but I'm working on cleaning up the driver
a bit.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ