]> www.infradead.org Git - users/jedix/linux-maple.git/commit
netfilter: nfnetlink: work around wrong endianess in res_id field
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 28 Aug 2015 19:01:43 +0000 (21:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Oct 2015 21:43:17 +0000 (14:43 -0700)
commit16e6df022b41901165f67c30f807074fd6c4507b
tree28b9a12040715044ae34fcfcb8a60186955ff5ae
parenta95d7d9f4cb0f61d7e0da862a95897d7bc777f62
netfilter: nfnetlink: work around wrong endianess in res_id field

commit a9de9777d613500b089a7416f936bf3ae5f070d2 upstream.

The convention in nfnetlink is to use network byte order in every header field
as well as in the attribute payload. The initial version of the batching
infrastructure assumes that res_id comes in host byte order though.

The only client of the batching infrastructure is nf_tables, so let's add a
workaround to address this inconsistency. We currently have 11 nfnetlink
subsystems according to NFNL_SUBSYS_COUNT, so we can assume that the subsystem
2560, ie. htons(10), will not be allocated anytime soon, so it can be an alias
of nf_tables from the nfnetlink batching path when interpreting the res_id
field.

Based on original patch from Florian Westphal.

Reported-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/nfnetlink.c