From: Oliver Neukum <oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
To: wangbiao <biao.wang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Ingo Molnar
<mingo.kernel.org-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org,
mingo-X9Un+BFzKDI@public.gmane.org,
a.p.zijlstra-/NLkJaSkS4VmR6Xm/wNWPw@public.gmane.org,
rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org,
william.douglas-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
di.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH V3] usbnet: fix race condition caused spinlock bad magic issue
Date: Thu, 14 Nov 2013 08:44:42 +0100 [thread overview]
Message-ID: <1384415082.18291.8.camel@linux-fkkt.site> (raw)
In-Reply-To: <1384394595.4229.24.camel@wangbiao>
On Thu, 2013-11-14 at 10:03 +0800, wangbiao wrote:
> From: wang, biao <biao.wang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Date: Mon, 11 Nov 2013 10:23:40 +0800
> Subject: [PATCH] usbnet: fix race condition caused spinlock bad magic issue
>
> there is race between usbnet_terminate_urbs and usbnet_bh.
> for example:
> cpu 0 cpu 1
> usbnet_suspend
> usbnet_bh { ->usbnet_terminate_urbs {
> dev->wait = &unlink_wakeup;
> while(....){..}//break
> if(dev->wait) is true
> dev->wait=NULL
> }//unlink_wakeup is invalid
> __wake_up(dev->wait)//garbage value
> }
>
> the race is due to unprotection of dev->wait, so this patch involves a
> spinlock to avoid it.
>
> Signed-off-by: wang, biao <biao.wang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Zhang, Di <di.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Acked-by: Oliver Neukum <oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2013-11-14 7:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-14 2:03 [PATCH V3] usbnet: fix race condition caused spinlock bad magic issue wangbiao
2013-11-14 7:44 ` Oliver Neukum [this message]
[not found] ` <1384415082.18291.8.camel-B2T3B9s34ElbnMAlSieJcQ@public.gmane.org>
2013-11-14 9:18 ` Bjørn Mork
2013-11-14 7:58 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1384415082.18291.8.camel@linux-fkkt.site \
--to=oliver-gvhc2dphhpqdnm+yrofe0a@public.gmane.org \
--cc=a.p.zijlstra-/NLkJaSkS4VmR6Xm/wNWPw@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=biao.wang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=di.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mingo-X9Un+BFzKDI@public.gmane.org \
--cc=mingo.kernel.org-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org \
--cc=william.douglas-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).