From: Bart De Schuymer <bdschuym@pandora.be>
To: Florian Westphal <fw@strlen.de>
Cc: David Miller <davem@davemloft.net>, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 0/7] netfilter: ebtables: CONFIG_COMPAT support
Date: Mon, 08 Feb 2010 00:19:42 +0100 [thread overview]
Message-ID: <4B6F4A8E.4040507@pandora.be> (raw)
In-Reply-To: <20100207223802.GA27427@Chamillionaire.breakpoint.cc>
Florian Westphal schreef:
> Bart De Schuymer <bdschuym@pandora.be> wrote:
>
>> I can't tell how many of these systems are running ebtables but
>> considering most of the functionality has been working on a
>> user32/kernel64 system since 2004 I think it's safe to say that
>> Florian's patch will break a few systems.
>>
>
> Yes, I had feared that.
> The way I see it we have a couple of alternatives.
>
> One way would be to disable the in-kernel ebt-compat layer for
> sparc64. Of course this assumes that this userland-side padding
> is only used on the sparc platform.
>
>
>> I'm not familiar with the way this compat layer works, but is there a
>> standard way to ensure that old ebtables binaries don't use the compat
>> layer, while a new version of the userspace program would?
>>
>
> It should be possible to figure out if we need to do fixups,
> because struct ebt_replace size differs (and the sockopt *len
> includes this value).
>
> In some cases this is as simple as "if (*len == sizeof(struct
> ebt_replace)". But even in case of EBT_SO_GET_ENTRIES it seems
> possible. We can try the "native" getsockopt call first, it should
> then error out early due to this check:
>
> if (*len != sizeof(struct ebt_replace) + entries_size +
> (tmp.num_counters? nentries * sizeof(struct ebt_counter): 0)) {
> sizeof(struct ebt_counter): 0)) {
> /* -EINVAL */
>
> we can then re-try with all the compat fixups.
>
> What do you think?
>
>
I think it's best to have the compat code in the fast path, since that's
the code that will be needed in the future on those machines (I'll make
the userspace workaround a compile-time option that is turned off by
default in the next release of ebtables).
Shouldn't it be possible for the compat code to know when a certain
wrong size is due to the userspace workaround? If that situation is the
case, then the compat code can execute the "native" getsockopt instead
of producing a kernel error message...
cheers,
Bart
--
Bart De Schuymer
www.artinalgorithms.be
next prev parent reply other threads:[~2010-02-07 23:19 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-05 1:43 [PATCH 0/7] netfilter: ebtables: CONFIG_COMPAT support Florian Westphal
2010-02-05 1:43 ` [PATCH 1/7] netfilter: ebtables: abort if next_offset is too small Florian Westphal
2010-02-05 1:43 ` [PATCH 2/7] netfilter: ebtables: avoid explicit XT_ALIGN() in match/targets Florian Westphal
2010-02-05 1:43 ` [PATCH 3/7] netfilter: CONFIG_COMPAT: allow delta to exceed 32767 Florian Westphal
2010-02-05 1:43 ` [PATCH 4/7] netfilter: ebtables: split do_replace into two functions Florian Westphal
2010-02-05 1:43 ` [PATCH 5/7] netfilter: ebtables: add CONFIG_COMPAT support Florian Westphal
2010-02-05 13:52 ` Florian Westphal
2010-02-07 22:43 ` Florian Westphal
2010-02-05 1:43 ` [PATCH 6/7] netfilter: ebt_limit: " Florian Westphal
2010-02-05 1:43 ` [PATCH 7/7] netfilter: ebtables: mark: " Florian Westphal
2010-02-05 7:15 ` [PATCH 0/7] netfilter: ebtables: " Jan Engelhardt
2010-02-05 14:00 ` Florian Westphal
2010-02-05 17:15 ` Bart De Schuymer
2010-02-05 18:02 ` David Miller
2010-02-06 13:08 ` Bart De Schuymer
2010-02-06 13:50 ` Jan Engelhardt
2010-02-07 22:38 ` Florian Westphal
2010-02-07 23:19 ` Bart De Schuymer [this message]
2010-02-07 23:28 ` Florian Westphal
2010-02-05 19:53 ` Florian Westphal
2010-02-05 20:07 ` Jan Engelhardt
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=4B6F4A8E.4040507@pandora.be \
--to=bdschuym@pandora.be \
--cc=davem@davemloft.net \
--cc=fw@strlen.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 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.