Re: [RFC 1/1] swiotlb: Replace BUG_ON() with graceful error handling

From: Christoph Hellwig
Date: Mon Nov 25 2024 - 02:59:24 EST


On Fri, Nov 22, 2024 at 08:13:04PM +0100, Brian Johannesmeyer wrote:
> Replace the BUG_ON() assertion in swiotlb_release_slots() with a
> conditional check and return. This change prevents a corrupted tlb_addr
> from causing a kernel panic.

We'll at least want a WARN_ON_ONCE here. But what is the threat model
here? The tlb_addr is handed out by swiotlb and should not be modified
by the driver.