All of lore.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 1/2] net: Fix sysctl restarts...
Date: Fri, 19 Feb 2010 15:35:27 -0800	[thread overview]
Message-ID: <m1ocjksssg.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <20100219.152954.39315470.davem@davemloft.net> (David Miller's message of "Fri\, 19 Feb 2010 15\:29\:54 -0800 \(PST\)")

David Miller <davem@davemloft.net> writes:

> From: ebiederm@xmission.com (Eric W. Biederman)
> Date: Fri, 19 Feb 2010 15:22:59 -0800
>
>> 
>> Yuck.  It turns out that when we restart sysctls we were restarting
>> with the values already changed.  Which unfortunately meant that
>> the second time through we thought there was no change and skipped
>> all kinds of work, despite the fact that there was indeed a change.
>> 
>> I have fixed this the simplest way possible by restoring the changed
>> values when we restart the sysctl write.
>> 
>> One of my coworkers spotted this bug when after disabling forwarding
>> on an interface pings were still forwarded.
>> 
>> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
>
> What commit added this bug?

When we I fixed the deadlock that can happen if you write to forwarding
while removing the device.  The deadlock was fixed, the restart worked
but I somehow missed the fact that proc_dointvec modifies state and so
defeated the change detection.  *embarrassing*

commit 9b8adb5ea005fe73acd5dd58f9bd47eafa74c9d1
Author: Eric W. Biederman <ebiederm@xmission.com>
Date:   Wed May 13 16:59:21 2009 +0000

    net: Fix devinet_sysctl_forward
    
    sysctls are unregistered with the rntl_lock held making
    it unsafe to unconditionally grab the the rtnl_lock.  Instead
    we need to call rtnl_trylock and restart the system call
    if we can not grab it.  Otherwise we could deadlock at unregistration
    time.
    
    Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>





  reply	other threads:[~2010-02-19 23:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-19 23:22 [PATCH 1/2] net: Fix sysctl restarts Eric W. Biederman
2010-02-19 23:23 ` [PATCH 2/2] net-sysfs: Use rtnl_trylock in wireless sysfs methods Eric W. Biederman
2010-02-19 23:29 ` [PATCH 1/2] net: Fix sysctl restarts David Miller
2010-02-19 23:35   ` Eric W. Biederman [this message]
2010-02-19 23:41     ` David Miller
2010-02-19 23:58       ` Eric W. Biederman
2010-02-20  0:02         ` David Miller

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=m1ocjksssg.fsf@fess.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=davem@davemloft.net \
    --cc=netdev@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 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.