xfrm: Refuse to insert 32 bit userspace socket policies on 64 bit systems
authorSteffen Klassert <steffen.klassert@secunet.com>
Thu, 1 Feb 2018 07:49:23 +0000 (08:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 8 Apr 2018 12:26:29 +0000 (14:26 +0200)
commitdffe655ddb48ee1b2165ca9250a54376199e3764
treec490ba67fb98f46fadc0d821405d2cbf59e31b5c
parenta6232ffa2a021d7e8ce6822fad3a51d4728de9fa
xfrm: Refuse to insert 32 bit userspace socket policies on 64 bit systems

commit 19d7df69fdb2636856dc8919de72fc1bf8f79598 upstream.

We don't have a compat layer for xfrm, so userspace and kernel
structures have different sizes in this case. This results in
a broken configuration, so refuse to configure socket policies
when trying to insert from 32 bit userspace as we do it already
with policies inserted via netlink.

Reported-and-tested-by: syzbot+e1a1577ca8bcb47b769a@syzkaller.appspotmail.com
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/xfrm/xfrm_state.c