From: Yuri Ershov <ext-yuri.ershov@nokia.com>
To: marcel@holtmann.org,
"Tervo Ville (Nokia-MS/Helsinki)" <ville.tervo@nokia.com>,
"ext Gustavo F. Padovan" <padovan@profusion.mobi>,
"Emeltchenko Andrei (Nokia-MS/Helsinki)"
<andrei.emeltchenko@nokia.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/1] bluetooth: Fix NULL pointer dereference issue
Date: Thu, 30 Dec 2010 17:45:03 +0300 [thread overview]
Message-ID: <4D1C9AEF.1030207@nokia.com> (raw)
In-Reply-To: <4D01EBD7.1060804@nokia.com>
[-- Attachment #1: Type: text/plain, Size: 2994 bytes --]
Hi All,
Ershov Yuri (EXT-Teleca/RussianFed) wrote:
> Hi Ville,
>
> Ville Tervo wrote:
>> Hi Yuri,
>>
>> On Wed, Dec 08, 2010 at 01:52:09PM +0300, Yuri Ershov wrote:
>>
>>
>>
>>>>>> So in which situations (n == p), or (p == p->next)? That should happen only
>>>>>> when p is the only element in the list, then p == head, right?
>>>>>>
>>>>> The (n == p) is in situation, when sk is unlinked by task
>>>>> responsible for handling connect/disconnect requests while the
>>>>> "bt_accept_dequeue". This condition is indirect checking of sk
>>>>> validity.
>>>>>
>>>> Why not using a list lock here instead? Fits a way better.
>>>>
>>>>
>>> Yes, it's better. I tried to use the locks in this function, but it
>>> slows down the task handling connect/disconnect/etc. events and the
>>> task skips some events from fast clients.
>>>
>>>
>>
>> What kind of problems you exactly got with locks? Maybe they should be fixed
>> also.
>>
>>
> The sequence with locks is the following (let's consider
> connect/disconnect events only):
>
> Clients bt main
> task bt accept task
> |
> | |
> |
> | schedule_timeout()
> connect
> sig_channel |
> |
> | |
> | wake_up
> |
>
> |
> | |
> disconnect
> sig_channel bt_accept_deque
> | |
> |
> | |
> lock
> | wait for
> lock |
> |
> | |
> connect skip event
> unlock
>
> etc.
>
>
> So when I use several clients, skipping events becomes appreciable. I
> found only one way to leave "bt main task" (very fast) and "bt accept
> task" (rather slow) synchronized - skip handling of invalid sockets.
>
It is just to remind, if the patch is not rejected. May I ask you to
comment this?
Thanks,
Yuri
[-- Attachment #2: Type: text/html, Size: 9218 bytes --]
next prev parent reply other threads:[~2010-12-30 14:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-25 9:55 [PATCH 1/1] bluetooth: Fix NULL pointer dereference issue Yuri Ershov
2010-11-25 18:16 ` Gustavo F. Padovan
2010-11-26 8:50 ` Yuri Ershov
2010-12-06 21:15 ` Gustavo F. Padovan
[not found] ` <4CFE32A0.6090601@nokia.com>
2010-12-07 15:50 ` Gustavo F. Padovan
2010-12-08 10:52 ` Yuri Ershov
2010-12-10 7:17 ` Ville Tervo
[not found] ` <4D01EBD7.1060804@nokia.com>
2010-12-30 14:45 ` Yuri Ershov [this message]
2011-01-13 14:37 ` Andrei Emeltchenko
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=4D1C9AEF.1030207@nokia.com \
--to=ext-yuri.ershov@nokia.com \
--cc=andrei.emeltchenko@nokia.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=padovan@profusion.mobi \
--cc=ville.tervo@nokia.com \
/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).