]>
git.ipfire.org Git - thirdparty/lxc.git/log
Christian Brauner [Sun, 1 Dec 2019 18:39:48 +0000 (19:39 +0100)]
cgroups/devices: introduce ebpf device cgroup global rule types
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sun, 1 Dec 2019 17:25:00 +0000 (18:25 +0100)]
cgroups/devices: handle NULL
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sun, 1 Dec 2019 16:04:43 +0000 (17:04 +0100)]
configure: enable -Wunused-but-set-variable
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sat, 30 Nov 2019 18:33:19 +0000 (19:33 +0100)]
cgroups/cgfsng: implement cgroup2 device controller live update
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sat, 30 Nov 2019 15:05:44 +0000 (16:05 +0100)]
conf: record cgroup2 devices in parsed format
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sat, 30 Nov 2019 14:21:00 +0000 (15:21 +0100)]
cgroups/cgfsng: "atomically" replace bpf device programs
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sat, 30 Nov 2019 14:00:29 +0000 (15:00 +0100)]
macro: remove unused macros
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 28 Nov 2019 15:22:36 +0000 (16:22 +0100)]
cgroups: add cgroup2 device controller support
Add a bpf-based device controller implementation.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
LiFeng [Wed, 27 Nov 2019 08:59:23 +0000 (03:59 -0500)]
cgfsng: return attach fail if container stopped
Signed-off-by: LiFeng <lifeng68@huawei.com>
Balázs Póka [Wed, 20 Nov 2019 19:57:28 +0000 (20:57 +0100)]
fix wrong order of bridge/nic in error message
Signed-off-by: Balázs Póka <poka@idata.hu>
Rachid Koucha [Wed, 20 Nov 2019 12:03:47 +0000 (13:03 +0100)]
Typo in a comment
"above" was used instead of "below"
Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>
Christian Brauner [Mon, 18 Nov 2019 14:08:22 +0000 (15:08 +0100)]
tests: use /dev/loop-control instead of /dev/network_latency
BugLink: https://bugs.launchpad.net/bugs/1848587
The latter device has been removed apparently.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Fabrice Fontaine [Mon, 11 Nov 2019 21:55:36 +0000 (22:55 +0100)]
configure.ac: fix build on toolchain without SSP
Commit
3b5a0eebd4d2efdaa03c6fb11950abfcf081fab8 reverted
3aa7271157d3c815a4426c1f8eaea2f3b6dafa6a resulting in lxc being unable
to be built on toolchain without SSP support
Fixes:
- http://autobuild.buildroot.org/results/
57945f54ffbc5c8764b6891a4516c4907e56ab97
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Aaditya Murthy [Sat, 9 Nov 2019 18:17:08 +0000 (12:17 -0600)]
Update cgroup.h
Fixed the documentation to say that cgroupv2 uses a unified hierarchy
Signed-off-by: Aaditya Murthy <amurthy123@utexas.edu>
Christian Brauner [Wed, 6 Nov 2019 13:08:55 +0000 (14:08 +0100)]
terminal: prevent returning invalid pointer
Closes: https://github.com/lxc/lxd/issues/6408
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 6 Nov 2019 13:03:43 +0000 (14:03 +0100)]
terminal: make lxc_terminal_signal_fini() static
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Serge Hallyn [Fri, 1 Nov 2019 05:34:02 +0000 (00:34 -0500)]
lxc-usernsexec: support easily mapping own uid
Signed-off-by: Serge Hallyn <shallyn@cisco.com>
Florian Margaine [Tue, 29 Oct 2019 09:53:17 +0000 (10:53 +0100)]
tests: add tests making sure the exit code is appropriate.
lxc2 broke this feature for lxc-execute, and lxc3 broke it for
lxc-attach. This adds a test making sure we don't do the same mistake
a third time.
Signed-off-by: Florian Margaine <florian@platform.sh>
Wolfgang Bumiller [Tue, 29 Oct 2019 07:42:59 +0000 (08:42 +0100)]
terminal: return NULL on error in terminal_signal_init
Callers expect a NULL on error, and with PR #3171 marking
the pointer as __do_free, we now return a pointer to freed
memory here otherwise.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Christian Brauner [Fri, 25 Oct 2019 09:45:55 +0000 (11:45 +0200)]
terminal: prevent memory leak for lxc_terminal_state
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Patrick Havelange [Tue, 22 Oct 2019 10:29:54 +0000 (12:29 +0200)]
syscall_wrappers: rename internal memfd_create to memfd_create_lxc
In case the internal memfd_create has to be used, make sure we don't
clash with the already existing memfd_create function from glibc.
This can happen if this glibc function is a stub. In this case, at
./configure time, the test for this function will return false, however
the declaration of that function is still available. This leads to
compilation errors.
Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
Thomas Parrott [Mon, 14 Oct 2019 09:10:21 +0000 (10:10 +0100)]
lxc/tools/lxc/destroy: Restores error message on container destroy
Partially reverts
65b92ea5fcab559fd21be2685bd2f15ef6d33532 so that trying to destroy a non-existent container gives an error message.
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
KATOH Yasufumi [Sat, 12 Oct 2019 16:39:52 +0000 (01:39 +0900)]
Update lxc.containers.conf(5) in Japanese
Update for commit
767bd70
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Rachid Koucha [Sat, 12 Oct 2019 11:05:50 +0000 (13:05 +0200)]
Bad sgml/man translation
When calling "man lxc.container.conf", an internal "man" keyword is displayed :
$ man lxc.container.conf
[...]
lxc.mount.entry
Specify a mount point corresponding to a line in the fstab format. Moreover lxc supports mount propagation, such as
rslave or rprivate, and adds three additional mount options. optional don't fail if mount does not work. create=dir
or create=file to create dir (or file) when the point will be mounted. relative source path is taken to be relative to
the mounted container root. For instance,
dev/null proc/kcore none bind,relative 0 0
.fi <-----------------------------------UNEXPECTED KEYWORD !!!!
The problem seems to come from the missing blanks before "dev/null proc/kcore none bind,relative 0 0"
Moreover, for homogeneity purposes, it is better to use the "programlisting" tag used in the rest of the text instead of "screen".
Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>
KATOH Yasufumi [Fri, 11 Oct 2019 07:06:20 +0000 (16:06 +0900)]
Add more info about lxc.start.order in Japanese man
Update for commit
0684250
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Caio B. Silva [Wed, 9 Oct 2019 19:00:58 +0000 (16:00 -0300)]
lxc-destroy: send successful output messages to log info instead of error.
Signed-off-by: Caio B. Silva <caioboffo@gmail.com>
Lukas Jelinek [Wed, 9 Oct 2019 10:15:48 +0000 (12:15 +0200)]
doc: Add more info about 'lxc.start.order'
Signed-off-by: Lukas Jelinek <lukas.jelinek@nic.cz>
Caio B. Silva [Tue, 1 Oct 2019 14:36:05 +0000 (11:36 -0300)]
update obsolete functions
Signed-off-by: Caio B. Silva <caioboffo@gmail.com>
Christian Brauner [Sat, 13 Apr 2019 14:41:30 +0000 (16:41 +0200)]
start: handle setting pdeath signal in new pidns
In the usual case the child runs in a separate pid namespace. So far we haven't
been able to reliably set the pdeath signal. When we set the pdeath signal we
need to verify that we haven't lost a race whereby we have been orphaned and
though we have set a pdeath signal it won't help us since, well, the parent is
dead.
We were able to correctly handle this case when we were in the same pidns since
getppid() will return a valid pid. When we are in a separate pidns 0 will be
returned since the parent doesn't exist in our pidns.
A while back, while Jann and I were discussing other things he came up with a
nifty idea: simply pass an fd for the parent's status file and check the
"State:" field. This is the implementation of that idea.
Suggested-by: Jann Horn <jann@thejh.net>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Fri, 4 Oct 2019 08:31:41 +0000 (10:31 +0200)]
start: pidfds obviously start - like any fd - at 0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Alban VIDAL [Thu, 3 Oct 2019 16:32:47 +0000 (18:32 +0200)]
Fix lxc-update-config in network.address
Signed-off-by: Alban VIDAL <zordhak@debian.org>
Caio B. Silva [Mon, 30 Sep 2019 12:25:00 +0000 (09:25 -0300)]
allow users to configure the option --enable-feature or --with-package, if an option is given run shell commands action-if-given
Signed-off-by: Caio B. Silva <caioboffo@gmail.com>
Caio B. Silva [Fri, 27 Sep 2019 16:35:43 +0000 (13:35 -0300)]
Set minimun autoconf version to 2.69 and change obsolete function AC_HELP_STRING for AS_HELP_STRING
Signed-off-by: Caio B. Silva <caioboffo@gmail.com>
KATOH Yasufumi [Thu, 19 Sep 2019 16:15:12 +0000 (01:15 +0900)]
doc: Add Japanese pam_cgfs(8) man page
* translate pam_cgfs(8)
* support --{enable,disable}-{commands,tools} in doc/ja
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Venkata Harshavardhan Reddy Allu [Wed, 18 Sep 2019 13:08:23 +0000 (18:38 +0530)]
doc: add man page for pam_cgfs
Signed-off-by: Venkata Harshavardhan Reddy Allu <venkataharshavardhan_ven@srmuniv.edu.in>
Caio B. Silva [Mon, 16 Sep 2019 17:22:33 +0000 (14:22 -0300)]
Ensures OpenSSL compatibility with older versions of EVP API.
Signed-off-by: Caio B. Silva <caioboffo@gmail.com>
Julio Faracco [Thu, 5 Sep 2019 04:43:21 +0000 (01:43 -0300)]
utils: Copying source filename to avoid missing info.
Some applications use information from LOOP_GET_STATUS64. The file
associated with loop device is pointed inside structure field
`lo_file_name`. The current code is setting up a loop device without
this information. A legacy example of code checking this is cryptsetup:
static char *_ioctl_backing_file(const char *loop)
{
struct loop_info64 lo64 = {0};
int loop_fd;
loop_fd = open(loop, O_RDONLY);
if (loop_fd < 0)
return NULL;
if (ioctl(loop_fd, LOOP_GET_STATUS64, &lo64) < 0) {
close(loop_fd);
return NULL;
}
lo64.lo_file_name[LO_NAME_SIZE-2] = '*';
lo64.lo_file_name[LO_NAME_SIZE-1] = 0;
close(loop_fd);
return strdup((char*)lo64.lo_file_name);
}
It will return an empty string because lo_file_name was not set.
Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Christian Brauner [Mon, 2 Sep 2019 21:51:19 +0000 (23:51 +0200)]
cgroups: unify cgfsng_{un}freeze()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 29 Aug 2019 12:05:17 +0000 (14:05 +0200)]
cgroups: initialize cgroup root directory - encore
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 29 Aug 2019 11:56:56 +0000 (13:56 +0200)]
cgroups: check for empty cgroups on freeze/unfreeze
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 28 Aug 2019 18:33:39 +0000 (20:33 +0200)]
cgroups: initialize cgroup root directory
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Pierre-Elliott Bécue [Sat, 10 Aug 2019 20:07:42 +0000 (22:07 +0200)]
[aa-profile] Deny access to /proc/acpi/**
Signed-off-by: Pierre-Elliott Bécue <becue@crans.org>
Antonio Terceiro [Sun, 18 Aug 2019 20:30:32 +0000 (17:30 -0300)]
lxc-attach: make sure exit status of command is returned
Commit
ae68cad763d5b39a6a9e51de2acd1ad128b720ca introduced a regression that
makes lxc-attach ignore the exit status of the executed command. This was first
identified in 3.0.4 LTS, while it worked on 3.0.3.
# lxc-attach --version
3.0.4
# lxc-attach -n test false; echo $?
0
Signed-off-by: Antonio Terceiro <terceiro@debian.org>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=934983
Christian Brauner [Mon, 26 Aug 2019 14:16:16 +0000 (16:16 +0200)]
cgfsng: mount pure unified cgroup layout correctly
When pure cgroup unified mode is used we cannot pre-mount a tmpfs as this
confuses systemd.
Users should also set lxc.mount.auto = cgroup:force to ensure that systemd in
the container and on the host use identical cgroup layouts.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
qianfan Zhao [Mon, 19 Aug 2019 01:54:34 +0000 (09:54 +0800)]
lxc-create: check absoule path for param '--dir'
Fix: #3123
Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
Christian Brauner [Thu, 15 Aug 2019 17:50:39 +0000 (19:50 +0200)]
cgroups: support cgroup2 freezer
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Wolfgang Bumiller [Tue, 13 Aug 2019 12:17:30 +0000 (14:17 +0200)]
attach: don't close stdout of getent
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Alexander Kriventsov [Mon, 29 Jul 2019 16:33:39 +0000 (19:33 +0300)]
try to fix search user instead of search substring
Signed-off-by: Alexander Kriventsov <akriventsov@nic.ru>
Thomas Parrott [Fri, 26 Jul 2019 15:14:18 +0000 (16:14 +0100)]
lxccontainer: do_lxcapi_detach_interface to support detaching wlan devices
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
Lukas Pirl [Mon, 22 Jul 2019 12:29:52 +0000 (14:29 +0200)]
suppress false-negative error in templates and nvidia hook
``/proc`` might be mounted with ``hidepid=2``.
This makes ``/proc/1/…`` appear absent for non-root users.
When using the templates or the nvidia hook as a non-root user
(e.g., when creating unprivileged containers) the error
"/proc/1/uid_map: No such file or directory" is printed.
Since the script works correctly despite the error, this error
message might be confusing for users.
Signed-off-by: Lukas Pirl <git@lukas-pirl.de>
Rachid Koucha [Fri, 21 Jun 2019 12:20:04 +0000 (14:20 +0200)]
Container's specific file/directory names
To be used when making file/directory names for containers (e.g. in lxccontainer.c)
Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>
Rachid Koucha [Thu, 20 Jun 2019 16:24:21 +0000 (18:24 +0200)]
Use file/directory names from macro.h
To make the file/directory names, use the defines from macro.h
Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>
Stéphane Graber [Tue, 8 Oct 2019 01:27:14 +0000 (21:27 -0400)]
lxc.pc: Fix invalid @DLOG_LIBS@
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Julio Faracco [Sat, 3 Aug 2019 05:16:13 +0000 (02:16 -0300)]
utils: Fix wrong integer of a function parameter.
If SSL is enabled, utils will include function `do_sha1_hash()` to
generate a sha1 encrypted buffer. Last function argument of
`EVP_DigestFinal_ex()` requires a `unsigned int` but the current
parameter is an `integer` type.
See error:
utils.c:350:38: error: passing 'int *' to parameter of type 'unsigned int *' converts between pointers to integer types with different sign
[-Werror,-Wpointer-sign]
EVP_DigestFinal_ex(mdctx, md_value, md_len);
^~~~~~
/usr/include/openssl/evp.h:549:49: note: passing argument to parameter 's' here
unsigned int *s);
Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Thomas Parrott [Fri, 26 Jul 2019 15:14:18 +0000 (16:14 +0100)]
lxccontainer: do_lxcapi_detach_interface to support detaching wlan devices
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
Christian Brauner [Sun, 28 Jul 2019 21:13:26 +0000 (23:13 +0200)]
cgroups: initialize cpuset properly
Closes #3108.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Tycho Andersen [Tue, 23 Jul 2019 15:40:14 +0000 (09:40 -0600)]
pidfds: don't print a scary warning on ENOSYS
Most kernels don't have this functionality yet, and so the warning is
printed a lot. Our people are scared of warnings, so let's make it INFO
instead in this case.
Signed-off-by: Tycho Andersen <tycho@tycho.ws>
Stéphane Graber [Mon, 22 Jul 2019 22:23:48 +0000 (18:23 -0400)]
lxc-download: Pre-release bump of compat
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Thomas Parrott [Tue, 21 May 2019 16:25:52 +0000 (17:25 +0100)]
lxc/log: Adds error_log_errno macro
Suggested usage:
return error_log_errno(err, "Failed: %s", "some error");
It sets errno to the value of err, then calls SYSERROR with the format and remaining args.
It always returns -1.
Suggested-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
Rachid Koucha [Thu, 11 Jul 2019 08:01:36 +0000 (10:01 +0200)]
Suppress hardcoded table sizes
. Use sizeof() instead of hardcoded values
. snprintf(..., size, ""...) is in error if the return code is >= size (not sufficient to set only ">")
Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>
Rachid Koucha [Thu, 11 Jul 2019 07:42:05 +0000 (09:42 +0200)]
Typo fix
Fixed a typo in error message
Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>
Christian Brauner [Wed, 10 Jul 2019 14:34:29 +0000 (16:34 +0200)]
cgroup: check for non-empty conf
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Wolfgang Bumiller [Mon, 8 Jul 2019 16:10:35 +0000 (18:10 +0200)]
pidf_send_signal: fix return value
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Christian Brauner [Wed, 3 Jul 2019 15:57:48 +0000 (17:57 +0200)]
cgroups: hande cpuset initialization race
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Tue, 2 Jul 2019 10:57:12 +0000 (12:57 +0200)]
start: expose LXC_PID to network hooks too
Closes #3066.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Rachid Koucha [Sat, 29 Jun 2019 21:21:14 +0000 (23:21 +0200)]
Move code/variable in smaller scope
In start.c, do not fill path[] table if not necessary
Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>
LiFeng [Fri, 28 Jun 2019 03:49:08 +0000 (23:49 -0400)]
fix memory leak in do_storage_create
Signed-off-by: LiFeng <lifeng68@huawei.com>
Christian Brauner [Thu, 27 Jun 2019 12:48:34 +0000 (14:48 +0200)]
cgroups: move variable into tighter scope
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 27 Jun 2019 12:46:47 +0000 (14:46 +0200)]
cgroups: correctly order variables
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 27 Jun 2019 12:45:36 +0000 (14:45 +0200)]
cgroups: move variable into tighter scope
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 27 Jun 2019 12:43:36 +0000 (14:43 +0200)]
cgroups: simplify cgfsng_nrtasks()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 27 Jun 2019 12:43:09 +0000 (14:43 +0200)]
cgroups: move variable into tighter scope
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 27 Jun 2019 12:27:58 +0000 (14:27 +0200)]
cgroups: move variable into tighter scope
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 27 Jun 2019 12:27:39 +0000 (14:27 +0200)]
cgroups: use __do_free in cgfsng_attach()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 27 Jun 2019 12:26:38 +0000 (14:26 +0200)]
cgroups: simplify cgfsng_setup_limits()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 27 Jun 2019 12:26:14 +0000 (14:26 +0200)]
cgroups: move variables into tighter scope
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 27 Jun 2019 12:25:53 +0000 (14:25 +0200)]
cgroups: use __do_free
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
LiFeng [Thu, 27 Jun 2019 03:54:27 +0000 (23:54 -0400)]
cgfsng: fix memory leak in lxc_cpumask_to_cpulist
Signed-off-by: LiFeng <lifeng68@huawei.com>
Stéphane Graber [Fri, 21 Jun 2019 22:02:24 +0000 (18:02 -0400)]
Release LXC 3.0.4
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Christian Brauner [Thu, 20 Jun 2019 17:37:09 +0000 (19:37 +0200)]
cgfsng: write cpuset.mems of correct ancestor
Reported-by: Free Ekanayaka <free.ekanayaka@canonical.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
t00416110 [Thu, 20 Jun 2019 20:26:59 +0000 (16:26 -0400)]
parse.c: fix fd leak from memfd_create
Signed-off-by: t00416110 <tanyifeng1@huawei.com>
Serge Hallyn [Mon, 17 Jun 2019 13:37:47 +0000 (08:37 -0500)]
lxc.pc.in: add libs.private for static linking
None of them seem to support pkg-config themselves, else we could add
them to Requires.private.
Signed-off-by: Serge Hallyn <shallyn@cisco.com>
Rachid Koucha [Sat, 15 Jun 2019 13:17:50 +0000 (15:17 +0200)]
Fixed file descriptor leak for network namespace
In privileged mode, the container startup looses a file descriptor for "handler->nsfd[LX_NS_NET]". At line 1782, we preserve the namespaces file descriptor (in privileged mode, the network namespace is also preserved) :
for (i = 0; i < LXC_NS_MAX; i++)
if (handler->ns_on_clone_flags & ns_info[i].clone_flag)
INFO("Cloned %s", ns_info[i].flag_name);
if (!lxc_try_preserve_namespaces(handler, handler->ns_on_clone_flags, handler->pid)) {
ERROR("Failed to preserve cloned namespaces for lxc.hook.stop");
goto out_delete_net;
}
Then at line 1830, we preserve one more time the network namespace :
ret = lxc_try_preserve_ns(handler->pid, "net");
if (ret < 0) {
if (ret != -EOPNOTSUPP) {
SYSERROR("Failed to preserve net namespace");
goto out_delete_net;
}
The latter overwrites the file descriptor already stored in handler->nsfd[LXC_NS_NET] at line 1786.
So, this fix checks that the entry is not already filled.
Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>
Christian Brauner [Fri, 14 Jun 2019 10:39:20 +0000 (12:39 +0200)]
network: fix lxc_netdev_rename_by_index()
Return an error code when the name is invalid instead of pretending that things
are fine.
Closes #3044.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Serge Hallyn [Fri, 14 Jun 2019 03:08:26 +0000 (03:08 +0000)]
Switch from gnutls to openssl for sha1
The reason for this is because openssl can be statically linked
against, gnutls cannot.
Signed-off-by: Serge Hallyn <shallyn@cisco.com>
KATOH Yasufumi [Thu, 13 Jun 2019 12:05:24 +0000 (21:05 +0900)]
doc: add a note about shared ns + LSMs to Japanese doc
Update for commit
8de90384363fe01f5258d36724dd3eae55918b5b
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Rachid Koucha [Wed, 12 Jun 2019 06:36:40 +0000 (08:36 +0200)]
Centralize hook names
The hook string names must not be repeated in the source code to facilitate future changes
Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>
Christian Brauner [Wed, 5 Jun 2019 21:43:53 +0000 (23:43 +0200)]
start: generate new boot id on container start
Closes #3027.
BugLink: https://bugs.launchpad.net/bugs/1831258
Cc: Dimitri John Ledkov <xnox@ubuntu.com>
Cc: Scott Moser <smoser@ubuntu.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Paul Romlow [Wed, 5 Jun 2019 18:28:21 +0000 (13:28 -0500)]
proposed fix for #2892 - fix lxcbasename in lxc/lxccontainer.c
Signed-off-by: Paul Romlow <paul@romlow.com>
Rachid Koucha [Wed, 5 Jun 2019 11:04:11 +0000 (13:04 +0200)]
Make /tmp accessible to any user
/tmp created with "rwxrwxrwt" mode
Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>
Christian Brauner [Wed, 5 Jun 2019 07:27:45 +0000 (09:27 +0200)]
cgroups: prevent segfault
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
LiFeng [Wed, 5 Jun 2019 04:44:17 +0000 (00:44 -0400)]
start: fix handler memory leak at lxc_init failed
Signed-off-by: LiFeng <lifeng68@huawei.com>
Brian McQueen [Tue, 4 Jun 2019 13:46:37 +0000 (06:46 -0700)]
lxc_usernsexec: continuing after unshare fails leads to confusing and misleading error messages
Signed-off-by: Brian McQueen <bmcqueen@linkedin.com>
Alexander Kriventsov [Mon, 3 Jun 2019 15:11:56 +0000 (18:11 +0300)]
getgrgid_r fails with ERANGE if buffer is too small. Retry with a larger buffer.
Signed-off-by: Alexander Kriventsov <akriventsov@nic.ru>
Tycho Andersen [Wed, 29 May 2019 15:36:51 +0000 (09:36 -0600)]
lxc_clone: add a comment about stack size
Signed-off-by: Tycho Andersen <tycho@tycho.ws>
Tycho Andersen [Wed, 29 May 2019 14:47:35 +0000 (08:47 -0600)]
lxc_clone: bump stack size to 8MB
This is the default thread size for glibc, so it is reasonable to match
that when we clone().
Mostly this is a science experiment suggested by brauner, and who doesn't
love science?
Signed-off-by: Tycho Andersen <tycho@tycho.ws>
Alexander Kriventsov [Tue, 28 May 2019 12:58:51 +0000 (15:58 +0300)]
fix issue 2765
Signed-off-by: Alexander Kriventsov <akriventsov@nic.ru>
Christian Brauner [Fri, 24 May 2019 13:59:57 +0000 (15:59 +0200)]
cgroups: handle offline cpus in v1 hierarchy
Handle offline cpus in v1 hierarchy.
In addition to isolated cpus we also need to account for offline cpus when our
ancestor cgroup is the root cgroup and we have not been initialized yet.
Closes #2953.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Tycho Andersen [Thu, 9 May 2019 18:18:10 +0000 (14:18 -0400)]
lxc_clone: get rid of some indirection
We have a do_clone(), which just calls a void f(void *) that it gets
passed. We build up a struct consisting of two args that are just the
actual arg and actual function. Let's just have the syscall do this for us.
Signed-off-by: Tycho Andersen <tycho@tycho.ws>
Tycho Andersen [Thu, 9 May 2019 18:13:40 +0000 (14:13 -0400)]
doc: add a little note about shared ns + LSMs
We should add a little not about the race in the previous patch.
Signed-off-by: Tycho Andersen <tycho@tycho.ws>