[PATCH] tipc: fix a missing check of genlmsg_put

Subsystems: networking [general], the rest, tipc network layer

STALE2829d

2 messages, 2 authors, 2018-12-28 · open the first message on its own page

[PATCH] tipc: fix a missing check of genlmsg_put

From: Kangjie Lu <hidden>
Date: 2018-12-26 06:09:40

genlmsg_put could fail. The fix inserts a check of its return value, and
if it fails, returns -EMSGSIZE.

Signed-off-by: Kangjie Lu <redacted>
---
 net/tipc/netlink_compat.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c
index 6376467e78f8..764aa29612ea 100644
--- a/net/tipc/netlink_compat.c
+++ b/net/tipc/netlink_compat.c
@@ -904,6 +904,8 @@ static int tipc_nl_compat_publ_dump(struct tipc_nl_compat_msg *msg, u32 sock)
 
 	hdr = genlmsg_put(args, 0, 0, &tipc_genl_family, NLM_F_MULTI,
 			  TIPC_NL_PUBL_GET);
+	if (!hdr)
+		return -EMSGSIZE;
 
 	nest = nla_nest_start(args, TIPC_NLA_SOCK);
 	if (!nest) {
-- 
2.17.2 (Apple Git-113)

Re: [PATCH] tipc: fix a missing check of genlmsg_put

From: David Miller <davem@davemloft.net>
Date: 2018-12-28 00:27:09

From: Kangjie Lu <redacted>
Date: Wed, 26 Dec 2018 00:09:04 -0600
genlmsg_put could fail. The fix inserts a check of its return value, and
if it fails, returns -EMSGSIZE.

Signed-off-by: Kangjie Lu <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help