OrangePi_CM5/net/tipc
Xin Long f31dd15858 tipc: fix the msg->req tlv len check in tipc_nl_compat_name_table_dump_header
[ Upstream commit 1c075b192fe41030457cd4a5f7dea730412bca40 ]

This is a follow-up for commit 974cb0e3e7 ("tipc: fix uninit-value
in tipc_nl_compat_name_table_dump") where it should have type casted
sizeof(..) to int to work when TLV_GET_DATA_LEN() returns a negative
value.

syzbot reported a call trace because of it:

  BUG: KMSAN: uninit-value in ...
   tipc_nl_compat_name_table_dump+0x841/0xea0 net/tipc/netlink_compat.c:934
   __tipc_nl_compat_dumpit+0xab2/0x1320 net/tipc/netlink_compat.c:238
   tipc_nl_compat_dumpit+0x991/0xb50 net/tipc/netlink_compat.c:321
   tipc_nl_compat_recv+0xb6e/0x1640 net/tipc/netlink_compat.c:1324
   genl_family_rcv_msg_doit net/netlink/genetlink.c:731 [inline]
   genl_family_rcv_msg net/netlink/genetlink.c:775 [inline]
   genl_rcv_msg+0x103f/0x1260 net/netlink/genetlink.c:792
   netlink_rcv_skb+0x3a5/0x6c0 net/netlink/af_netlink.c:2501
   genl_rcv+0x3c/0x50 net/netlink/genetlink.c:803
   netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
   netlink_unicast+0xf3b/0x1270 net/netlink/af_netlink.c:1345
   netlink_sendmsg+0x1288/0x1440 net/netlink/af_netlink.c:1921
   sock_sendmsg_nosec net/socket.c:714 [inline]
   sock_sendmsg net/socket.c:734 [inline]

Reported-by: syzbot+e5dbaaa238680ce206ea@syzkaller.appspotmail.com
Fixes: 974cb0e3e7 ("tipc: fix uninit-value in tipc_nl_compat_name_table_dump")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Link: https://lore.kernel.org/r/ccd6a7ea801b15aec092c3b532a883b4c5708695.1667594933.git.lucien.xin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-11-16 09:57:11 +01:00
..
Kconfig
…
Makefile
…
addr.c
…
addr.h
…
bcast.c
…
bcast.h
…
bearer.c
…
bearer.h
…
core.c tipc: fix use-after-free Read in tipc_named_reinit 2022-06-29 08:59:47 +02:00
core.h
…
crypto.c
…
crypto.h
…
diag.c
…
discover.c tipc: Fix recognition of trial period 2022-10-30 09:41:16 +01:00
discover.h
…
eth_media.c
…
group.c
…
group.h
…
ib_media.c
…
link.c
…
link.h
…
monitor.c tipc: fix shift wrapping bug in map_get() 2022-09-15 11:32:05 +02:00
monitor.h
…
msg.c
…
msg.h
…
name_distr.c
…
name_distr.h
…
name_table.c
…
name_table.h
…
net.c
…
net.h
…
netlink.c
…
netlink.h
…
netlink_compat.c tipc: fix the msg->req tlv len check in tipc_nl_compat_name_table_dump_header 2022-11-16 09:57:11 +01:00
node.c tipc: move bc link creation back to tipc_node_create 2022-07-07 17:52:18 +02:00
node.h
…
socket.c net: Fix data-races around sysctl_[rw]mem(_offset)?. 2022-08-31 17:15:19 +02:00
socket.h
…
subscr.c
…
subscr.h
…
sysctl.c
…
topsrv.c tipc: fix a null-ptr-deref in tipc_topsrv_accept 2022-11-03 23:57:51 +09:00
topsrv.h
…
trace.c
…
trace.h
…
udp_media.c
…
udp_media.h
…