History log of /lxc/src/lxc/sync.c
Revision Date Author Comments Expand
9e0148cfda29169f26b6d578eee3e583ce082813 11-May-2016 Serge Hallyn <serge.hallyn@ubuntu.com>

Unshare netns after setting the userns mappings so that there is a root uid mapping for the /proc/net files. Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>

e1a2c96c0d14a8b83bc141b4116dc87dadb639e6 11-May-2016 Christian Brauner <christian.brauner@mailbox.org>

sync.c: use correct types Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>

f55f607dcba8698956ffebcd5df9c63f1da9dca3 11-May-2016 Tycho Andersen <tycho.andersen@canonical.com>

sync: fail on unexpected message sizes I think (?) this may be related to our hanging monitor bug. Let's do this anyway, as it's probably a good idea. Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>

ea720ff1d0bf82557888b400e8866227f7545cc1 24-Mar-2016 Aleksandr Mezin <mezin.alexander@gmail.com>

sync: add LXC_SYNC_ERROR to report errors from another process. Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>

dd1d77f91b3eb5b9b02f97d81c6c1c6c29563c03 24-Dec-2013 Andrey Mazo <mazo@telum.ru>

Remove process_lock() except where actually needed Functions like open(), close(), socket(), socketpair(), pipe() and mkdir() are generally thin wrappers around kernel-provided system calls. It's the kernel not libc, who ensures race-free handling of file descriptors. Thus locking around these functions is unnecessary even on somewhat buggy libcs. fopen(), fclose() and other stdio functions may maintain internal lists of open file handles and thus can be prone to race-conditions. Hopefully, most libcs utilize proper locking or other ways to ensure thread-safety of these functions. Bionic used to have non-thread-safe stdio [2] but that must be fixed since android 4.3 [3, 4]. S.Çağlar Onur showed [1] that openpty() (because of nsswitch) is not thread-safe though. So we workaround it by protecting openpty() calls with process_lock()/process_unlock(). Because of the need to guard openpty() with process_lock()/process_unlock(), process_unlock() is still used after fork(). This commit reverts most of 025ed0f3911836b71f498d8368725c77a7e1932a. [1] https://github.com/lxc/lxc/pull/106#issuecomment-31077269 [2] https://bugzilla.mozilla.org/show_bug.cgi?id=687367 [3] https://android.googlesource.com/platform/bionic/+/f582340a6a48588aa50da17e1620e8f91b146941 [4] https://android.googlesource.com/platform/bionic/+/6b3f49a5374305ce9690c3c5ca2aadc90f54c521 Signed-off-by: Andrey Mazo <mazo@telum.ru> Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>

025ed0f3911836b71f498d8368725c77a7e1932a 18-Sep-2013 Serge Hallyn <serge.hallyn@ubuntu.com>

make heavier use of process_lock (v2) pthread_mutex_lock() will only return an error if it was set to PTHREAD_MUTEX_ERRORCHECK and we are recursively calling it (and would otherwise have deadlocked). If that's the case then log a message for future debugging and exit. Trying to "recover" is nonsense at that point. process_lock() was held over too long a time in lxcapi_start() in the daemonize case. (note the non-daemonized case still needs a check to enforce that it must NOT be called while threaded). Add process_lock() at least across all open/close/socket() calls. Anything done after a fork() doesn't need the locks as it is no longer threaded - so some open/close/dups()s are not locked for that reason. However, some common functions are called from both threaded and non-threaded contexts. So after doing a fork(), do a possibly-extraneous process_unlock() to make sure that, if we were forked while pthread mutex was held, we aren't deadlocked by nobody. Tested that lp:~serge-hallyn/+junk/lxc-test still works with this patch. Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com> Tested-by: S.Çağlar Onur <caglar@10ur.org> Acked-by: Stéphane Graber <stgraber@ubuntu.com>

250b1eec71b074acdff1c5f6b5a1f0d7d2c20b77 03-Sep-2013 Stéphane Graber <stgraber@ubuntu.com>

licensing: Add missing headers and FSF address Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>

/lxc/autogen.sh /lxc/doc/common_options.sgml.in /lxc/doc/legacy/lxc-ls.sgml.in /lxc/doc/lxc-attach.sgml.in /lxc/doc/lxc-cgroup.sgml.in /lxc/doc/lxc-checkconfig.sgml.in /lxc/doc/lxc-checkpoint.sgml.in /lxc/doc/lxc-clone.sgml.in /lxc/doc/lxc-console.sgml.in /lxc/doc/lxc-create.sgml.in /lxc/doc/lxc-destroy.sgml.in /lxc/doc/lxc-device.sgml.in /lxc/doc/lxc-execute.sgml.in /lxc/doc/lxc-freeze.sgml.in /lxc/doc/lxc-info.sgml.in /lxc/doc/lxc-kill.sgml.in /lxc/doc/lxc-ls.sgml.in /lxc/doc/lxc-monitor.sgml.in /lxc/doc/lxc-netstat.sgml.in /lxc/doc/lxc-ps.sgml.in /lxc/doc/lxc-restart.sgml.in /lxc/doc/lxc-start-ephemeral.sgml.in /lxc/doc/lxc-start.sgml.in /lxc/doc/lxc-stop.sgml.in /lxc/doc/lxc-top.sgml.in /lxc/doc/lxc-unfreeze.sgml.in /lxc/doc/lxc-unshare.sgml.in /lxc/doc/lxc-version.sgml.in /lxc/doc/lxc-wait.sgml.in /lxc/doc/lxc.conf.sgml.in /lxc/doc/lxc.sgml.in /lxc/doc/see_also.sgml.in /lxc/hooks/mountcgroups /lxc/hooks/mountecryptfsroot /lxc/lxc.spec.in /lxc/runapitests.sh /lxc/src/include/getline.c /lxc/src/include/getline.h /lxc/src/include/lxcmntent.c /lxc/src/include/lxcmntent.h /lxc/src/include/openpty.c /lxc/src/include/openpty.h af_unix.c af_unix.h apparmor.c apparmor.h arguments.c arguments.h attach.c attach.h attach_options.h bdev.c bdev.h caps.c caps.h cgroup.c cgroup.h checkpoint.c commands.c commands.h conf.c conf.h confile.c confile.h console.c console.h error.c error.h execute.c freezer.c genl.c genl.h legacy/lxc-ls.in list.c list.h log.c log.h lxc-destroy.in lxc-device lxc-ls lxc-netstat.in lxc-ps.in lxc-start-ephemeral.in lxc.functions.in lxc.h lxc_attach.c lxc_cgroup.c lxc_checkpoint.c lxc_config.c lxc_console.c lxc_execute.c lxc_freeze.c lxc_info.c lxc_init.c lxc_kill.c lxc_monitor.c lxc_monitord.c lxc_restart.c lxc_start.c lxc_stop.c lxc_unfreeze.c lxc_unshare.c lxc_usernsexec.c lxc_wait.c lxccontainer.h lxcseccomp.h lxcutmp.c lxcutmp.h mainloop.c mainloop.h monitor.c monitor.h namespace.c namespace.h network.c network.h nl.c nl.h parse.c parse.h restart.c rtnl.c rtnl.h seccomp.c start.c start.h state.c state.h sync.c sync.h utils.c utils.h version.c version.h /lxc/src/python-lxc/examples/api_test.py /lxc/src/python-lxc/examples/pyconsole-vte.py /lxc/src/python-lxc/examples/pyconsole.py /lxc/src/python-lxc/lxc.c /lxc/src/python-lxc/lxc/__init__.py /lxc/src/python-lxc/setup.py /lxc/src/tests/lxc-test-usernic /lxc/templates/lxc-altlinux.in /lxc/templates/lxc-archlinux.in /lxc/templates/lxc-busybox.in /lxc/templates/lxc-debian.in /lxc/templates/lxc-fedora.in /lxc/templates/lxc-opensuse.in /lxc/templates/lxc-oracle.in /lxc/templates/lxc-sshd.in
9afe19d634946d50eab30e3b90cb5cebcde39eea 19-Mar-2013 Daniel Lezcano <daniel.lezcano@free.fr>

Change author email address Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>

/lxc/MAINTAINERS /lxc/doc/common_options.sgml.in /lxc/doc/lxc-attach.sgml.in /lxc/doc/lxc-cgroup.sgml.in /lxc/doc/lxc-checkpoint.sgml.in /lxc/doc/lxc-clone.sgml.in /lxc/doc/lxc-console.sgml.in /lxc/doc/lxc-create.sgml.in /lxc/doc/lxc-destroy.sgml.in /lxc/doc/lxc-execute.sgml.in /lxc/doc/lxc-freeze.sgml.in /lxc/doc/lxc-kill.sgml.in /lxc/doc/lxc-ls.sgml.in /lxc/doc/lxc-monitor.sgml.in /lxc/doc/lxc-ps.sgml.in /lxc/doc/lxc-restart.sgml.in /lxc/doc/lxc-start.sgml.in /lxc/doc/lxc-stop.sgml.in /lxc/doc/lxc-unfreeze.sgml.in /lxc/doc/lxc-unshare.sgml.in /lxc/doc/lxc-wait.sgml.in /lxc/doc/lxc.conf.sgml.in /lxc/doc/lxc.sgml.in /lxc/doc/see_also.sgml.in /lxc/lxc.spec.in af_unix.c af_unix.h arguments.c arguments.h attach.c attach.h caps.c caps.h cgroup.c cgroup.h checkpoint.c commands.c commands.h conf.c conf.h confile.c confile.h console.c console.h error.c error.h execute.c freezer.c genl.c genl.h list.c log.h lxc.h lxc_attach.c lxc_cgroup.c lxc_checkpoint.c lxc_console.c lxc_execute.c lxc_freeze.c lxc_info.c lxc_init.c lxc_kill.c lxc_monitor.c lxc_restart.c lxc_start.c lxc_stop.c lxc_unfreeze.c lxc_unshare.c lxc_wait.c lxcutmp.c lxcutmp.h mainloop.c mainloop.h monitor.c monitor.h namespace.c namespace.h network.c network.h nl.c nl.h parse.c parse.h restart.c rtnl.c rtnl.h start.c start.h state.c state.h stop.c sync.c sync.h utils.c utils.h version.c version.h
3c22086fe242c1cbb51e1df4add3052d3618c2ca 26-May-2010 Cedric Le Goater <clg@linux.vnet.ibm.com>

introduce a sync API The following patch wrap the calls on the synchronisation socketpair in a lxc_sync_ API. It hopefully clarifies what is done in the start sequence to the expense of more lines of code ... Signed-off-by: Cedric Le Goater <clg@fr.ibm.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>