Re: [PATCH] staging: greybus: fix use-after-free in dump_module

From: Dan Carpenter

Date: Fri Oct 30 2026 - 11:20:47 EST


On Fri, Oct 30, 2026 at 11:03:55PM +0800, linfordWu wrote:
> gb_audio_manager_dump_module() drops modules_rwsem before dereferencing
> the module. A concurrent gb_audio_manager_remove() can free the module
> between the lookup and the dump.
>
> Keep the read lock held while dumping the module so removal cannot free
> it during the access.
>

The patch is correct, but it needs a Fixes tag.

> Signed-off-by: linfordWu <linfordwu@xxxxxxx>

The Signed-off-by line is supposed to be a bit formal like signing a
legal document so normally people would use capital letters.

Don't resend patches until after 24 hours and follow all the other
rules.
https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/

regards,
dan carpenter