Bug 203867 - invalid parameter to NL_SET_ERR_MSG_ATTR() in vxlan.c and geneve.c
Summary: invalid parameter to NL_SET_ERR_MSG_ATTR() in vxlan.c and geneve.c
Status: NEW
Alias: None
Product: Networking
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Stephen Hemminger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-12 07:49 UTC by Kirill Kuteynikov
Modified: 2019-06-12 07:49 UTC (History)
0 users

See Also:
Kernel Version: v5.2.0-rc4
Subsystem:
Regression: No
Bisected commit-id:


Attachments
patch for vxlan.c and geneve.c (5.71 KB, patch)
2019-06-12 07:49 UTC, Kirill Kuteynikov
Details | Diff

Description Kirill Kuteynikov 2019-06-12 07:49:06 UTC
Created attachment 283213 [details]
patch for vxlan.c and geneve.c

Looks like invalid 'attr' parameter is passed to NL_SET_ERR_MSG_ATTR() in drivers/net/vxlan.c and drivers/net/geneve.c for number of attributes.

For example `tb[IFLA_VXLAN_PORT_RANGE]` instead of `data[IFLA_VXLAN_PORT_RANGE]` in piece of code below.

	if (data[IFLA_VXLAN_PORT_RANGE]) {
		const struct ifla_vxlan_port_range *p
			= nla_data(data[IFLA_VXLAN_PORT_RANGE]);

		if (ntohs(p->high) < ntohs(p->low)) {
			NL_SET_ERR_MSG_ATTR(extack, tb[IFLA_VXLAN_PORT_RANGE],
					    "Invalid source port range");
			return -EINVAL;
		}
	}

In case this is really a bug, patch is provided in attach.

Note You need to log in before you can comment on or make changes to this bug.