Stéphane Graber
41f808b29a
Merge pull request #2832 from brauner/2019-02-08/add_coccinelle
...
coccinelle support
2019-02-09 16:58:36 -05:00
Stéphane Graber
3e0aac16db
Merge pull request #2829 from brauner/2019-02-08/capabilities
...
caps: check uid and euid
2019-02-09 16:57:01 -05:00
Christian Brauner
5701771461
coccinelle: use standard exit identifiers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-09 11:23:54 +01:00
Christian Brauner
51a8a74c07
coccinelle: s/while({1,true})/for(;;)/
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-09 11:05:12 +01:00
Christian Brauner
99dc3a338d
coccinelle: add coccinelle support
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-09 11:05:10 +01:00
Christian Brauner
f57860aca9
Merge pull request #2833 from brauner/2019-02-09/bugfixes
...
bugfixes
2019-02-09 11:03:42 +01:00
Christian Brauner
6425271d04
lxc-init: exit with error on wait failure
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-09 01:35:44 +01:00
Christian Brauner
f7a0c6ee2a
start: prevent signed-issues
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-09 01:33:18 +01:00
Christian Brauner
0dbdb99e3b
cgfsng: remove unnecessary check
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-09 01:31:52 +01:00
Christian Brauner
6403a6671c
commands: remove unnecessary check
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-09 01:28:52 +01:00
Serge Hallyn
884b37d091
Merge pull request #2827 from brauner/2019-02-07/auto_cleanup
...
cgroups: partially switch to cleanup macros
2019-02-08 15:57:37 -06:00
Christian Brauner
df9bf8ca39
caps: check uid and euid
...
When we are running inside of a user namespace getuid() will return a
non-zero uid. So let's check euid as well to make sure we correctly drop
capabilities
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-08 15:11:46 +01:00
Christian Brauner
d97919abf2
cgroups: partially switch to cleanup macros
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-08 13:40:17 +01:00
Christian Brauner
42bd57bdbd
Merge pull request #2825 from brauner/lxc/master
...
README: add LGTM
2019-02-06 12:24:48 +01:00
Christian Brauner
a62cf72a8b
README: add LGTM
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 12:23:17 +01:00
Wolfgang Bumiller
d6a4505542
Merge pull request #2821 from brauner/2019-02-05/remove_stack_allocation
...
tree-wide: wipe alloca() from the codebase
2019-02-06 12:10:48 +01:00
Christian Brauner
57e2af15ed
lxc-unshare: remove stack allocations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 11:47:58 +01:00
Christian Brauner
e2c6671d17
overlay: remove stack allocations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 11:47:58 +01:00
Christian Brauner
3206805085
rbd: remove stack allocations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 11:47:58 +01:00
Christian Brauner
9371d3f2b6
nbd: remove stack allocations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 11:47:58 +01:00
Christian Brauner
007bb915d5
lvm: remove stack allocations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 11:47:58 +01:00
Christian Brauner
6b4e204c7b
loop: remove stack allocations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 11:47:58 +01:00
Christian Brauner
2530ba9597
terminal: remove stack allocations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 11:47:58 +01:00
Christian Brauner
97f35ce6f8
string_utils: remove stack allocations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 11:47:57 +01:00
Christian Brauner
643c9ec994
storage: remove stack allocations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 11:47:57 +01:00
Christian Brauner
4ffeaf2766
start: remove stack allocations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 11:47:57 +01:00
Christian Brauner
6421783a26
pam_cgfs: remove stack allocations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 11:47:57 +01:00
Christian Brauner
95ea3d1fa0
network: remove stack allocations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 11:47:57 +01:00
Christian Brauner
244f7f8734
namespace: remove stack allocations
...
Switch to a static stack instead of allocating a new one. There's really
no point in doing all of the dance to get the current pagesize.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 11:47:57 +01:00
Christian Brauner
54b43e8f09
monitor: remove stack allocations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 11:47:57 +01:00
Christian Brauner
f5849fd76f
lxccontainer: remove stack allocations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 11:47:57 +01:00
Christian Brauner
f01d035800
confile: remove stack allocations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 11:47:57 +01:00
Christian Brauner
2f443e88ca
conf: remove stack allocations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 11:47:57 +01:00
Christian Brauner
fdcdb6542b
commands_utils: remove stack allocations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 11:47:56 +01:00
Christian Brauner
5265a60cba
commands: remove stack allocations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 11:47:56 +01:00
Christian Brauner
fa4719e2c9
lxc_user_nic: remove stack allocations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 11:47:56 +01:00
Christian Brauner
861cb8c28a
cgroups: remove stack allocations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 11:47:56 +01:00
Christian Brauner
57668944d4
lxcmntent: remove stack allocations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 11:47:56 +01:00
Christian Brauner
af1dc7cd70
memory_utils: add memory_utils.h
...
The header defines a simple wrapper for free() that can be used with
gcc's and clang's __attribute__((__cleanup__(<cleanup-fun>))) macro.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 11:44:09 +01:00
Stéphane Graber
0220bddaac
Merge pull request #2824 from brauner/2019-02-05/compiler_based_hardening
...
compiler: hardening
2019-02-05 18:24:46 -05:00
Christian Brauner
d0afbad9a4
compiler: -Wnested-externs hardening
...
Warn if an extern declaration is encountered within a function.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-06 00:04:04 +01:00
Christian Brauner
a30c52acb7
compiler: -Wdate-time hardening
...
Warn when macros __TIME__, __DATE__ or __TIMESTAMP__ are encountered as
they might prevent bit-wise-identical reproducible compilations.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-05 23:49:48 +01:00
Christian Brauner
fcfce08aba
compiler: -Werror=shift-overflow=2 hardening
...
Warn about left shift overflows. This warning is enabled by default in
C99 and C++11 modes (and newer).
-Wshift-overflow=2
This warning level also warns about left-shifting 1 into the sign bit,
unless C++14 mode (or newer) is active.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-05 23:48:32 +01:00
Christian Brauner
463bee7b8d
compiler: -Werror=shift-count-overflow hardening
...
Warn if shift count >= width of type.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-05 23:47:31 +01:00
Christian Brauner
3b5a0eebd4
compiler: fix -fstack-protector-strong
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-05 23:44:20 +01:00
Christian Brauner
64871d419d
compiler: -fdiagnostics-show-option
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-05 23:26:13 +01:00
Christian Brauner
a703da6c84
compiler: -Werror=overflow hardening
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-05 23:26:00 +01:00
Christian Brauner
4ccb887813
compiler: -Wendif-labels hardening
...
Do not warn whenever an #else or an #endif are followed by text.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-05 23:15:05 +01:00
Stéphane Graber
4e950c76ed
Merge pull request #2823 from brauner/2019-02-05/compiler_based_hardening
...
compiler: hardening
2019-02-05 16:55:36 -05:00
Christian Brauner
a7547c5c34
compiler: -Wshadow hardening
...
Warn whenever a local variable or type declaration shadows another
variable, parameter, type, class member (in C++), or instance variable
(in Objective-C) or whenever a built-in function is shadowed.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-05 22:36:31 +01:00