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]
Date:   Fri, 18 Jan 2019 16:56:03 -0600
From:   Li Yang <leoyang.li@....com>
To:     madalin.bucur@....com
Cc:     "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" 
        <linux-arm-kernel@...ts.infradead.org>,
        Netdev <netdev@...r.kernel.org>, Roy Pledge <roy.pledge@....com>,
        lkml <linux-kernel@...r.kernel.org>,
        linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
        David Miller <davem@...emloft.net>
Subject: Re: [PATCH] soc: fsl: qbman: avoid race in clearing QMan interrupt

On Fri, Dec 21, 2018 at 8:43 AM Madalin Bucur <madalin.bucur@....com> wrote:
>
> By clearing all interrupt sources, not only those that
> already occurred, the existing code may acknowledge by
> mistake interrupts that occurred after the code checks
> for them.
>
> Signed-off-by: Madalin Bucur <madalin.bucur@....com>
> Signed-off-by: Roy Pledge <roy.pledge@....com>

Applied for fix.  Thanks.  Suggest to forward it to
stable@...r.kernel.org after merged into Linus' tree.  It would be
better to add "Cc: stable@...r.kernel.org" in the commit message for
similar patches next time.

Regards,
Leo

> ---
>  drivers/soc/fsl/qbman/qman.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c
> index 52c153cd795a..636f83f781f5 100644
> --- a/drivers/soc/fsl/qbman/qman.c
> +++ b/drivers/soc/fsl/qbman/qman.c
> @@ -1143,18 +1143,19 @@ static void qm_mr_process_task(struct work_struct *work);
>  static irqreturn_t portal_isr(int irq, void *ptr)
>  {
>         struct qman_portal *p = ptr;
> -
> -       u32 clear = QM_DQAVAIL_MASK | p->irq_sources;
>         u32 is = qm_in(&p->p, QM_REG_ISR) & p->irq_sources;
> +       u32 clear = 0;
>
>         if (unlikely(!is))
>                 return IRQ_NONE;
>
>         /* DQRR-handling if it's interrupt-driven */
> -       if (is & QM_PIRQ_DQRI)
> +       if (is & QM_PIRQ_DQRI) {
>                 __poll_portal_fast(p, QMAN_POLL_LIMIT);
> +               clear = QM_DQAVAIL_MASK | QM_PIRQ_DQRI;
> +       }
>         /* Handling of anything else that's interrupt-driven */
> -       clear |= __poll_portal_slow(p, is);
> +       clear |= __poll_portal_slow(p, is) & QM_PIRQ_SLOW;
>         qm_out(&p->p, QM_REG_ISR, clear);
>         return IRQ_HANDLED;
>  }
> --
> 2.1.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ