aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorRichard Alpe <richard.alpe@ericsson.com>2015-08-17 08:15:10 -0400
committerDavid S. Miller <davem@davemloft.net>2015-08-17 13:39:54 -0400
commit8f8ff9135b28a7560a5627aceaf289e3f0d4cd64 (patch)
tree8b772622f82142d1e4950d9985a8180580d0cdeb /net/tipc
parentda3cc2da7c08dc1f4371a4cc2eb83b22a0cf83a8 (diff)
tipc: don't sanity check non-existing TLV (NL compat)
A zero length payload means that no TLV (Type Length Value) data has been passed. Prior to this patch a non-existing TLV could be sanity checked with TLV_OK() resulting in random behavior where a user sending an empty message occasionally got a incorrect "operation not supported" message back. Signed-off-by: Richard Alpe <richard.alpe@ericsson.com> Reviewed-by: Erik Hugne <erik.hugne@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/netlink_compat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c
index 53e0fee80086..1eadc95e1132 100644
--- a/net/tipc/netlink_compat.c
+++ b/net/tipc/netlink_compat.c
@@ -1114,7 +1114,7 @@ static int tipc_nl_compat_recv(struct sk_buff *skb, struct genl_info *info)
1114 } 1114 }
1115 1115
1116 len = nlmsg_attrlen(req_nlh, GENL_HDRLEN + TIPC_GENL_HDRLEN); 1116 len = nlmsg_attrlen(req_nlh, GENL_HDRLEN + TIPC_GENL_HDRLEN);
1117 if (TLV_GET_LEN(msg.req) && !TLV_OK(msg.req, len)) { 1117 if (len && !TLV_OK(msg.req, len)) {
1118 msg.rep = tipc_get_err_tlv(TIPC_CFG_NOT_SUPPORTED); 1118 msg.rep = tipc_get_err_tlv(TIPC_CFG_NOT_SUPPORTED);
1119 err = -EOPNOTSUPP; 1119 err = -EOPNOTSUPP;
1120 goto send; 1120 goto send;