WSL2-Linux-Kernel/net/tipc
Taras Kondratiuk 4da5f0018e tipc: compat: allow tipc commands without arguments
Commit 2753ca5d90 ("tipc: fix uninit-value in tipc_nl_compat_doit")
broke older tipc tools that use compat interface (e.g. tipc-config from
tipcutils package):

% tipc-config -p
operation not supported

The commit started to reject TIPC netlink compat messages that do not
have attributes. It is too restrictive because some of such messages are
valid (they don't need any arguments):

% grep 'tx none' include/uapi/linux/tipc_config.h
#define  TIPC_CMD_NOOP              0x0000    /* tx none, rx none */
#define  TIPC_CMD_GET_MEDIA_NAMES   0x0002    /* tx none, rx media_name(s) */
#define  TIPC_CMD_GET_BEARER_NAMES  0x0003    /* tx none, rx bearer_name(s) */
#define  TIPC_CMD_SHOW_PORTS        0x0006    /* tx none, rx ultra_string */
#define  TIPC_CMD_GET_REMOTE_MNG    0x4003    /* tx none, rx unsigned */
#define  TIPC_CMD_GET_MAX_PORTS     0x4004    /* tx none, rx unsigned */
#define  TIPC_CMD_GET_NETID         0x400B    /* tx none, rx unsigned */
#define  TIPC_CMD_NOT_NET_ADMIN     0xC001    /* tx none, rx none */

This patch relaxes the original fix and rejects messages without
arguments only if such arguments are expected by a command (reg_type is
non zero).

Fixes: 2753ca5d90 ("tipc: fix uninit-value in tipc_nl_compat_doit")
Cc: stable@vger.kernel.org
Signed-off-by: Taras Kondratiuk <takondra@cisco.com>
Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-08-01 18:14:00 -04:00
..
Kconfig docs: kbuild: convert docs to ReST and rename to *.rst 2019-06-14 14:21:21 -06:00
Makefile
addr.c
addr.h
bcast.c tipc: rename function msg_get_wrapped() to msg_inner_hdr() 2019-06-25 13:42:54 -07:00
bcast.h
bearer.c tipc: use rcu dereference functions properly 2019-07-07 13:18:53 -07:00
bearer.h
core.c tipc: change to use register_pernet_device 2019-06-22 16:51:47 -07:00
core.h
diag.c
discover.c
discover.h
eth_media.c
group.c tipc: purge deferredq list for each grp member in tipc_group_delete 2019-06-16 20:42:05 -07:00
group.h
ib_media.c
link.c tipc: embed jiffies in macro TIPC_BC_RETR_LIM 2019-07-01 19:10:57 -07:00
link.h tipc: fix missing Name entries due to half-failover 2019-05-04 00:59:51 -04:00
monitor.c netlink: make nla_nest_start() add NLA_F_NESTED flag 2019-04-27 17:03:44 -04:00
monitor.h
msg.c
msg.h tipc: rename function msg_get_wrapped() to msg_inner_hdr() 2019-06-25 13:42:54 -07:00
name_distr.c tipc: ensure head->lock is initialised 2019-07-12 15:34:26 -07:00
name_distr.h
name_table.c netlink: make nla_nest_start() add NLA_F_NESTED flag 2019-04-27 17:03:44 -04:00
name_table.h
net.c netlink: make validation more configurable for future strictness 2019-04-27 17:07:21 -04:00
net.h
netlink.c tipc: fix missing indentation in source code 2019-06-24 07:29:45 -07:00
netlink.h
netlink_compat.c tipc: compat: allow tipc commands without arguments 2019-08-01 18:14:00 -04:00
node.c tipc: initialize 'validated' field of received packets 2019-07-17 15:24:38 -07:00
node.h tipc: improve TIPC throughput by Gap ACK blocks 2019-04-04 18:29:25 -07:00
socket.c tipc: fix unitilized skb list crash 2019-07-30 14:39:36 -07:00
socket.h
subscr.c
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 tipc: Fix a typo 2019-07-21 11:41:01 -07:00
topsrv.h
trace.c
trace.h
udp_media.c tipc: use rcu dereference functions properly 2019-07-07 13:18:53 -07:00
udp_media.h