Incorrect results with uptime and free for alpine containers

I have two containers: first and alpine.

Host OS: Slackware current
kernel: 6.12.5
Incus version: 6.8
lxc version: 6.0.3
lxcfs version: 6.0.3

[~]$ incus config show first
architecture: x86_64
config:
  image.architecture: amd64
  image.description: Debian bullseye amd64 (20241220_05:24)
  image.os: Debian
  image.release: bullseye
  image.serial: "20241220_05:24"
  image.type: squashfs
  image.variant: default
  limits.cpu: "2"
  limits.memory: 2GiB
  volatile.base_image: b5888da9b89aff34281b8eccf505ed96ff85e74cdae759403b2a780ef3dc105a
  volatile.cloud-init.instance-id: b7afb4bf-6f57-4c81-9f4d-299c83570aea
  volatile.eth0.host_name: veth35b6c84f
  volatile.eth0.hwaddr: 00:16:3e:11:d0:0c
  volatile.idmap.base: "0"
  volatile.idmap.current: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
  volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
  volatile.last_state.idmap: '[]'
  volatile.last_state.power: RUNNING
  volatile.last_state.ready: "false"
  volatile.uuid: 9d30cf6b-f425-4019-9311-5342dbd321a2
  volatile.uuid.generation: 9d30cf6b-f425-4019-9311-5342dbd321a2
devices: {}
ephemeral: false
profiles:
- default
stateful: false
description: ""
[~]$ incus config show alpine
architecture: x86_64
config:
  image.architecture: amd64
  image.description: Alpine 3.20 amd64 (20240916_13:00)
  image.os: Alpine
  image.release: "3.20"
  image.requirements.secureboot: "false"
  image.serial: "20240916_13:00"
  image.type: squashfs
  image.variant: default
  limits.cpu: "2"
  limits.memory: 2GiB
  volatile.base_image: 6c2417788656432b39ec4a3540b6f59228bc8c1c76eba822d7781e5180ebd6cd
  volatile.cloud-init.instance-id: 55e65afd-853b-4b25-bd52-a4120b2a5e0a
  volatile.eth0.host_name: vethdd12d481
  volatile.eth0.hwaddr: 00:16:3e:50:82:30
  volatile.idmap.base: "0"
  volatile.idmap.current: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
  volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
  volatile.last_state.idmap: '[]'
  volatile.last_state.power: RUNNING
  volatile.last_state.ready: "false"
  volatile.uuid: be8a3d56-3f78-42bf-8e69-809b6e666ba0
  volatile.uuid.generation: be8a3d56-3f78-42bf-8e69-809b6e666ba0
devices: {}
ephemeral: false
profiles:
- default
stateful: false
description: ""

Both containers were started at the same time.

first has correct information:

[~]$ incus exec first -- uptime
 18:17:35 up 15 min,  0 users,  load average: 1.15, 0.60, 0.33
[~]$ incus exec first -- free -h
               total        used        free      shared  buff/cache   available
Mem:           2.0Gi        16Mi       2.0Gi       0.0Ki       0.0Ki       2.0Gi
Swap:          1.9Gi          0B       1.9Gi

alpine is incorrect:

[~]$ incus exec alpine -- uptime
 18:21:01 up 1 day, 22:16,  0 users,  load average: 0.83, 0.74, 0.44
[~]$ incus exec alpine -- free -h
              total        used        free      shared  buff/cache   available
Mem:          31.3G       29.0G        1.8G       23.3M      513.5M        2.0G
Swap:          1.9G        5.5M        1.9G

Alpine relies on sysinfo for that data rather than the filesystem.
As a result, the filesystem overlay (LXCFS) doesn’t really do anything for Alpine containers.

The way to get that to work is to set security.syscalls.intercept.sysinfo=true on the instance, then restart it. That syscall interception bit will cover what free needs.

That did it: both free and uptime are returning correct values. Thanks.