OrangePi_CM5/net/tipc
Xin Long 4951ffa3fa tipc: do not write skb_shinfo frags when doing decrytion
[ Upstream commit 3cf4375a090473d240281a0d2b04a3a5aaeac34b ]

One skb's skb_shinfo frags are not writable, and they can be shared with
other skbs' like by pskb_copy(). To write the frags may cause other skb's
data crash.

So before doing en/decryption, skb_cow_data() should always be called for
a cloned or nonlinear skb if req dst is using the same sg as req src.
While at it, the likely branch can be removed, as it will be covered
by skb_cow_data().

Note that esp_input() has the same issue, and I will fix it in another
patch. tipc_aead_encrypt() doesn't have this issue, as it only processes
linear data in the unlikely branch.

Fixes: fc1b6d6de2 ("tipc: introduce TIPC encryption & authentication")
Reported-by: Shuang Li <shuali@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Jon Maloy <jmaloy@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-08-04 12:46:43 +02:00
..
Kconfig
…
Makefile
…
addr.c
…
addr.h
…
bcast.c net: tipc: fix FB_MTU eat two pages 2021-07-14 16:56:32 +02:00
bcast.h
…
bearer.c tipc: fix unique bearer names sanity check 2021-06-10 13:39:22 +02:00
bearer.h
…
core.c tipc: wait and exit until all work queues are done 2021-06-03 09:00:37 +02:00
core.h tipc: wait and exit until all work queues are done 2021-06-03 09:00:37 +02:00
crypto.c tipc: do not write skb_shinfo frags when doing decrytion 2021-08-04 12:46:43 +02:00
crypto.h
…
diag.c
…
discover.c
…
discover.h
…
eth_media.c
…
group.c
…
group.h
…
ib_media.c
…
link.c tipc: fix NULL deref in tipc_link_xmit() 2021-01-23 16:04:00 +01:00
link.h
…
monitor.c
…
monitor.h
…
msg.c net: tipc: fix FB_MTU eat two pages 2021-07-14 16:56:32 +02:00
msg.h net: tipc: fix FB_MTU eat two pages 2021-07-14 16:56:32 +02:00
name_distr.c
…
name_distr.h
…
name_table.c
…
name_table.h
…
net.c
…
net.h
…
netlink.c
…
netlink.h
…
netlink_compat.c tipc: convert dest node's address to network order 2021-05-19 10:12:52 +02:00
node.c tipc: better validate user input in tipc_nl_retrieve_key() 2021-03-30 14:31:59 +02:00
node.h
…
socket.c tipc: fix sleeping in tipc accept routine 2021-08-04 12:46:42 +02:00
socket.h
…
subscr.c
…
subscr.h
…
sysctl.c
…
topsrv.c tipc: fix memory leak in tipc_topsrv_start() 2020-11-11 14:39:23 -08:00
topsrv.h
…
trace.c
…
trace.h
…
udp_media.c tipc: wait and exit until all work queues are done 2021-06-03 09:00:37 +02:00
udp_media.h
…