]> git.baikalelectronics.ru Git - kernel.git/commit
erspan: fix version 1 check in gre_parse_header()
authorCong Wang <cong.wang@bytedance.com>
Sat, 26 Dec 2020 23:44:53 +0000 (15:44 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Dec 2020 23:00:00 +0000 (15:00 -0800)
commit542f9677ace1919e04c84897111be491a86f68eb
tree4b992a0305aacd4c478f123be520be8633002f40
parent55791e3a922018cdeacd0e99903edfd39ff83580
erspan: fix version 1 check in gre_parse_header()

Both version 0 and version 1 use ETH_P_ERSPAN, but version 0 does not
have an erspan header. So the check in gre_parse_header() is wrong,
we have to distinguish version 1 from version 0.

We can just check the gre header length like is_erspan_type1().

Fixes: f44dc4c91ff8 ("net: ip_gre: use erspan key field for tunnel lookup")
Reported-by: syzbot+f583ce3d4ddf9836b27a@syzkaller.appspotmail.com
Cc: William Tu <u9012063@gmail.com>
Cc: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/gre_demux.c