[lxc-devel] [lxc/lxc] 0cf455: fix realloc() error on reboot container

GitHub noreply at github.com
Thu Feb 27 20:09:24 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 0cf455013da475954207feb1ed0a437f4891be03
      https://github.com/lxc/lxc/commit/0cf455013da475954207feb1ed0a437f4891be03
  Author: Vitaly Lavrov <vel21ripn at gmail.com>
  Date:   2014-02-27 (Thu, 27 Feb 2014)

  Changed paths:
    M src/lxc/conf.c

  Log Message:
  -----------
  fix realloc() error on reboot container

The container with "lxc.network.type=phys" halted with error on reboot.

Error message:
*** glibc detected *** lxc-start: realloc(): invalid pointer: 0x0948eed0 ***

We have a sequence:

1) conf->saved_nic = relloc(NULL) on start start.c:container save_phys_nics()
2) free(conf->saved_nics) after stop container
   conf.c:lxc_rename_phys_nics_on_shutdown()
3) conf->saved_nic = relloc(conf->saved_nics) on restart container
   start.c:save_phys_nics() -> error relloc()

free(conf->saved_nics) in lxc_rename_phys_nics_on_shutdown()
unnecessary, it will be called later in lxc_clear_saved_nics().

Signed-off-by: Vitaly Lavrov <vel21ripn at gmail.com>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>


  Commit: 5292adfd22c0249880ea529f67a534269e62a7c8
      https://github.com/lxc/lxc/commit/5292adfd22c0249880ea529f67a534269e62a7c8
  Author: S.Çağlar Onur <caglar at 10ur.org>
  Date:   2014-02-27 (Thu, 27 Feb 2014)

  Changed paths:
    M src/lxc/bdev.c

  Log Message:
  -----------
  bdev: do not crash if specs is NULL

Signed-off-by: S.Çağlar Onur <caglar at 10ur.org>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>


Compare: https://github.com/lxc/lxc/compare/c661b0a8fe9e...5292adfd22c0


More information about the lxc-devel mailing list