Re: [RFC] SLOB breaks netfilter

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

 



On Tuesday 2011-06-07 23:06, Sebastian Andrzej Siewior wrote:

>After more debugging I found the root cause: In
>check_entry_size_and_hooks() I see:
>              if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
>
>and SLOB defines:
>
>|#ifdef ARCH_DMA_MINALIGN
>|#define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN
>|#else
>|#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long)
>|#endif
>| 
>|#ifndef ARCH_SLAB_MINALIGN
>|#define ARCH_SLAB_MINALIGN __alignof__(unsigned long)
>|#endif
>
>Using u64 instead solved the problem. So my question is this check
>really required?

The e % .. check is strictly needed. We might be doing *(uint64_t *)e
at some point, and so alignment is of utmost importance.

THOUGH: I notice that alignof(uint64_t) yields 8 even for i586-linux-gnu
mode, but for 32-bit mode, e % 4 is enough.
To be investigated more tomorrow :)
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux