limit match not working on sparc64
I received a bug report [0] regarding the limit match not working on sparc64 with kernel 2.4.22. It references an earlier report [1] of the problem on this list. Harald Welete commented on it [2] and asked for additional information, but there is no clear resolution.
Anyone?
Signature · 3 lines
[0] http://bugs.debian.org/218837 [1] http://lists.netfilter.org/pipermail/netfilter-devel/2003-January/010195.html [2] http://lists.netfilter.org/pipermail/netfilter-devel/2003-January/010209.html
Quoted 6 lines · Laurence J. Lane
I received a bug report [0] regarding the limit match not working on sparc64 with kernel 2.4.22. It references an earlier report [1] of the problem on this list. Harald Welete commented on it [2] and asked for additional information, but there is no clear resolution.
Anyone?
this is most likely never going to get fixed. the problem is that the
limit match does an ugly hack: it stores a pointer in it's struct matchinfo. That pointer is 64bits in the kernel, but userspace is 32bits, and thus the compilar only allocates 32bit for the pointer in the structure: boom.
The structure was commented by the original author with:
/* Ugly, ugly fucker. */
:(
Signature · 5 lines
- Harald Welte <[email protected]> http://www.netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie
Quoted 6 lines · Harald Welte
Quoted 5 lines · Laurence J. Lane
I received a bug report [0] regarding the limit match not working on sparc64 with kernel 2.4.22. It references an earlier report [1] of the problem on this list. Harald Welete commented on it [2] and asked for additional information, but there is no clear resolution.
Quoted 7 lines
Quoted 1 line
Anyone?
this is most likely never going to get fixed. the problem is that the
limit match does an ugly hack: it stores a pointer in it's struct matchinfo. That pointer is 64bits in the kernel, but userspace is 32bits, and thus the compilar only allocates 32bit for the pointer in the structure: boom.
Just a random thought -- is an intptr_t the same between kernel and userland on all architectures?
Signature · 3 lines
Absurdity, n.: A statement or belief manifestly inconsistent with one's own
opinion.
-- Ambrose Bierce, "The Devil's Dictionary"Quoted 2 lines · Tom Marshall
Just a random thought -- is an
intptr_tthe same between kernel and userland on all architectures?
No, and may even differ between userland and userlan on the same architecture if the architecture supports split personality (supporting both 32 and 64 bit applications)
Any data structures exchanged between userspace and kernel must be using fixed with data types only, or else there will be problems like this as long as there is split personality architectures.
Pointers is troublesome, and unless the kernel headers exports a pointer type which is always reflecting the kernel-space pointer size this will be hard to deal with. But as pointers are different between userspace and kernelland there normally should not be any such needs.. iptables is an expection as it is userspace who allocates the size of the kernelspace structures, with pointers and all.
Now, this kind of thing should not be too hard to solve actually. What is required is that the header can determine that the pointer representation differs between user and kernelland, and then adjust the structure accordingly. The userspace part of the limit match does not use the pointer so it just needs to be made sure that the structure field of of the exact same size and alignment as a pointer in the kernel space, ensuring that the size and layout of the structure is identical in the two worlds.
Regards
Henrik
Quoted 9 lines · Tom Marshall
Quoted 8 lines · Harald Welte
Quoted 6 lines · Laurence J. Lane
I received a bug report [0] regarding the limit match not working on sparc64 with kernel 2.4.22. It references an earlier report [1] of the problem on this list. Harald Welete commented on it [2] and asked for additional information, but there is no clear resolution.
Anyone?
Quoted 8 lines
Quoted 5 lines
this is most likely never going to get fixed. the problem is that the
limit match does an ugly hack: it stores a pointer in it's struct matchinfo. That pointer is 64bits in the kernel, but userspace is 32bits, and thus the compilar only allocates 32bit for the pointer in the structure: boom.Just a random thought -- is an
intptr_tthe same between kernel and userland on all architectures?
I don't think so. Actually, the processor is running in a different
mode, so it an integer pointer in user space should never be 64bits wide.
we also cannot change the structure definition in a way that renders it incompatible on other architectures.
Since the limit match is not a particularly useful or important piece of iptables, I never though of it as a too important issue. It'll be solved with the mythical pkttables in 2.7.x ;)
Signature · 5 lines
- Harald Welte <[email protected]> http://www.netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie