Skip to content

NAS-141460 / 27.0.0-BETA.1 / Disable block device drivers TrueNAS does not use#296

Merged
ixhamza merged 1 commit into
truenas/linux-6.18from
NAS-141460
Jun 22, 2026
Merged

NAS-141460 / 27.0.0-BETA.1 / Disable block device drivers TrueNAS does not use#296
ixhamza merged 1 commit into
truenas/linux-6.18from
NAS-141460

Conversation

@ixhamza

@ixhamza ixhamza commented Jun 19, 2026

Copy link
Copy Markdown
Member

TrueNAS has no use for these block-device drivers, but any root user can load them to create block devices on demand; a customer did this with brd and broke HA failover. Stop building brd, scsi_debug, the NVMe-oF loop and fcloop targets, drbd, aoe, rbd, ublk, null_blk, and bcache. scsi_debug and the NVMe-oF loopbacks especially need this because they appear as ordinary /dev/sd* and /dev/nvme*n* devices that middleware cannot tell apart from real drives; the rest only reduce attack surface.

Testing

Tested with Scale Build. No regressions found from the removed drivers.

@ixhamza ixhamza requested review from amotin, anodos325 and yocalebo June 19, 2026 18:04
@bugclerk bugclerk changed the title Disable block device drivers TrueNAS does not use NAS-141460 / 27.0.0-BETA.1 / Disable block device drivers TrueNAS does not use Jun 19, 2026
@bugclerk

Copy link
Copy Markdown

@amotin amotin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have feeling scsi_debug is used by ZFS CI, if we ever run it on actual TrueNAS. Theoretically I can guess if it to be useful for some of our CI. About others I don't have strong opinion, except I think that if we are going to list all the ways how root user can screw up TrueNAS HA, then this list will be much longer. I don't think it worth to pollute our config with this.

@yocalebo

Copy link
Copy Markdown
Contributor

I have feeling scsi_debug is used by ZFS CI, if we ever run it on actual TrueNAS. Theoretically I can guess if it to be useful for some of our CI. About others I don't have strong opinion, except I think that if we are going to list all the ways how root user can screw up TrueNAS HA, then this list will be much longer. I don't think it worth to pollute our config with this.

We had a customer create ram devices on their box and break things.

@amotin

amotin commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

We had a customer create ram devices on their box and break things.

Yeah. I've guessed so from the ticket. I just don't think we can/should do much about it.

@ixhamza

ixhamza commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

@amotin agreed! I can limit this to brd, since that is what actually caused the customer issue.

TrueNAS has no use for brd, but any root user can load it to create
RAM-backed block devices on demand; a customer did this on a production
system, creating many RAM disks and breaking HA failover. brd is not
used by the kernel, OpenZFS, middleware, or the build, so stop building
it.

Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
@yocalebo

Copy link
Copy Markdown
Contributor

We had a customer create ram devices on their box and break things.

Yeah. I've guessed so from the ticket. I just don't think we can/should do much about it.

We should absolutely disable kernel modules that we don't use or expect anyone in the community to use. This is similar to us disabling LVM as well. Why carry around baggage that only harms us?

@amotin

amotin commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

We should absolutely disable kernel modules that we don't use or expect anyone in the community to use. This is similar to us disabling LVM as well. Why carry around baggage that only harms us?

Because being too much custom may cost more?

@yocalebo

Copy link
Copy Markdown
Contributor

We should absolutely disable kernel modules that we don't use or expect anyone in the community to use. This is similar to us disabling LVM as well. Why carry around baggage that only harms us?

Because being too much custom may cost more?

I guess we have a different definitions of cost 😄 A customer escalation that goes through the various channels and ends up in an SEE case because our HA got broken seems more costly than not compiling kernel modules.

@amotin

amotin commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

I guess we have a different definitions of cost 😄 A customer escalation that goes through the various channels and ends up in an SEE case because our HA got broken seems more costly than not compiling kernel modules.

We can't stop customer's foot shooting unless we completely block the shell or turn kernel config into a total mess. And even then somebody may try to insert a SATA drive or do something else unexpected. About blocking HA, I've just proposed to Ameer that for purposes of blocking HA we might only cound dual-ported drives, if those flags of SCSI/NVMe are somehow exposed in sysfs.

@ixhamza ixhamza merged commit 2d8f4c6 into truenas/linux-6.18 Jun 22, 2026
6 checks passed
@ixhamza ixhamza deleted the NAS-141460 branch June 22, 2026 14:06
@bugclerk

Copy link
Copy Markdown

This PR has been merged and conversations have been locked.
If you would like to discuss more about this issue please use our forums or raise a Jira ticket.

@truenas truenas locked as resolved and limited conversation to collaborators Jun 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants