]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_log: incorrect offset to network header
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 5 Jul 2022 08:26:15 +0000 (10:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Jul 2022 19:24:23 +0000 (21:24 +0200)
commit05970b17b0614b5064da26c73e802d2f41107471
tree7182b5dc0353fe982d28606520ed95c7c3ae0ff9
parent5e34c65ba03b6dfd8ca619e8ee99fcf5bc5b85cf
netfilter: nf_log: incorrect offset to network header

[ Upstream commit f74897c32f93782eccbf3754b6b155a6559b56ff ]

NFPROTO_ARP is expecting to find the ARP header at the network offset.

In the particular case of ARP, HTYPE= field shows the initial bytes of
the ethernet header destination MAC address.

 netdev out: IN= OUT=bridge0 MACSRC=c2:76:e5:71:e1:de MACDST=36:b0:4a:e2:72:ea MACPROTO=0806 ARP HTYPE=14000 PTYPE=0x4ae2 OPCODE=49782

NFPROTO_NETDEV egress hook is also expecting to find the IP headers at
the network offset.

Fixes: 363ce390b061 ("netfilter: add generic ARP packet logger")
Reported-by: Tom Yan <tom.ty89@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nf_log_syslog.c