Skip to content

Conversation

@s4heid
Copy link
Contributor

@s4heid s4heid commented Oct 23, 2025

This PR removes loading of the legacy floppy module from the stemcell build.

Rationale:

  • Module is obsolete hardware support; keeping it expands kernel attack surface (extra code paths, potential low‑severity but chronic CVEs).
  • Azure (including Hyper-V) presents no virtual floppy device; upstream guidance (Microsoft LISA core test suite) explicitly expects/assumes floppy is absent.
  • Eliminates pointless udev/probing delays and reduces initramfs/kernel footprint for slightly faster, cleaner boot.

@Alphasite
Copy link
Contributor

Alphasite commented Oct 28, 2025

I don’t know if this is still true but the vsphere cpi used this module for its equivalent of cloud init. It may have moved to virtual CDs but we need to double check this.

@selzoc
Copy link
Member

selzoc commented Oct 28, 2025

Pretty sure the vsphere cpi uses a virtual cd drive, at least according to https://bosh.io/docs/vsphere/#concepts

@github-project-automation github-project-automation bot moved this from Pending Review | Discussion to Pending Merge | Prioritized in Foundational Infrastructure Working Group Oct 30, 2025
@rkoster rkoster merged commit 5297553 into cloudfoundry:ubuntu-jammy Oct 30, 2025
2 checks passed
@github-project-automation github-project-automation bot moved this from Pending Merge | Prioritized to Done in Foundational Infrastructure Working Group Oct 30, 2025
@s4heid s4heid deleted the disable-floppy branch November 3, 2025 17:37
s4heid added a commit to s4heid/bosh-linux-stemcell-builder that referenced this pull request Nov 6, 2025
In a previous change (cloudfoundry#449), loading the floppy module was disabled by
redirecting the floppy command to true, which effectively prevents
manual loading of the module using `modprobe floppy`. However, Buffer
I/O errors observed in the `dmesg` output indicate that the kernel is
still attempting to load the floppy module when the floppy hardware is
presented.

```txt
blk_update_request: I/O error, dev fd0, sector 0 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
floppy0: disk absent or changed during operation
```

This suggests that that during boot:
1. Kernel detects floppy controller hardware
2. udev/kernel auto-loads floppy module (install directive not active yet)
3. Floppy driver starts, finds no disk → I/O errors
4. install directive becomes active (too late!)

When using both directives below, these errors can be avoided:

- `install floppy /bin/true`: This redirects any attempt to load the floppy module to true (which does nothing)
- `blacklist floppy`: This explicitly prevents the kernel from automatically loading the floppy module
s4heid added a commit to s4heid/bosh-linux-stemcell-builder that referenced this pull request Nov 8, 2025
In a previous change (cloudfoundry#449), loading the floppy module was disabled by
redirecting the floppy command to true, which effectively prevents
manual loading of the module using `modprobe floppy`. However, Buffer
I/O errors observed in the `dmesg` output indicate that the kernel is
still attempting to load the floppy module when the floppy hardware is
presented.

```txt
blk_update_request: I/O error, dev fd0, sector 0 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
floppy0: disk absent or changed during operation
```

This suggests that during boot:
1. Kernel detects floppy controller hardware
2. udev/kernel auto-loads floppy module (install directive not active yet)
3. Floppy driver starts, finds no disk → I/O errors
4. install directive becomes active (too late!)

update-initramfs must be executed because the initramfs is built at
image creation time and contains kernel modules and configuration used
before the root filesystem mounts. The blacklist in /etc/modprobe.d
only affects modprobe after the root filesystem is active.
If the initramfs contains a floppy.k and is not rebuilt after the
blacklist has been applied, the initramfs auto-loads the floppy driver.
s4heid added a commit to s4heid/bosh-linux-stemcell-builder that referenced this pull request Nov 9, 2025
In a previous change (cloudfoundry#449), loading the floppy module was disabled by
redirecting the floppy command to true, which effectively prevents
manual loading of the module using `modprobe floppy`. However, Buffer
I/O errors observed in the `dmesg` output indicate that the kernel is
still attempting to load the floppy module when the floppy hardware is
presented.

```txt
blk_update_request: I/O error, dev fd0, sector 0 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
floppy0: disk absent or changed during operation
```

This suggests that during boot:
1. Kernel detects floppy controller hardware
2. udev/kernel auto-loads floppy module (install directive not active yet)
3. Floppy driver starts, finds no disk → I/O errors
4. install directive becomes active (too late!)

The blacklist in /etc/modprobe.d only affects modprobe after the root
filesystem is active. If the initramfs contains a `floppy.ko` file and
is not rebuilt after the blacklist has been applied, the initramfs
auto-loads the floppy driver.
`update-initramfs` rebuilds the initramfs and includes the /etc/modprobe.d
rules to the root fs.
s4heid added a commit to s4heid/bosh-linux-stemcell-builder that referenced this pull request Nov 10, 2025
In a previous change (cloudfoundry#449), loading the floppy module was disabled by
redirecting the floppy command to true. However, Buffer I/O errors
observed in the `dmesg` output indicate that the kernel is still
attempting to load the floppy module when the hardware supports it.

```txt
blk_update_request: I/O error, dev fd0, sector 0 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
floppy0: disk absent or changed during operation
```

This suggests that during boot:
1. Kernel detects floppy controller hardware
2. udev/kernel auto-loads floppy module (install directive not active yet)
3. Floppy driver starts, finds no disk → I/O errors
4. install directive becomes active (too late!)

The blacklist in /etc/modprobe.d only affects modprobe after the root
filesystem is active. If the initramfs contains a `floppy.ko` file and
is not rebuilt after the blacklist has been applied, the initramfs
auto-loads the floppy driver.
`update-initramfs` rebuilds the initramfs and includes the /etc/modprobe.d
rules to the root fs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

5 participants