android_kernel_samsung_a7y1.../net/tipc
Xin Long 6a2d4652a1 tipc: check msg->req data len in tipc_nl_compat_bearer_disable
[ Upstream commit 4f07b80c973348a99b5d2a32476a2e7877e94a05 ]

This patch is to fix an uninit-value issue, reported by syzbot:

  BUG: KMSAN: uninit-value in memchr+0xce/0x110 lib/string.c:981
  Call Trace:
    __dump_stack lib/dump_stack.c:77 [inline]
    dump_stack+0x191/0x1f0 lib/dump_stack.c:113
    kmsan_report+0x130/0x2a0 mm/kmsan/kmsan.c:622
    __msan_warning+0x75/0xe0 mm/kmsan/kmsan_instr.c:310
    memchr+0xce/0x110 lib/string.c:981
    string_is_valid net/tipc/netlink_compat.c:176 [inline]
    tipc_nl_compat_bearer_disable+0x2a1/0x480 net/tipc/netlink_compat.c:449
    __tipc_nl_compat_doit net/tipc/netlink_compat.c:327 [inline]
    tipc_nl_compat_doit+0x3ac/0xb00 net/tipc/netlink_compat.c:360
    tipc_nl_compat_handle net/tipc/netlink_compat.c:1178 [inline]
    tipc_nl_compat_recv+0x1b1b/0x27b0 net/tipc/netlink_compat.c:1281

TLV_GET_DATA_LEN() may return a negtive int value, which will be
used as size_t (becoming a big unsigned long) passed into memchr,
cause this issue.

Similar to what it does in tipc_nl_compat_bearer_enable(), this
fix is to return -EINVAL when TLV_GET_DATA_LEN() is negtive in
tipc_nl_compat_bearer_disable(), as well as in
tipc_nl_compat_link_stat_dump() and tipc_nl_compat_link_reset_stats().

v1->v2:
  - add the missing Fixes tags per Eric's request.

Fixes: 0762216c0ad2 ("tipc: fix uninit-value in tipc_nl_compat_bearer_enable")
Fixes: 8b66fee7f8ee ("tipc: fix uninit-value in tipc_nl_compat_link_reset_stats")
Reported-by: syzbot+30eaa8bf392f7fafffaf@syzkaller.appspotmail.com
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-06 19:17:27 +02:00
..
addr.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
addr.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bcast.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bcast.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bearer.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bearer.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
core.c tipc: change to use register_pernet_device 2020-04-06 19:17:25 +02:00
core.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
discover.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
discover.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
eth_media.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ib_media.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
link.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
link.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
msg.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
msg.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
name_distr.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
name_distr.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
name_table.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
name_table.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
net.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
net.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
netlink_compat.c tipc: check msg->req data len in tipc_nl_compat_bearer_disable 2020-04-06 19:17:27 +02:00
netlink.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
netlink.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
node.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
node.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
server.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
server.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
socket.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
socket.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
subscr.c tipc: fix modprobe tipc failed after switch order of device registration -v2 2020-04-06 18:20:58 +02:00
subscr.h tipc: fix modprobe tipc failed after switch order of device registration -v2 2020-04-06 18:20:58 +02:00
sysctl.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
udp_media.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30