xfrm: fix null pointer dereference on state and tmpl sort
authorKoichiro Den <den@klaipeden.com>
Tue, 1 Aug 2017 14:21:46 +0000 (23:21 +0900)
committerSteffen Klassert <steffen.klassert@secunet.com>
Wed, 2 Aug 2017 11:37:37 +0000 (13:37 +0200)
commit3f5a95ad6c6c05e6b00f0c20e30da66c986564d5
treeb455549c1a6116277a7aa50f5ea2b7e761cc54c9
parente6194923237f3952b955c343b65b211f36bce01c
xfrm: fix null pointer dereference on state and tmpl sort

Creating sub policy that matches the same outer flow as main policy does
leads to a null pointer dereference if the outer mode's family is ipv4.
For userspace compatibility, this patch just eliminates the crash i.e.,
does not introduce any new sorting rule, which would fruitlessly affect
all but the aforementioned case.

Signed-off-by: Koichiro Den <den@klaipeden.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_state.c