dev file system is mounted without nosuid or noexec
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
Focal |
In Progress
|
Medium
|
Dave Chiluk | ||
Jammy |
In Progress
|
Medium
|
Dave Chiluk | ||
systemd (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
Focal |
Invalid
|
Undecided
|
Unassigned | ||
Jammy |
Invalid
|
Undecided
|
Unassigned |
Bug Description
[ SRU TEMPLATE ]
[ Impact ]
* nosuid, and noexec bits are not set on /dev
* This has the potential for nefarious actors to use this as an avenue for attack. see https:/
* It is not best security practice.
[ Test Plan ]
1.Boot a Canonical Supplied EC2 instance
2.Check the mount options for /dev.
3.You will notice the lack of nosuid and noexec on /dev.
[ Where problems could occur ]
* As of 2022/10/06, I need to test this, but don't know how to build -aws flavored ubuntu kernels. Instructions welcome. I'm holding off on adding SRU tags until I can actually get this tested.
* If this is applied to non initramfs-less kernels it could potentially cause a regression for very old hardware that does nefarious things with memory. For a larger discussion about that see:
https:/
* Low risk if a driver depends on /dev allowing suid or exec this might prevent boot. That being said, all kernels that have been booting with an initramfs have been getting nosuid, and noexec set so hopefully we can consider that risk fairly well tested.
[ Other Info ]
* Patch is accepted into 5.17, and will drop out quickly
* Any server booting with an initramfs already has nosuid, and noexec set, so hopefully
<<<<<<< ORIGINAL TEXT >>>>>>>>>>>>
This is similar to https:/
I discovered that my ec2 instances based off of Canonical supplied AMI ami-0a23d903496
My usb installed 20.04.4 home machine does not have this problem, but it has been installed for quite some time. My 22.04 laptop machine also does not have this issue.
Reproduce.
Start an ec2 instance based off of ami-0a23d903496
$ mount | grep devtmpfs
nosuid is not found in the options list.
I've checked the initrd, and /etc/init.d/udev script and all places I know of where dev gets mounted set nosuid, so it's non-obvious what boot code-path is being taken that results in nosuid missing.
ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: udev 245.4-4ubuntu3.18
ProcVersionSign
Uname: Linux 5.15.0-1020-aws x86_64
ApportVersion: 2.20.11-
Architecture: amd64
CasperMD5CheckR
CustomUdevRuleF
Date: Thu Oct 6 17:39:42 2022
Ec2AMI: ami-0a23d903496
Ec2AMIManifest: (unknown)
Ec2Availability
Ec2InstanceType: t2.medium
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
Lsusb: Error: command ['lsusb'] failed with exit code 1:
Lsusb-t:
Lsusb-v: Error: command ['lsusb', '-v'] failed with exit code 1:
MachineType: Xen HVM domU
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
LANG=C.UTF-8
SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=
SourcePackage: systemd
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 08/24/2006
dmi.bios.release: 4.2
dmi.bios.vendor: Xen
dmi.bios.version: 4.2.amazon
dmi.chassis.type: 1
dmi.chassis.vendor: Xen
dmi.modalias: dmi:bvnXen:
dmi.product.name: HVM domU
dmi.product.
dmi.sys.vendor: Xen
Changed in linux (Ubuntu Jammy): | |
status: | New → Confirmed |
Changed in systemd (Ubuntu Jammy): | |
status: | New → Confirmed |
description: | updated |
description: | updated |
information type: | Public → Private Security |
information type: | Private Security → Public Security |
summary: |
- dev file system is mounted without nosuid + dev file system is mounted without nosuid or noexec |
Changed in linux (Ubuntu Focal): | |
assignee: | nobody → Dave Chiluk (chiluk) |
importance: | Undecided → Medium |
status: | Confirmed → In Progress |
Changed in linux (Ubuntu Jammy): | |
assignee: | nobody → Dave Chiluk (chiluk) |
importance: | Undecided → Medium |
status: | Confirmed → In Progress |
Changed in linux (Ubuntu Focal): | |
status: | In Progress → Fix Released |
Changed in linux (Ubuntu Jammy): | |
status: | In Progress → Fix Released |
Changed in systemd (Ubuntu Focal): | |
status: | Invalid → Fix Released |
Changed in systemd (Ubuntu Jammy): | |
status: | Invalid → Fix Released |
Changed in systemd (Ubuntu Focal): | |
assignee: | nobody → cristian swing (sed1991s) |
Changed in systemd (Ubuntu Jammy): | |
assignee: | nobody → cristian swing (sed1991s) |
Changed in systemd (Ubuntu): | |
assignee: | nobody → cristian swing (sed1991s) |
Changed in systemd (Ubuntu): | |
assignee: | cristian swing (sed1991s) → nobody |
Changed in systemd (Ubuntu Focal): | |
assignee: | cristian swing (sed1991s) → nobody |
Changed in systemd (Ubuntu Jammy): | |
assignee: | cristian swing (sed1991s) → nobody |
Changed in linux (Ubuntu Focal): | |
status: | Fix Released → In Progress |
Changed in linux (Ubuntu Jammy): | |
status: | Fix Released → In Progress |
Changed in systemd (Ubuntu Focal): | |
status: | Fix Released → Invalid |
Changed in systemd (Ubuntu Jammy): | |
status: | Fix Released → Invalid |
I suspect this is something to do with initrd-less boot: it's usually the initramfs which mounts /dev: https:/ /git.launchpad. net/ubuntu/ +source/ initramfs- tools/tree/ init#n40
The comment above that line is:
# 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