Go to file
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
.travis travis: build tests with NL_MORE_ASSERTS enabled 2019-08-09 16:48:55 +02:00
doc libnl-3.4.0 release 2017-10-09 13:14:55 +02:00
etc pktloc: fix typo for tcp.flag.syn 2015-02-17 15:26:15 +01:00
include utils: add internal helper macros for cleanup 2019-08-09 16:48:55 +02:00
lib xfrm: fix memory corruption (dangling pointer) when when setting xfrmnl_sa 2019-08-09 16:48:55 +02:00
m4 m4/ax*.m4: remove 2015-07-09 22:43:18 +02:00
man build: merge man/Makefile.am into top-level makefile 2017-02-27 13:20:34 +01:00
python build: merge python/Makefile.am into top-level makefile 2017-02-27 13:20:34 +01:00
src nl-neigh-list: free allocated items 2018-06-25 13:57:34 +02:00
tests tests: use nl_send_auto() instead of deprecated nl_send_auto_complete() in test-genl.c 2019-08-07 14:44:58 +02:00
tools tools: fix building doc in build_release.sh 2017-05-03 12:00:12 +02:00
.gitignore build: merge tests/Makefile.am into top-level makefile 2017-02-27 13:20:34 +01:00
.indent.pro style: add .indent.pro file for GNU indent 2014-07-27 10:57:36 +02:00
.travis.yml build: Add continuous integration support via travis-ci 2014-08-26 12:41:38 +02:00
autogen.sh build: let autogen.sh script change into top source directory 2014-07-07 11:12:38 +02:00
ChangeLog libnl 3.2.10 2012-06-06 11:43:53 +02:00
configure.ac libnl-3.4.0 release 2017-10-09 13:14:55 +02:00
COPYING Update COPYING to fix FSF address 2012-01-17 12:38:37 +01:00
libnl-3.0.pc.in Switch to libtool versioning system 2011-09-13 22:58:08 +02:00
libnl-3.sym lib: merge implementations of nl_attr_end() and nl_attr_keep_empty() 2018-02-12 14:17:11 +01:00
libnl-cli-3.0.pc.in Add libnl-cli-3.0 to pkg-config tool 2011-10-10 11:39:24 +02:00
libnl-cli-3.sym link/neigh: add flags option to link and neighbor caches 2015-11-19 16:48:21 +01:00
libnl-genl-3.0.pc.in Switch to libtool versioning system 2011-09-13 22:58:08 +02:00
libnl-genl-3.sym build/trivial: reorder symbols in linker version scripts and add comment 2015-03-04 17:41:45 +01:00
libnl-idiag-3.0.pc.in Add support for inet diag Netlink protocol. 2013-07-19 02:06:21 -07:00
libnl-idiag-3.sym build/trivial: reorder symbols in linker version scripts and add comment 2015-03-04 17:41:45 +01:00
libnl-nf-3.0.pc.in Switch to libtool versioning system 2011-09-13 22:58:08 +02:00
libnl-nf-3.sym build/trivial: reorder symbols in linker version scripts and add comment 2015-03-04 17:41:45 +01:00
libnl-route-3.0.pc.in Switch to libtool versioning system 2011-09-13 22:58:08 +02:00
libnl-route-3.sym route/link: expose IFLA_INFO_SLAVE_KIND 2018-10-22 15:20:19 +02:00
libnl-xfrm-3.0.pc.in xfrm: add xfrm support 2014-07-20 18:14:46 +02:00
libnl-xfrm-3.sym build: don't export internal symbols 2015-02-02 17:28:06 +01:00
Makefile.am route:act: add vlan action 2018-10-10 11:12:08 +02:00