From: Phil Sutter <phil@nwl.cc>
To: Senthil Kumar Balasubramanian <senthilb@qubercomm.com>
Cc: netfilter-devel@vger.kernel.org, pablo@netfilter.org
Subject: Re: ebtables behaving weirdly on MIPS platform
Date: Thu, 30 Sep 2021 12:38:40 +0200 [thread overview]
Message-ID: <20210930103840.GP32194@orbyte.nwl.cc> (raw)
In-Reply-To: <CA+6nuS7f=bLh56k463rJSPn7P3PvwW-kzAz2oYx2wiw24_9_Mw@mail.gmail.com>
Hi,
On Thu, Sep 30, 2021 at 11:53:32AM +0530, Senthil Kumar Balasubramanian wrote:
> We are running OpenWRT/Tp-Link Archer A6 HW v2... (openwrt : 21.02
> ebtables v2.0.10-4)
>
> and when we run this ebtables with nflog extension as mentioned below
>
> ebtables -I FORWARD -o eth1 -p ip --ip-protocol udp --ip-source-port
> 68 --nflog-group 1 --nflog-prefix "ENTRY1" -j ACCEPT
>
> , we are running into the following issues..
>
> Unable to update the kernel. Two possible causes:
> 1. Multiple ebtables programs were executing simultaneously. The ebtables
> userspace tool doesn't by default support multiple ebtables programs running
> concurrently. The ebtables option --concurrent or a tool like flock can be
> used to support concurrent scripts that update the ebtables kernel tables.
> 2. The kernel doesn't support a certain ebtables extension, consider
> recompiling your kernel or insmod the extension.
>
> We have confirmed the required kernel configs are enabled and ensured
> the same with a ARM platform where the same command works..
>
> However, dumping the data that goes to the kernel, we see a huge
> difference between MIPS and ARM..
>
> in ARM platform
> w_l->w:
> 0000 6e 66 6c 6f 67 00 ff b6 00 00 00 00 00 00 00 00 nflog...........
> 0010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
> 0020 50 00 00 00 00 00 00 00 01 00 01 00 00 00 00 00 P...............
> 0030 45 4e 54 52 59 31 00 00 00 00 00 00 00 00 00 00 ENTRY1..........
> 0040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
> 0050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
> 0060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
> 0070 00 00 00 00
>
> in tplink a6 (MIPS platform)
>
> w_l->w:
> 0000 6e 66 6c 6f 67 00 b2 e0 69 6d 69 74 20 65 78 63 nflog...imit exc
> 0010 65 65 64 65 64 00 56 69 72 74 75 61 6c 20 74 69 eeded.Virtual ti
> 0020 00 00 00 50 65 78 70 69 00 01 00 01 50 72 6f 66 ...Pexpi....Prof
> 0030 45 4e 54 52 59 31 00 69 6d 65 72 20 65 78 70 69 ENTRY1.imer expi
> 0040 72 65 64 00 57 69 6e 64 6f 77 20 63 68 61 6e 67 red.Window chang
> 0050 65 64 00 49 2f 4f 20 70 6f 73 73 69 62 6c 65 00 ed.I/O possible.
> 0060 50 6f 77 65 72 20 66 61 69 6c 75 72 65 00 42 61 Power failure.Ba
> 0070 64 20 73 79
> d sy
>
> Can you please let me know what's going wrong with this?
Looks like the data structure contains garbage. Looking at ebtables
code, that seems likely as extension data structures are allocated using
malloc() and never set zero. init() function in ebt_nflog.c only
initializes prefix, group and threshold fields (which seem to be set
correctly in your MIPS dump).
I wonder how this is supposed to work, I can't find a place which zeroes
relevant data. It looks like we're missing memset() calls in
ebt_register_{match,watcher,target} functions. OTOH this seems to work
fine in most cases, so I'm likely missing something.
Cheers, Phil
next prev parent reply other threads:[~2021-09-30 10:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-30 6:23 ebtables behaving weirdly on MIPS platform Senthil Kumar Balasubramanian
2021-09-30 10:38 ` Phil Sutter [this message]
2021-09-30 10:52 ` Florian Westphal
2021-09-30 12:47 ` Senthil Kumar Balasubramanian
2021-09-30 13:02 ` Florian Westphal
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=20210930103840.GP32194@orbyte.nwl.cc \
--to=phil@nwl.cc \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=senthilb@qubercomm.com \
/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.