Re: Fwd: ebtables broken for kernel above 2.6.28

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I think it's best to fix this in the kernel if it's possible, since we don't want to break compatibility. If the fix has to be in userspace, then it must be a fix that still works for older kernels.

cheers,
Bart

sachin sanap schreef:
Sorry dint inform you earlier that iam on 32bit ARM machine.
The real problem is the kernel is computing the alignment on
__alignof__(struct _xt_align) and the userspace ebtables is computing
it on __alignof__(struct ebt_entry_target) , which are two different
structs.

I have the following patch for ebtables-v2.0.8-2 that fixes this.



--- ebtables-v2.0.8-2.orig/include/ebtables_u.h 2009-05-29
21:41:32.000000000 +0530
+++ ebtables-v2.0.8-2/include/ebtables_u.h      2009-05-29
21:43:32.000000000 +0530
@@ -25,6 +25,7 @@
 #define EBTABLES_U_H
 #include <netinet/in.h>
 #include <linux/netfilter_bridge/ebtables.h>
+#include <linux/netfilter/x_tables.h>

 #ifndef IPPROTO_SCTP
 #define IPPROTO_SCTP           132
@@ -37,7 +38,7 @@
 #define EXEC_STYLE_DAEMON      1

 #ifndef EBT_MIN_ALIGN
-#define EBT_MIN_ALIGN (__alignof__(struct ebt_entry_target))
+#define EBT_MIN_ALIGN (__alignof__(struct _xt_align))
 #endif
 #define EBT_ALIGN(s) (((s) + (EBT_MIN_ALIGN-1)) & ~(EBT_MIN_ALIGN-1))
 #define ERRORMSG_MAXLEN 128


-Sachin




On Fri, May 29, 2009 at 3:32 PM, Jan Engelhardt <jengelh@xxxxxxxxxx> wrote:
On Friday 2009-05-29 07:51, sachin sanap wrote:

Iam facing problem with ebtables binay on 2.6.28 kernel (same binary
works well with 2.6.27). Its mostly a structure alignment issue with
standard targets like DROP,ACCEPT etc. Message seen by user is
"eb_tables: standard target: invalid size 8 != 4"
Iam trying to fix it, this mail is just to check if its already fixed
by someone else?
Indeed this seems to happen, but only when using a mixed-bitness
combination:

/tmp/usr/sbin # LD_LIBRARY_PATH=../lib ./ebtables -A INPUT -j ACCEPT
The kernel doesn't support the ebtables 'filter' table.

/tmp/usr/sbin # uname -a
Linux sovereign 2.6.29.3-jen80-default #1 SMP 2009-04-06 18:10:58 +0200
x86_64 x86_64 x86_64 GNU/Linux

/tmp/usr/sbin # file ebtables
ebtables: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for
GNU/Linux 2.6.4, dynamically linked (uses shared libs), stripped

ebtables does work when it is 64-bit too, so the immediate workaround —
assuming you are on x86 — is to not use a 32-bit userspace with a
64-bit kernel.

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux