/srv/irclogs.ubuntu.com/2022/10/06/#ubuntu-security.txt

chilukHey folks I was doing some OS hardening and I discovered that at least one Ubuntu AMI in AWS lacks nosuid on /dev 17:31
chiluk$ mount | grep devtmp17:31
chilukdevtmpfs on /dev type devtmpfs (rw,relatime,size=2000720k,nr_inodes=500180,mode=755,inode64)17:31
chilukI'm opening a ticket right now, but It's not immediately clear where the ticket should be opened as both of my media installed machines have nosuid set on /dev.17:32
chilukwhat makes matters worse, every code path I've found that mounts /dev sets the nosuid bit so I'm a bit at a loss.17:34
Odd_Blokechiluk: What does /etc/cloud/build.info have for a serial?17:41
=== Eickmeyer is now known as NotEickmeyer
chilukOdd_Bloke17:49
chilukbuild_name: server17:49
chilukserial: 2022092417:49
chilukhttps://bugs.launchpad.net/ubuntu/+source/systemd/+bug/199197517:49
-ubottu:#ubuntu-security- Launchpad bug 1991975 in systemd (Ubuntu) "dev file system is mounted without nosuid" [Undecided, New]17:49
Odd_BlokeA related thought: recent cloud images try to boot initramfs-less, and it's usually the initramfs which mounts /dev: https://git.launchpad.net/ubuntu/+source/initramfs-tools/tree/init#n40.  A possibly pertinent comment in that code: "Note that this only becomes /dev on the real filesystem if udev's scripts are used; which they will be, but it's worth pointing out"17:49
Odd_BlokeLet me comment there.17:50
chilukyeah there's actually a bug in /etc/init.d/udev where it never remounts devtmpfs17:50
chilukso there's that as well.17:51
chiluk@Odd_Bloke is there a better package you can think of to open this against other than systemd?  like the kernel perhaps?17:53
chilukespecially if they are the reason it's being mounted initramfs-less 17:54
chilukI can cross-post there.17:54
Odd_BlokeI'm not sure, really: IDK what is mounting the initial /dev (though one assumes it has to be the kernel if it isn't systemd/udev, I agree!)17:55
chiluk'17:57
chilukI'm going to attempt a workaround in /etc/init.d/udev and we'll see how that goes.18:24
chilukOdd_bloke or someone else is there a better way to tag https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1991975 so it gets security attention?20:39
-ubottu:#ubuntu-security- Launchpad bug 1991975 in linux (Ubuntu) "dev file system is mounted without nosuid" [Undecided, Confirmed]20:39
sdezielchiluk: Odd_Bloke: I can confirm on an *old* (serial: 20200902) GCP instance: $ mount | grep devtmp20:43
sdezieldevtmpfs on /dev type devtmpfs (rw,relatime,size=490260k,nr_inodes=122565,mode=755,inode64)20:43
chilukfrom what I can tell devtmpfs is indeed being mounted by the kernel init code..20:50
chilukyep definitely being mounted by the kernel and not re-mounted in userspace due to systemd 20:56
chilukhttps://kernel.ubuntu.com/git/ubuntu/ubuntu-focal.git/tree/drivers/base/devtmpfs.c#n38420:56
chilukmoving to #ubuntu-kernel20:56

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!