RE: [PATCH 1/7] irqbypass: Drop pointless and misleading THIS_MODULE get/put
From: Tian, Kevin
Date: Thu Apr 10 2025 - 03:14:11 EST
> From: Sean Christopherson <seanjc@xxxxxxxxxx>
> Sent: Saturday, April 5, 2025 5:15 AM
>
> Drop irqbypass.ko's superfluous and misleading get/put calls on
> THIS_MODULE. A module taking a reference to itself is useless; no amount
> of checks will prevent doom and destruction if the caller hasn't already
> guaranteed the liveliness of the module (this goes for any module). E.g.
> if try_module_get() fails because irqbypass.ko is being unloaded, then the
> kernel has already hit a use-after-free by virtue of executing code whose
> lifecycle is tied to irqbypass.ko.
>
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>