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:   Tue, 17 Nov 2020 17:28:47 +0100
From:   Johan Hovold <johan@...nel.org>
To:     Davidlohr Bueso <dave@...olabs.net>
Cc:     Johan Hovold <johan@...nel.org>, linux-usb@...r.kernel.org,
        linux-kernel@...r.kernel.org, Davidlohr Bueso <dbueso@...e.de>
Subject: Re: [PATCH] USB: serial: mos7720: defer state restore to a workqueue

On Mon, Nov 16, 2020 at 02:31:02PM -0800, Davidlohr Bueso wrote:
> On Mon, 16 Nov 2020, Johan Hovold wrote:
> 
> >On Fri, Nov 13, 2020 at 08:27:25PM -0800, Davidlohr Bueso wrote:
> >> @@ -1883,21 +1724,17 @@ static void mos7720_release(struct usb_serial *serial)
> >>		if (mos_parport->msg_pending)
> >>			wait_for_completion_timeout(&mos_parport->syncmsg_compl,
> >>					    msecs_to_jiffies(MOS_WDR_TIMEOUT));
> >> +		/*
> >> +		 * If delayed work is currently scheduled, wait for it to
> >> +		 * complete. This also implies barriers that ensure the
> >> +		 * below serial clearing is not hoisted above the ->work.
> >> +		 */
> >> +		cancel_work_sync(&mos_parport->work);
> >
> >As I mentioned, this needs to be done *after* deregistering the port or
> >you could theoretically end up with the work item being requeued.
> 
> Hmm sorry yes I forgot to mention this. I was counting on the private_data
> already being null to prevent any new work being actually scheduled, so an
> incoming restore state, for example, would be a nop.

Ah, yes, you're right. 

> >Yes, the same applies for the "synchronous" requests, but that's a
> >preexisting issue.
> 
> Per the above I also assumed sync requests were also safe as is.

Indeed.

> But I can certainly re-order things, how about:

No, that's ok, no need to change this as part of this clean up.

Can you just fix up that irq comment, and I'll apply this? Thanks.

Johan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ