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)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sat, 9 Jul 2022 07:55:43 +0000 (09:55 +0200)
commit7a847c00eeba9744353ecdfad253143b9115678a
tree334ddb11e408b95bc8f44e8daac2284abce96aa3
parent0ed8f619b412b52360ccdfaf997223ccd9319569
netfilter: nf_log: incorrect offset to network header

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: 35b9395104d5 ("netfilter: add generic ARP packet logger")
Reported-by: Tom Yan <tom.ty89@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_log_syslog.c