0

My host node is RHEL7 running KVM from the 'updates' repo. On the host node, the permissions for /dev/null are:

crw-rw-rw-. 1 root root 1, 3 Dec 18 04:45 /dev/null

In an Alpine KVM guest (5.14, but same behavior on other versions), the permissions are missing the "others":

crw-rw---- 1 root root 1, 3 Dec 24 23:22 /dev/null

How can I persistently change the permissions in the guest to match the host? It is working OK on another node, but I can't see the difference between them.

tater
  • 1,395
  • 2
  • 9
  • 12

2 Answers2

0

There is no connection between host OS and guest OS regarding this.

It is Alpine Linux that assigns the permissions to the device node. They have had bugs related to this earlier: https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_1.7.29.2

You need to check with Alpine Linux developers why the permissions are setup like that. Most likely it is related to their hardening efforts.

Tero Kilkanen
  • 34,499
  • 3
  • 38
  • 58
  • I'd be genuinely interested if someone has a rationale for limiting access to `/dev/null` as a means of hardening the system other than attack surface reduction (which is valid in and of itself). – Ginnungagap Dec 26 '21 at 16:26
0

It seems this was caused by something in the Alpine setup process inside the KVM guest. It didn't occur when running the basic setup-alpine but did occur when doing a manual setup (e.g. custom disk partitioning).

tater
  • 1,395
  • 2
  • 9
  • 12