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] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 2 Jul 2018 00:07:22 +0200
From:   Octavian Purdila <tavi@...pub.ro>
To:     Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc:     lkml <linux-kernel@...r.kernel.org>, linux-usb@...r.kernel.org,
        tglx@...utronix.de, Lee Jones <lee.jones@...aro.org>
Subject: Re: [PATCH REPOST] mfd: dln2: use irqsave() in USB's complete callback

On Sun, Jul 1, 2018 at 5:41 PM, Sebastian Andrzej Siewior
<bigeasy@...utronix.de> wrote:
> The USB completion callback does not disable interrupts while acquiring
> the lock. We want to remove the local_irq_disable() invocation from
> __usb_hcd_giveback_urb() and therefore it is required for the callback
> handler to disable the interrupts while acquiring the lock.
> The callback may be invoked either in IRQ or BH context depending on the
> USB host controller.
> Use the _irqsave() variant of the locking primitives.
>
> Cc: Lee Jones <lee.jones@...aro.org>
> Cc: Octavian Purdila <octavian.purdila@...el.com>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
> ---
>  drivers/mfd/dln2.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mfd/dln2.c b/drivers/mfd/dln2.c
> index 704e189ca162..1ef3c92f32e0 100644
> --- a/drivers/mfd/dln2.c
> +++ b/drivers/mfd/dln2.c
> @@ -194,6 +194,7 @@ static bool dln2_transfer_complete(struct dln2_dev *dln2, struct urb *urb,
>         struct device *dev = &dln2->interface->dev;
>         struct dln2_mod_rx_slots *rxs = &dln2->mod_rx_slots[handle];
>         struct dln2_rx_context *rxc;
> +       unsigned long flags;
>         bool valid_slot = false;
>
>         if (rx_slot >= DLN2_MAX_RX_SLOTS)
> @@ -206,13 +207,13 @@ static bool dln2_transfer_complete(struct dln2_dev *dln2, struct urb *urb,
>          * context elsewhere in this driver. This function (or its callers) are
>          * also not exported to other modules.
>          */
> -       spin_lock(&rxs->lock);
> +       spin_lock_irqsave(&rxs->lock, flags);


I don't think disabling the IRQ is necessary, please see the comment
above and also this discussion:

https://www.spinics.net/lists/linux-usb/msg115214.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ