All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Jon Maloy <jmaloy@redhat.com>
Cc: Niels Dossche <dossche.niels@gmail.com>,
	tipc-discussion@lists.sourceforge.net, netdev@vger.kernel.org,
	Ying Xue <ying.xue@windriver.com>,
	"David S. Miller" <davem@davemloft.net>,
	Paolo Abeni <pabeni@redhat.com>,
	Hoang Le <hoang.h.le@dektech.com.au>
Subject: Re: [PATCH net] tipc: use a write lock for keepalive_intv instead of a read lock
Date: Wed, 30 Mar 2022 22:48:26 -0700	[thread overview]
Message-ID: <20220330224826.500183dc@kernel.org> (raw)
In-Reply-To: <20220329161213.93576-1-dossche.niels@gmail.com>

On Tue, 29 Mar 2022 18:12:14 +0200 Niels Dossche wrote:
> Currently, n->keepalive_intv is written to while n is locked by a read
> lock instead of a write lock. This seems to me to break the atomicity
> against other readers.
> Change this to a write lock instead to solve the issue.
> 
> Note:
> I am currently working on a static analyser to detect missing locks
> using type-based static analysis as my master's thesis
> in order to obtain my master's degree.
> If you would like to have more details, please let me know.
> This was a reported case. I manually verified the report by looking
> at the code, so that I do not send wrong information or patches.
> After concluding that this seems to be a true positive, I created
> this patch. I have both compile-tested this patch and runtime-tested
> this patch on x86_64. The effect on a running system could be a
> potential race condition in exceptional cases.
> This issue was found on Linux v5.17.
> 
> Fixes: f5d6c3e5a359 ("tipc: fix node keep alive interval calculation")
> Signed-off-by: Niels Dossche <dossche.niels@gmail.com>

Looks good, Jon?

  parent reply	other threads:[~2022-03-31  5:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29 16:12 [PATCH net] tipc: use a write lock for keepalive_intv instead of a read lock Niels Dossche
2022-03-30  3:09 ` Hoang Huu Le
2022-03-31  5:48 ` Jakub Kicinski [this message]
2022-03-31 14:28 ` Paolo Abeni
2022-03-31 16:54   ` Jon Maloy
2022-03-31 17:59     ` Niels Dossche

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=20220330224826.500183dc@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dossche.niels@gmail.com \
    --cc=hoang.h.le@dektech.com.au \
    --cc=jmaloy@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tipc-discussion@lists.sourceforge.net \
    --cc=ying.xue@windriver.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.