android_kernel_motorola_sm6375/net/xfrm
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Dmitry Safonov e6d3c97bac UPSTREAM: xfrm/compat: Translate by copying XFRMA_UNSPEC attribute
xfrm_xlate32() translates 64-bit message provided by kernel to be sent
for 32-bit listener (acknowledge or monitor). Translator code doesn't
expect XFRMA_UNSPEC attribute as it doesn't know its payload.
Kernel never attaches such attribute, but a user can.

I've searched if any opensource does it and the answer is no.
Nothing on github and google finds only tfcproject that has such code
commented-out.

What will happen if a user sends a netlink message with XFRMA_UNSPEC
attribute? Ipsec code ignores this attribute. But if there is a
monitor-process or 32-bit user requested ack - kernel will try to
translate such message and will hit WARN_ONCE() in xfrm_xlate64_attr().

Deal with XFRMA_UNSPEC by copying the attribute payload with
xfrm_nla_cpy(). In result, the default switch-case in xfrm_xlate64_attr()
becomes an unused code. Leave those 3 lines in case a new xfrm attribute
will be added.

Fixes: 5461fc0c8d9f ("xfrm/compat: Add 64=>32-bit messages translator")
Reported-by: syzbot+a7e701c8385bd8543074@syzkaller.appspotmail.com
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
(cherry picked from commit dbd7ae5154d5fff7e84a9f3010bb06499017ef29)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I11e05ca491155a1dd28f8820ded7ada096595075
2021-05-03 20:55:11 -07:00
..
Kconfig UPSTREAM: xfrm/compat: Add 32=>64-bit messages translator 2020-11-02 15:48:50 +00:00
Makefile BACKPORT: xfrm: Provide API to register translator module 2020-11-02 15:48:23 +00:00
xfrm_algo.c
xfrm_compat.c UPSTREAM: xfrm/compat: Translate by copying XFRMA_UNSPEC attribute 2021-05-03 20:55:11 -07:00
xfrm_device.c xfrm: Fix double ESP trailer insertion in IPsec crypto offload. 2020-06-30 15:36:53 -04:00
xfrm_hash.c
xfrm_hash.h
xfrm_inout.h
xfrm_input.c xfrm: allow to accept packets with ipv6 NEXTHDR_HOP in xfrm_input 2020-06-03 08:21:31 +02:00
xfrm_interface.c UPSTREAM: xfrm: interface: use icmp_ndo_send helper 2021-03-05 06:50:46 +01:00
xfrm_ipcomp.c net: Use skb_frag_off accessors 2019-07-30 14:21:32 -07:00
xfrm_output.c xfrm: fix a NULL-ptr deref in xfrm_local_error 2020-06-03 08:21:33 +02:00
xfrm_policy.c xfrm: policy: match with both mark and mask on user interfaces 2020-08-05 09:59:44 +02:00
xfrm_proc.c
xfrm_replay.c
xfrm_state.c UPSTREAM: net: xfrm: fix memory leak in xfrm_user_policy() 2021-05-03 20:54:32 -07:00
xfrm_sysctl.c
xfrm_user.c ANDROID: Temporarily disable XFRM_USER_COMPAT filtering 2020-11-05 21:08:28 +00:00