[PATCH iproute2] iplink_geneve: correct size of message to avoid spurious errors

Subsystems: the rest

STALE3067d REVIEWED: 1 (0M)

1 review trailer.

2 messages, 2 authors, 2018-04-21 · open the first message on its own page

[PATCH iproute2] iplink_geneve: correct size of message to avoid spurious errors

From: Jakub Kicinski <hidden>
Date: 2018-04-18 18:06:31

Commit 6c4b672738ac ("iplink_geneve: Get rid of inet_get_addr()")
inadvertently changed the parameter to addattr_l() resulting in:

addattr_l ERROR: message exceeded bound of 4

when remote is specified.

Fixes: 6c4b672738ac ("iplink_geneve: Get rid of inet_get_addr()")
Signed-off-by: Jakub Kicinski <redacted>
Reviewed-by: Quentin Monnet <redacted>
---
 ip/iplink_geneve.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ip/iplink_geneve.c b/ip/iplink_geneve.c
index 1fcdd83acca9..26e70ff4db42 100644
--- a/ip/iplink_geneve.c
+++ b/ip/iplink_geneve.c
@@ -199,7 +199,7 @@ static int geneve_parse_opt(struct link_util *lu, int argc, char **argv,
 	if (is_addrtype_inet(&daddr)) {
 		int type = (daddr.family == AF_INET) ? IFLA_GENEVE_REMOTE :
 						       IFLA_GENEVE_REMOTE6;
-		addattr_l(n, sizeof(1024), type, daddr.data, daddr.bytelen);
+		addattr_l(n, 1024, type, daddr.data, daddr.bytelen);
 	}
 	if (!set_op || GENEVE_ATTRSET(attrs, IFLA_GENEVE_LABEL))
 		addattr32(n, 1024, IFLA_GENEVE_LABEL, label);
-- 
2.16.2

Re: [PATCH iproute2] iplink_geneve: correct size of message to avoid spurious errors

From: William Tu <hidden>
Date: 2018-04-21 04:15:00

On Wed, Apr 18, 2018 at 11:06 AM, Jakub Kicinski
[off-list ref] wrote:
Commit 6c4b672738ac ("iplink_geneve: Get rid of inet_get_addr()")
inadvertently changed the parameter to addattr_l() resulting in:

addattr_l ERROR: message exceeded bound of 4

when remote is specified.

Fixes: 6c4b672738ac ("iplink_geneve: Get rid of inet_get_addr()")
Signed-off-by: Jakub Kicinski <redacted>
Reviewed-by: Quentin Monnet <redacted>
---
Thanks. We also hit this issue when creating geneve tunnel.

Acked-by: William Tu <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help