From: Vlad Yasevich <vladislav.yasevich@hp.com>
To: linux-sctp@vger.kernel.org
Subject: Re: [Lksctp-developers] [PATCH 1/3] sctp: fix autoclose timer race
Date: Thu, 12 Nov 2009 18:14:03 +0000 [thread overview]
Message-ID: <4AFC506B.4080904@hp.com> (raw)
In-Reply-To: <4AFC36CD.2020806@hp.com>
Vlad Yasevich wrote:
>
> Andrei Pelinescu-Onciul wrote:
>> For very small autoclose timeouts (e.g. 0 or close to 0 due to
>> overflows) it's possible that the timer is executed immediately
>> after is set, before there is a chance to increase the association
>> reference counter. To avoid this race, always reference the
>> association before calling mod_timer() and dereference it back if
>> the timer was already active.
>>
>
> Actually, I don't think this can happen. At worst, you'd trigger
> a soft lock-up, since the code modifying the timer is already holding
> a socket lock. But that would only happen if that code is pre-empted,
> which would mean that a user version of the lock is held, then the
> autoclose would get rescheduled anyway.
>
Even if the timer ends up running on a different CPU, the socket lock
guarantees that only 1 instance of the state machine is running per
socket. The timer handler will spin on the lock until it's released,
so there doesn't appear to be a race.
-vlad
prev parent reply other threads:[~2009-11-12 18:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-12 16:24 [Lksctp-developers] [PATCH 1/3] sctp: fix autoclose timer race Vlad Yasevich
2009-11-12 18:14 ` Vlad Yasevich [this message]
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=4AFC506B.4080904@hp.com \
--to=vladislav.yasevich@hp.com \
--cc=linux-sctp@vger.kernel.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).