Re: [PATCH] net: fman: guard IRQ handlers against pre-init interrupt
From: ZhaoJinming
Date: Thu Jul 02 2026 - 06:43:43 EST
Hi Paolo,
Thanks for the review. You are right -- the irq_ready approach was
fundamentally flawed, and moving IRQ registration after init is the
correct fix.
I have updated the series to address your feedback:
Patch 1/2: Move devm_request_irq() out of read_dts_node() and into
fman_probe(), after fman_config() and fman_init() have completed.
This eliminates both the pre-init NULL dereference and the UAF on
probe failure in a single change. A separate UAF fix patch is no
longer needed.
Patch 2/2: Add proper error cleanup in fman_probe(). The existing
driver had no unified cleanup path -- fman_init() and devm_request_irq()
failure paths leaked fman and its sub-resources. This patch adds
fman_free_resources() and fman_muram_finish() to release everything
correctly, including explicitly freeing IRQs before kfree(fman) to
avoid reintroducing the UAF window on the cleanup path itself.
Patches are against net-next/master.
v1 patch (irq_ready + READ_ONCE) is dropped. v3 UAF fix patch is
superseded.
Thanks,
Jinming