OpenCloudOS-Kernel/net/tipc
Jon Maloy 1dc7903296 tipc: improve size validations for received domain records
commit 9aa422ad32 upstream.

The function tipc_mon_rcv() allows a node to receive and process
domain_record structs from peer nodes to track their views of the
network topology.

This patch verifies that the number of members in a received domain
record does not exceed the limit defined by MAX_MON_DOMAIN, something
that may otherwise lead to a stack overflow.

tipc_mon_rcv() is called from the function tipc_link_proto_rcv(), where
we are reading a 32 bit message data length field into a uint16.  To
avert any risk of bit overflow, we add an extra sanity check for this in
that function.  We cannot see that happen with the current code, but
future designers being unaware of this risk, may introduce it by
allowing delivery of very large (> 64k) sk buffers from the bearer
layer.  This potential problem was identified by Eric Dumazet.

This fixes CVE-2022-0435

Reported-by: Samuel Page <samuel.page@appgate.com>
Reported-by: Eric Dumazet <edumazet@google.com>
Fixes: 35c55c9877 ("tipc: add neighbor monitoring framework")
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
Reviewed-by: Xin Long <lucien.xin@gmail.com>
Reviewed-by: Samuel Page <samuel.page@appgate.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Fuhai Wang <fuhaiwang@tencent.com>
2024-06-11 20:44:35 +08:00
..
Kconfig docs: kbuild: convert docs to ReST and rename to *.rst 2019-06-14 14:21:21 -06:00
Makefile tipc: enable tracepoints in tipc 2018-12-19 11:49:24 -08:00
addr.c tipc: initialise addr_trail_end when setting node addresses 2019-08-11 21:40:04 -07:00
addr.h tipc: add 128-bit node identifier 2018-03-23 13:12:18 -04:00
bcast.c tkernel: add base tlinux kernel interfaces 2024-06-11 20:09:33 +08:00
bcast.h tipc: fix a null pointer deref 2019-03-21 09:56:55 -07:00
bearer.c tipc: add loopback device tracking 2019-08-08 22:11:39 -07:00
bearer.h tipc: add loopback device tracking 2019-08-08 22:11:39 -07:00
core.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
core.h ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
diag.c tipc: switch to rhashtable iterator 2018-08-29 18:04:54 -07:00
discover.c tipc: fix lockdep warning when reinitilaizing sockets 2018-11-17 22:01:31 -08:00
discover.h tipc: some cleanups in the file discover.c 2018-03-23 13:12:17 -04:00
eth_media.c tipc: make media address offset a common define 2015-02-27 18:18:48 -05:00
group.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
group.h tipc: extend sock diag for group communication 2018-06-30 21:05:42 +09:00
ib_media.c tipc: rename media/msg related definitions 2015-02-27 18:18:48 -05:00
link.c tipc: improve size validations for received domain records 2024-06-11 20:44:35 +08:00
link.h tipc: fix missing Name entries due to half-failover 2019-05-04 00:59:51 -04:00
monitor.c tipc: improve size validations for received domain records 2024-06-11 20:44:35 +08:00
monitor.h tkernel: add base tlinux kernel interfaces 2024-06-11 20:09:33 +08:00
msg.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
msg.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-19 11:54:03 -07:00
name_distr.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-09-15 14:17:27 +02:00
name_distr.h tipc: permit overlapping service ranges in name table 2018-03-31 22:19:52 -04:00
name_table.c netlink: make nla_nest_start() add NLA_F_NESTED flag 2019-04-27 17:03:44 -04:00
name_table.h tipc: eliminate message disordering during binding table update 2018-10-22 19:29:12 -07:00
net.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
net.h ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
netlink.c tkernel: add base tlinux kernel interfaces 2024-06-11 20:09:33 +08:00
netlink.h tipc: make cluster size threshold for monitoring configurable 2016-07-26 14:26:42 -07:00
netlink_compat.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
node.c tipc: clean up skb list lock handling on send path 2019-08-18 14:01:07 -07:00
node.h tipc: optimize link synching mechanism 2019-07-25 15:55:47 -07:00
socket.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
socket.h tipc: add trace_events for tipc socket 2018-12-19 11:49:24 -08:00
subscr.c tipc: fix unbalanced reference counter 2018-04-12 21:46:10 -04:00
subscr.h tipc: fix modprobe tipc failed after switch order of device registration 2019-05-20 10:45:43 -07:00
sysctl.c proc/sysctl: add shared variables for range check 2019-07-18 17:08:07 -07:00
topsrv.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
topsrv.h tipc: rename tipc_server to tipc_topsrv 2018-02-16 15:26:34 -05:00
trace.c tipc: remove unneeded semicolon in trace.c 2019-01-17 22:04:43 -08:00
trace.h tipc: add trace_events for tipc bearer 2018-12-19 11:49:25 -08:00
udp_media.c ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
udp_media.h tipc: implement configuration of UDP media MTU 2018-04-20 11:04:05 -04:00