summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-04-22 20:03:41 (GMT)
committerThomas Haller <thaller@redhat.com>2022-04-22 20:05:10 (GMT)
commitf918c3a427d3470cf3b7885537310e7a73c501bf (patch)
treed0c81d593eb0d8a1ee829c30bf8c255cdea47fa7
parentd4c79722c8f956af30b127133bd12edb9f673fc6 (diff)
downloadlibnl-f918c3a427d3470cf3b7885537310e7a73c501bf.zip
libnl-f918c3a427d3470cf3b7885537310e7a73c501bf.tar.gz
libnl-f918c3a427d3470cf3b7885537310e7a73c501bf.tar.bz2
route/sriov: fix buffer overflow in rtnl_link_sriov_parse_vflist()
Coverity: Error: OVERRUN (CWE-119): libnl-3.6.0/lib/route/link/sriov.c:653: overrun-buffer-arg: Overrunning array "stb" of 6 8-byte elements by passing it to a function which accesses it at element index 8 (byte offset 71) u # 651|ยทยทยท # 652| if (t[IFLA_VF_STATS]) { # 653|-> err = nla_parse_nested(stb, IFLA_VF_STATS_MAX, # 654| t[IFLA_VF_STATS], # 655| sriov_stats_policy); Fixes: 5d6e43ebef12 ('lib/route: SRIOV Parse and Read support')
-rw-r--r--lib/route/link/sriov.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/route/link/sriov.c b/lib/route/link/sriov.c
index 3b4c028..ebc4e6a 100644
--- a/lib/route/link/sriov.c
+++ b/lib/route/link/sriov.c
@@ -648,7 +648,7 @@ int rtnl_link_sriov_parse_vflist(struct rtnl_link *link, struct nlattr **tb) {
}
if (t[IFLA_VF_STATS]) {
- err = nla_parse_nested(stb, IFLA_VF_STATS_MAX,
+ err = nla_parse_nested(stb, RTNL_LINK_VF_STATS_MAX,
t[IFLA_VF_STATS],
sriov_stats_policy);
if (err < 0) {