Re: [PATCH 1/1] netfilter: nf_tables: fix nft_cmp_fast failure on big endian for size < 4

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

 



On Sat, Apr 12, 2014 at 01:17:57PM +0200, Patrick McHardy wrote:
> nft_cmp_fast is used for equality comparisions of size <= 4. For
> comparisions of size < 4 byte a mask is calculated that is applied to
> both the data from userspace (during initialization) and the register
> value (during runtime). Both values are stored using (in effect) memcpy
> to a memory area that is then interpreted as u32 by nft_cmp_fast.
> 
> This works fine on little endian since smaller types have the same base
> address, however on big endian this is not true and the smaller types
> are interpreted as a big number with trailing zero bytes.
> 
> The mask therefore must not include the lower bytes, but the higher bytes
> on big endian. Add a helper function that does a cpu_to_le32 to switch
> the bytes on big endian. Since we're dealing with a mask of just consequitive
> bits, this works out fine.

Applied and queue up to -stable. Thanks.
--
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