netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hiroshi KIHIRA <hiro@dump-Storage.net>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: Eric Dumazet <eric.dumazet@gmail.com>, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH RFC] iptables-restore: new option to change the commit timing
Date: Sun, 11 Sep 2011 02:27:19 +0900	[thread overview]
Message-ID: <4E6B9DF7.7080502@dump-Storage.net> (raw)
In-Reply-To: <alpine.LNX.2.01.1109081716390.13219@frira.zrqbmnf.qr>

(11/09/09 0:22), Jan Engelhardt wrote:
>>> What would probably be most desirable is that iptables-restore keeps
>>> copies in memory of each table it attempted to touch,
>>> for the eventual case of a rollback.
>>
>> Unfortunately, keeping a copy into userland memory is not enough to
>> guarantee a rollback is possible in kernel land.
>>
>> You might be in an OOM situation preveting new (large) memory
>> allocations.
>
> If restoring the old table fails, no big deal, since we are already
> in an inconsistent state anyway — caused by the rejection of the new
> table —, so there is no additional loss AFAICS.

If memory allocation failed while reading the input,iptables-restore
simply dies without any modification in the kernel space. But if the
OOM situation happened while committing the new or old table, an
inconsistent state will occur.

I believe that the rollback function is useful for many cases except
the memory allocation failure and the problem in kernel space. and
I try to implement it. in the next patch.

I think that 2 handles per tables are needed for rollback. One of them
is used for backup, and the other is for modification.
The backup handle is used if iptc_commit for modified handle failed.
It should succeed, because the handle keeps the table data previously
applied in the kernel space.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2011-09-10 17:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-08 13:28 [PATCH RFC] iptables-restore: new option to change the commit timing Hiroshi KIHIRA
2011-09-08 15:00 ` Jan Engelhardt
2011-09-08 15:06   ` Eric Dumazet
2011-09-08 15:22     ` Jan Engelhardt
2011-09-09  5:26       ` Maciej Żenczykowski
2011-09-10 17:27       ` Hiroshi KIHIRA [this message]
2011-09-12  9:28 ` Pablo Neira Ayuso
2011-09-12 11:52   ` Hiroshi KIHIRA
2011-09-12 18:19     ` Pablo Neira Ayuso

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=4E6B9DF7.7080502@dump-Storage.net \
    --to=hiro@dump-storage.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jengelh@medozas.de \
    --cc=netfilter-devel@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).