From: Thomas Gleixner <tglx@linutronix.de>
To: Peter LaDow <petela@gocougs.wsu.edu>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org,
netfilter@vger.kernel.org
Subject: Re: Process Hang in __read_seqcount_begin
Date: Fri, 26 Oct 2012 22:53:04 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.02.1210262252390.2756@ionos> (raw)
In-Reply-To: <CAN8Q1Ed1J-jmO9LppcA=rFXPvxFkk-J9mMb2-NhDYyAQKO2jvQ@mail.gmail.com>
On Fri, 26 Oct 2012, Peter LaDow wrote:
> (I've added netfilter and linux-rt-users to try to pull in more help).
>
> On Fri, Oct 26, 2012 at 9:48 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > Upstream kernel is fine, there is no race, as long as :
> >
> > local_bh_disable() disables BH and preemption.
>
> Looking at the unpatched code in net/ipv4/netfilter/ip_tables.c, it
> doesn't appear that any of the code checks the return value for
> xt_write_receq_begin to determine if it is safe to write. And neither
> does the newly patched code. How did the mainline code prevent
> corruption of the tables it is updating?
>
> Why isn't there something like:
>
> while ( (addend = xt_write_recseq_begin()) == 0 );
>
> To make sure that only one person has write access to the tables?
> Better yet, why not use a seqlock_t instead?
>
> > Apparently RT changes this, so RT needs to change the code.
>
> The RT patch only touches local_bh_disable/enable, not the code in
> ip_tables.c. Does the local_bh_disable/enable in the mainline code
> protect against multiple writers?
>
> > cmpxchg() has strong guarantees (and is also slower than upstream code),
> > and seems a reasonable way to fix RT/iptables
>
> I see this now. And I agree that your patch would prevent corruption
> of the sequence counter.
Thanks for the reminder. I'll have a look.
tglx
next prev parent reply other threads:[~2012-10-26 20:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAN8Q1EdobyFuAvtajGRSqNsCG+XoPA+FkwN=2j_H126mmfEjTQ@mail.gmail.com>
[not found] ` <1350925299.8609.978.camel@edumazet-glaptop>
[not found] ` <CAN8Q1EeqmHMHD-VUgr7Wzv0Z_DAD1SrEniftg==L14d+hGwu+Q@mail.gmail.com>
[not found] ` <CAN8Q1EcTRsHjCJD90q0bKRJFMvi7Vn8YRsyQTAHNtTFVuuNdWQ@mail.gmail.com>
[not found] ` <CAN8Q1EeB2kC6A_YP9zdtp_qYHMG5FF7-Usjx7Rz5pv--bjhqkQ@mail.gmail.com>
[not found] ` <1351053164.6537.95.camel@edumazet-glaptop>
[not found] ` <CAN8Q1Ef9sCAG8-KNWXEeuRUcmFNcg93mMG=HRQw6i3UuGtJCVg@mail.gmail.com>
[not found] ` <1351270087.30380.9.camel@edumazet-glaptop>
2012-10-26 18:51 ` Process Hang in __read_seqcount_begin Peter LaDow
2012-10-26 20:53 ` Thomas Gleixner [this message]
2012-10-26 21:05 ` Eric Dumazet
2012-10-26 21:25 ` Peter LaDow
2012-10-26 21:54 ` Thomas Gleixner
2012-10-30 23:09 ` Peter LaDow
2012-10-31 0:33 ` Thomas Gleixner
2012-07-28 20:43 Peter LaDow
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=alpine.LFD.2.02.1210262252390.2756@ionos \
--to=tglx@linutronix.de \
--cc=eric.dumazet@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=netfilter@vger.kernel.org \
--cc=petela@gocougs.wsu.edu \
/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).