Skip to content
Commit 21a3a70c authored by Herbert Xu's avatar Herbert Xu Committed by Greg Kroah-Hartman
Browse files

xfrm: Silence warnings triggerable by bad packets

[ Upstream commit 57010b8e

 ]

After the elimination of inner modes, a couple of warnings that
were previously unreachable can now be triggered by malformed
inbound packets.

Fix this by:

1. Moving the setting of skb->protocol into the decap functions.
2. Returning -EINVAL when unexpected protocol is seen.

Reported-by: default avatarMaciej <Żenczykowski&lt;maze@google.com>
Fixes: 5f24f41e

 ("xfrm: Remove inner/outer modes from input path")
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Reviewed-by: default avatarMaciej Żenczykowski <maze@google.com>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 6d1e6152
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment