Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1192915

Re: Several races in "usbnet" module (kernel 4.1.x)

From Oliver Neukum <oneukum@suse.com>
Newsgroups linux.kernel
Subject Re: Several races in "usbnet" module (kernel 4.1.x)
Date 2015-07-27 12:10 +0200
Message-ID <pQNw6-6QN-3@gated-at.bofh.it> (permalink)
References <pOnZ8-Kj-31@gated-at.bofh.it> <pOGIq-2tt-7@gated-at.bofh.it> <pP75U-7Hu-1@gated-at.bofh.it> <pPkPv-2nG-9@gated-at.bofh.it> <pPMsp-iu-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, 2015-07-24 at 17:41 +0300, Eugene Shatokhin wrote:
> 23.07.2015 12:15, Oliver Neukum пишет:

>  From what I see now in Documentation/atomic_ops.txt, stores to the 
> properly aligned memory locations are in fact atomic.

They are, but again only with respect to each other.

> So, I think, the situation you described above cannot happen for 
> dev->flags, which is good. No need to address that in the patch. The 
> race might be harmless after all.
> 
> If I understand the code correctly now, dev->flags is set to 0 in 
> usbnet_stop() so that the worker function (usbnet_deferred_kevent) would

Yes, particularly not reschedule itself.

> do nothing, should it start later. If so, how about adding memory 
> barriers for all CPUs to see dev->flags is 0 before other things?

Taking a lock, as del_timer_sync() does, implies a memory barrier,
as does a work.

	Regards
		Oliver


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: Several races in "usbnet" module (kernel 4.1.x) Oliver Neukum <oneukum@suse.com> - 2015-07-27 12:10 +0200
  Re: Several races in "usbnet" module (kernel 4.1.x) Eugene Shatokhin <eugene.shatokhin@rosalab.ru> - 2015-07-27 16:30 +0200

csiph-web