| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
nla_len() has no valid reason to fail or return a negative number.
Callers are not allowed to call this on an invalid structure. They
usually would call nla_validate() first.
However, as it returns a signed "int", coverity assumes that in some
cases the value could be negative. That results in coverity warning like
Error: INTEGER_OVERFLOW (CWE-190):
libnl-3.9.0/lib/route/nh.c:339: tainted_data_return: Called function "nla_len(tb[NHA_GROUP])", and a possible return value may be less than zero.
libnl-3.9.0/lib/route/nh.c:339: cast_underflow: An assign of a possibly negative number to an unsigned type, which might trigger an underflow.
libnl-3.9.0/lib/route/nh.c:340: overflow: The expression "len / 8UL" is deemed underflowed because at least one of its arguments has underflowed.
libnl-3.9.0/lib/route/nh.c:340: cast_overflow: An assign that casts to a different type, which might trigger an overflow.
libnl-3.9.0/lib/route/nh.c:342: overflow_sink: "size", which might have underflowed, is passed to "rtnl_nh_grp_info(size, (struct nexthop_grp const *)data, &nh_group)".
# 340| size = len / sizeof(struct nexthop_grp);
# 341|
# 342|-> err = rtnl_nh_grp_info(size, (const struct nexthop_grp *)data,
# 343| &nh_group);
# 344| if (err < 0) {
Add an internal _nla_len() with an API that clearly cannot return
negative values. Also, add _nl_assert() which in debug builds do some
consistency checks on the argument.
https://issues.redhat.com/browse/RHEL-34299
|
|
|
|
| |
We have those defines. Use them throughout.
|
|
|
|
| |
$ ./tools/clang-format.sh
|
|
|
|
|
|
| |
As we now copy all linux headers, and we have include/linux-private
in our include search path, just include the linux headers as we commonly
do.
|
| |
|
| |
|
|
|
|
|
| |
Move all the declarations from "netlink-private/types.h" to places
closer to where they are used.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have "include/netlink-private/netlink.h", which is private
API used internally.
However, it's confusing where "include/netlink-private/netlink.h" can be
used. For example, it contains some "libnl-route-3.so" specific
extensions like "link_lookup()", hence you would think that it
can only be used with libraries that also use "libnl-route-3.so".
Well, since it's a header, you actually can also use it for example
under "lib/xfrm/", you couldn't just use those declarations because they
are implemented and accessible only under "lib/route/"
In a first step to clean this up, and move helper to separate headers,
add "include/nl-aux-{core,route}" headers with certain clear usage.
Clear in the sense who may use those headers, and what the
implementation of those headers may use.
|
|
|
|
|
|
| |
- use consistent name _DIFF() for macro
- spell out the full attribute, and don't join the name via ##.
|
|
|