netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: fruggeri@aristanetworks.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 1/1] net: ipv4: ipmr_expire_timer causes crash when removing net namespace
Date: Thu, 30 Aug 2012 12:52:33 -0400 (EDT)	[thread overview]
Message-ID: <20120830.125233.1334599630211579060.davem@davemloft.net> (raw)
In-Reply-To: <CA+HUmGhEaTD7QgYyfhDB22K1=Oj3RvDi2Ny217-YFXV03HJzqg@mail.gmail.com>

From: Francesco Ruggeri <fruggeri@aristanetworks.com>
Date: Fri, 24 Aug 2012 10:38:35 -0700

> When tearing down a net namespace, ipv4 mr_table structures are freed
> without first deactivating their timers. This can result in a crash in
> run_timer_softirq.
> This patch mimics the corresponding behaviour in ipv6.
> Locking and synchronization seem to be adequate.
> We are about to kfree mrt, so existing code should already make sure that
> no other references to mrt are pending or can be created by incoming traffic.
> The functions invoked here do not cause new references to mrt or other
> race conditions to be created.
> Invoking del_timer_sync guarantees that ipmr_expire_timer is inactive.
> Both ipmr_expire_process (whose completion we may have to wait in
> del_timer_sync) and mroute_clean_tables internally use mfc_unres_lock
> or other synchronizations when needed, and they both only modify mrt.
> 
> Tested in Linux 3.4.8.
> 
> Signed-off-by: Francesco Ruggeri <fruggeri@aristanetworks.com>

Applied, and queued up for -stable, thanks.

I think we have another problem.  mroute_clean_tables() skips MRT_STATIC
cache entries, and does not purge them.

I can't see anything that will ever free those static entries up at all.

      reply	other threads:[~2012-08-30 16:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-24 17:38 [PATCH 1/1] net: ipv4: ipmr_expire_timer causes crash when removing net namespace Francesco Ruggeri
2012-08-30 16:52 ` 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=20120830.125233.1334599630211579060.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=fruggeri@aristanetworks.com \
    --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 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).