Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1362823
| From | Jiri Slaby <jslaby@suse.cz> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2] Bluetooth: vhci, fix open_timeout vs. hdev race |
| Date | 2016-03-22 17:00 +0100 |
| Message-ID | <rfwSS-6Bo-9@gated-at.bofh.it> (permalink) |
| References | <relG9-6qO-7@gated-at.bofh.it> <relZv-6PZ-11@gated-at.bofh.it> <rfvar-5AR-19@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 03/22/2016, 03:00 PM, Takashi Iwai wrote:
> int main()
> {
> int i;
> long fd;
> pthread_t th[32];
>
> fd = open("/dev/vhci", O_RDWR);
> if (fd < 0)
> err(1, "open");
> for (i = 0; i < 32; i++)
> pthread_create(&th[i], 0, test, (void*)fd);
> for (i = 0; i < 32; i++)
> pthread_join(th[i], NULL);
> return 0;
> }
> ================================================================
>
> For fixing these, we need a proper mutex protection. A patch like
> below seems helping, at least for the test case above.
I didn't fix this and kept it simple as I believe concurrent accesses
from a single opener are not allowed by design. But if we want to
support this, we of course need locking like this.
Anyway, I would appreciate any input from the BT fellows. There are more
races like this, apparently.
thanks,
--
js
suse labs
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] Bluetooth: vhci, fix open_timeout vs. hdev race Jiri Slaby <jslaby@suse.cz> - 2016-03-19 10:50 +0100
[PATCH v2] Bluetooth: vhci, fix open_timeout vs. hdev race Jiri Slaby <jslaby@suse.cz> - 2016-03-19 11:10 +0100
Re: [PATCH v2] Bluetooth: vhci, fix open_timeout vs. hdev race Takashi Iwai <tiwai@suse.de> - 2016-03-22 15:10 +0100
Re: [PATCH v2] Bluetooth: vhci, fix open_timeout vs. hdev race Jiri Slaby <jslaby@suse.cz> - 2016-03-22 17:00 +0100
csiph-web