third_party_libnl/lib
Thomas Haller 77ae25aad1 xfrm: fix memory corruption (dangling pointer) when when setting xfrmnl_sa
The follow leaves a dangling pointer when the name argument is too long:

xfrmnl_sa_set_aead_params:

    if (sa->aead)
        free (sa->aead);
    if (   strlen (alg_name) >= sizeof (sa->aead->alg_name)
        || (sa->aead = calloc (1, newlen)) == NULL)
        return -1;

Fix that, but do more:

- ensure that we don't modify the object when the setter is going to
  fail. That means, first check whether we can succeed with all the
  steps that are requested, and (in case we cannot) fail without
  modifing the target object.

- bonus points for making the setter self-assignment safe by reordering
  the setting and freeing of the memory.
2019-08-09 16:48:55 +02:00
..
cli include: don't include kernel headers in public libnl3 headers 2017-03-02 01:33:25 +01:00
fib_lookup lib: switch to using strerror_l() instead of strerror_r() 2016-08-25 17:32:57 +02:00
genl lib/genl: avoid VLA in cmd_msg_parser() 2019-08-09 16:48:55 +02:00
idiag trivial: whitespace-only fixes for src and lib 2016-08-12 23:06:27 +02:00
netfilter all: declare all variables at the beginning of scope (-Wdeclaration-after-statement) 2018-01-16 06:45:23 +01:00
route link/sriov: fix memleak in rtnl_link_sriov_clone() 2019-08-08 17:01:21 +02:00
xfrm xfrm: fix memory corruption (dangling pointer) when when setting xfrmnl_sa 2019-08-09 16:48:55 +02:00
.gitignore Added lex.yy.c to .gitignore 2012-08-30 03:19:04 +06:00
addr.c addr: Add support for AF_MPLS 2017-08-18 15:01:04 +02:00
attr.c attr: mark nested attributes as NLA_F_NESTED 2019-08-07 15:32:19 +02:00
cache_mngr.c cache: make "result" output argument for nl_cache_mngr_add() optional 2018-04-11 12:19:01 +02:00
cache_mngt.c cache: assert in nl_cache_mngt_register() for valid oo_keygen() function 2014-11-25 10:44:26 +01:00
cache.c cache: fix GCC warning and avoid variable shadowing 2016-12-02 13:37:35 +01:00
data.c lib/data.c: avoid memleak if realloc fails 2017-06-08 10:59:21 +02:00
error.c lib: return error on Netlink attribute length overflow 2016-06-24 19:32:25 +02:00
handlers.c lib: switch to using strerror_l() instead of strerror_r() 2016-08-25 17:32:57 +02:00
hash.c all: avoid compiler warnings -Wimplicit-fallthrough 2017-06-15 18:52:53 +02:00
hashtable.c Move private header files to <netlink-private/*> 2013-01-24 13:51:24 +01:00
mpls.c addr: Add implementations for mpls_ntop and mpls_pton 2017-08-18 15:01:04 +02:00
msg.c nl-msg: explicitly initialize nlmsg_seq and nlmsg_pid field in nlmsg_alloc_simple() 2018-04-11 12:48:44 +02:00
nl.c nl: fix function name in debug msg 2018-06-25 13:55:22 +02:00
object.c trivial: whitespace-only fixes for src and lib 2016-08-12 23:06:27 +02:00
socket.c lib: use MSG_PEEK by default for nl_recvmsgs() 2016-11-30 15:40:26 +01:00
utils.c route/vlan: add capability to indicate heap overflow fix in rtnl_link_vlan_set_egress_map() 2017-10-23 12:10:30 +02:00
version.c Run-time version information is now available 2012-08-30 03:19:04 +06:00