From: David Miller <davem@davemloft.net>
To: willemdebruijn.kernel@gmail.com
Cc: netdev@vger.kernel.org, byoungyoung@purdue.edu,
threeearcat@gmail.com, xiyou.wangcong@gmail.com,
herbert@gondor.apana.org.au, willemb@google.com
Subject: Re: [PATCH net] packet: fix bitfield update race
Date: Tue, 24 Apr 2018 13:17:54 -0400 (EDT) [thread overview]
Message-ID: <20180424.131754.1266434549335457413.davem@davemloft.net> (raw)
In-Reply-To: <20180423213703.241054-1-willemdebruijn.kernel@gmail.com>
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: Mon, 23 Apr 2018 17:37:03 -0400
> From: Willem de Bruijn <willemb@google.com>
>
> Updates to the bitfields in struct packet_sock are not atomic.
> Serialize these read-modify-write cycles.
>
> Move po->running into a separate variable. Its writes are protected by
> po->bind_lock (except for one startup case at packet_create). Also
> replace a textual precondition warning with lockdep annotation.
>
> All others are set only in packet_setsockopt. Serialize these
> updates by holding the socket lock. Analogous to other field updates,
> also hold the lock when testing whether a ring is active (pg_vec).
>
> Fixes: 8dc419447415 ("[PACKET]: Add optional checksum computation for recvmsg")
> Reported-by: DaeRyong Jeong <threeearcat@gmail.com>
> Reported-by: Byoungyoung Lee <byoungyoung@purdue.edu>
> Signed-off-by: Willem de Bruijn <willemb@google.com>
Looks good, applied and queued up for -stable.
Thanks for fixing this Willem.
prev parent reply other threads:[~2018-04-24 17:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-23 21:37 [PATCH net] packet: fix bitfield update race Willem de Bruijn
2018-04-24 17:17 ` David Miller [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=20180424.131754.1266434549335457413.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=byoungyoung@purdue.edu \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@vger.kernel.org \
--cc=threeearcat@gmail.com \
--cc=willemb@google.com \
--cc=willemdebruijn.kernel@gmail.com \
--cc=xiyou.wangcong@gmail.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).