Alpine LXC container

LnxBil

Distinguished Member
Feb 21, 2015
9,504
1,710
273
Saarland, Germany
Hi everyone,

I'd like to understand some strangeness with the "default" Alpine LXC template as a minimal container (64 MB RAM, 32 MB Swap, 1 GB ZFS):

Code:
root@alpine-test / > free -m
             total       used       free     shared    buffers     cached
Mem:          1999       1842        157         49          0          0
-/+ buffers/cache:       1841        158
Swap:          999          0        999

root@alpine-test / > busybox free -m
             total       used       free     shared    buffers     cached
Mem:          1999       1845        154         49          0          0
-/+ buffers/cache:       1844        155
Swap:          999          0        999

root@alpine-test / > grep -Ei '(Mem|Swap)Total' /proc/meminfo
MemTotal:          65536 kB
SwapTotal:         32768 kB

I see with the busybox-binaries the memory and swap configuration of the host. I'm running pve-no-subscription with current (=today) patches (pve-manager/4.3-9/f7c6f0cd (running kernel: 4.4.21-1-pve)). This is different from any other container I used before.[/CODE]
 
Busybox's free implementation uses the sysinfo() syscall instead of the /proc and cgroup file systems. This syscall does not take cgroups or namespaces into account. Iow. it is not containerized.
 
  • Like
Reactions: William Blondel
Thanks Wolfgang, I thought of something similar. So, this is some kind of security flaw? I suppose it should not be that some old, low-level API is able to retrieve more information about the hypervisor than it should be, should it?
 
So, this is some kind of security flaw?

No, I do not think this is a security flaw.

I suppose it should not be that some old, low-level API is able to retrieve more information about the hypervisor than it should be, should it?

A container does not provide a full isolation (it runs on the host kernel). Please use KVM if this is a requirement.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!