All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/netlink_compat: Fix a missing check of nla_parse_nested
@ 2018-12-24  0:54 Aditya Pakki
  2018-12-24 22:42 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Aditya Pakki @ 2018-12-24  0:54 UTC (permalink / raw)
  To: pakki001
  Cc: kjlu, Jon Maloy, Ying Xue, David S. Miller, netdev,
	tipc-discussion, linux-kernel

In tipc_nl_compat_sk_dump(), if nla_parse_nested() fails, it could return
an error. To be consistent with other invocations of the function call,
on error, the fix passes the return value upstream.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
---
 net/tipc/netlink_compat.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c
index 6376467e78f8..21f6ccc89401 100644
--- a/net/tipc/netlink_compat.c
+++ b/net/tipc/netlink_compat.c
@@ -951,8 +951,11 @@ static int tipc_nl_compat_sk_dump(struct tipc_nl_compat_msg *msg,
 		u32 node;
 		struct nlattr *con[TIPC_NLA_CON_MAX + 1];
 
-		nla_parse_nested(con, TIPC_NLA_CON_MAX,
-				 sock[TIPC_NLA_SOCK_CON], NULL, NULL);
+		err = nla_parse_nested(con, TIPC_NLA_CON_MAX,
+				       sock[TIPC_NLA_SOCK_CON], NULL, NULL);
+
+		if (err)
+			return err;
 
 		node = nla_get_u32(con[TIPC_NLA_CON_NODE]);
 		tipc_tlv_sprintf(msg->rep, "  connected to <%u.%u.%u:%u>",
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net/netlink_compat: Fix a missing check of nla_parse_nested
  2018-12-24  0:54 [PATCH] net/netlink_compat: Fix a missing check of nla_parse_nested Aditya Pakki
@ 2018-12-24 22:42 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-12-24 22:42 UTC (permalink / raw)
  To: pakki001; +Cc: kjlu, jon.maloy, ying.xue, netdev, tipc-discussion, linux-kernel

From: Aditya Pakki <pakki001@umn.edu>
Date: Sun, 23 Dec 2018 18:54:53 -0600

> In tipc_nl_compat_sk_dump(), if nla_parse_nested() fails, it could return
> an error. To be consistent with other invocations of the function call,
> on error, the fix passes the return value upstream.
> 
> Signed-off-by: Aditya Pakki <pakki001@umn.edu>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-24 22:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-24  0:54 [PATCH] net/netlink_compat: Fix a missing check of nla_parse_nested Aditya Pakki
2018-12-24 22:42 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.