An integer overflow vulnerability was found in nlmsg_reserve() triggered by crafted @len argument resulting into reserving too few bytes. Upstream patch: http://git.infradead.org/users/tgr/libnl.git/commit/3e18948f17148e6a3c4255bdeaaf01ef6081ceeb
Created libnl3 tracking bugs for this issue: Affects: fedora-all [bug 1440789]
Analysis: The commit messages raises a very important point about libnl: "In general, libnl functions are not robust against calling with invalid arguments. Thus, never call libnl functions with invalid arguments. In case of nlmsg_reserve() this means never provide a @len argument that causes overflow." The function nlmsg_reserve() is called with a very large value of len, later when the following code is run, it results in a integer overflow: "tlen = pad ? ((len + (pad - 1)) & ~(pad - 1)) : len;" This later causes too small a buffer to be allocated and buffer overflow when data is eventually copied into it. The commit however assumes that arguement "pad" is untrued, in case it is not, this may causes additional issues. Also other functions may need an audit, if libnl API functions are called with untrusted value and the assumption is that libnl will sanitize them. (Which does not currently happen). Finally this may cause arbitrary code execution in the context of the user running the library.
This issue has been addressed in the following products: Red Hat Enterprise Linux 7 Via RHSA-2017:2299 https://access.redhat.com/errata/RHSA-2017:2299