kernel_samsung_a53x/net/tipc
Xin Long c689db3957 tipc: force a dst refcount before doing decryption
[ Upstream commit 2ebe8f840c7450ecbfca9d18ac92e9ce9155e269 ]

As it says in commit 3bc07321ccc2 ("xfrm: Force a dst refcount before
entering the xfrm type handlers"):

"Crypto requests might return asynchronous. In this case we leave the
 rcu protected region, so force a refcount on the skb's destination
 entry before we enter the xfrm type input/output handlers."

On TIPC decryption path it has the same problem, and skb_dst_force()
should be called before doing decryption to avoid a possible crash.

Shuang reported this issue when this warning is triggered:

  [] WARNING: include/net/dst.h:337 tipc_sk_rcv+0x1055/0x1ea0 [tipc]
  [] Kdump: loaded Tainted: G W --------- - - 4.18.0-496.el8.x86_64+debug
  [] Workqueue: crypto cryptd_queue_worker
  [] RIP: 0010:tipc_sk_rcv+0x1055/0x1ea0 [tipc]
  [] Call Trace:
  [] tipc_sk_mcast_rcv+0x548/0xea0 [tipc]
  [] tipc_rcv+0xcf5/0x1060 [tipc]
  [] tipc_aead_decrypt_done+0x215/0x2e0 [tipc]
  [] cryptd_aead_crypt+0xdb/0x190
  [] cryptd_queue_worker+0xed/0x190
  [] process_one_work+0x93d/0x17e0

Fixes: fc1b6d6de220 ("tipc: introduce TIPC encryption & authentication")
Reported-by: Shuang Li <shuali@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Link: https://lore.kernel.org/r/fbe3195fad6997a4eec62d9bf076b2ad03ac336b.1718476040.git.lucien.xin@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 14:19:08 +01:00
..
addr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
addr.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bcast.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bcast.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bearer.c tipc: Check the bearer type before calling tipc_udp_nl_bearer_add() 2024-11-18 12:13:25 +01:00
bearer.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
core.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
crypto.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
crypto.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
diag.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
discover.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
discover.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
eth_media.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
group.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
group.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ib_media.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
link.c tipc: Use size_add() in calls to struct_size() 2024-11-18 11:42:47 +01:00
link.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
monitor.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
monitor.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
msg.c tipc: fix UAF in error path 2024-11-19 11:32:48 +01:00
msg.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
name_distr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
name_distr.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
name_table.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
name_table.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
net.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
net.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
netlink.c tipc: Change nla_policy for bearer-related names to NLA_NUL_STRING 2024-11-18 11:43:07 +01:00
netlink.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
netlink_compat.c tipc: Fix kernel-infoleak due to uninitialized TLV value 2024-11-18 11:43:19 +01:00
node.c tipc: force a dst refcount before doing decryption 2024-11-19 14:19:08 +01:00
node.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
socket.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
socket.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
subscr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
subscr.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sysctl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
topsrv.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
topsrv.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
trace.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
trace.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
udp_media.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
udp_media.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00