[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a070f6f7-ed85-c909-ce8b-748210402211@stressinduktion.org>
Date: Wed, 18 May 2016 12:38:36 +0200
From: Hannes Frederic Sowa <hannes@...essinduktion.org>
To: Andrey Ryabinin <aryabinin@...tuozzo.com>,
"David S. Miller" <davem@...emloft.net>
Cc: Rainer Weikusat <rweikusat@...ileactivedefense.com>,
Eric Dumazet <edumazet@...gle.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: af_unix: protect ->sk_shutdown change with
lock_sock()
On 18.05.2016 12:14, Andrey Ryabinin wrote:
> ->sk_shutdown bits share one bitfield with some other bits in sock struct,
> such as ->sk_no_check_[r,t]x, ->sk_userlocks ...
> sock_setsockopt() may write to these bits, while holding the socket lock.
> In case of AF_UNIX sockets, we change ->sk_shutdown bits while holding only
> unix_state_lock(). So concurrent setsockopt() and shutdown() may lead
> to corrupting these bits.
>
> Fix that by protecting writes to ->sk_shutdown with lock_sock()
Is it possible to move sk_shutdown out of the bitfields? Maybe a whole
which suites is available somewhere?
af_unix doesn't depend on the socket locks anywhere and it would keep
locking much easier if we only depend on the state lock.
Bye,
Hannes
Powered by blists - more mailing lists