[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aLzed3HeWD3T1WIM@bombadil.infradead.org>
Date: Sat, 6 Sep 2025 18:23:03 -0700
From: Luis Chamberlain <mcgrof@...nel.org>
To: Fidal Palamparambil <rootuserhere@...il.com>
Cc: linux-modules@...r.kernel.org, petr.pavlu@...e.com, da.gomez@...nel.org,
samitolvanen@...gle.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kprobe_event_gen_test : Fix error handling and resource
cleanup
On Sat, Sep 06, 2025 at 05:15:59PM +0400, Fidal Palamparambil wrote:
> From: Fidal palamparambil <rootuserhere@...il.com>
>
> This commit addresses several issues in the kprobe event generation test module:
>
> 1. Fixed NULL pointer management in error paths where trace_event_file pointers
> were not properly set to NULL after errors, potentially causing double-free
> or use-after-free issues.
>
> 2. Added comprehensive cleanup for the kprobe event when kretprobe initialization
> fails in kprobe_event_gen_test_init(). Previously, a failed kretprobe creation
> would leave the kprobe event dangling.
>
> 3. Enhanced error handling consistency between kprobe and kretprobe test functions,
> ensuring both follow the same pattern for resource cleanup.
>
> 4. Fixed the error handling flow in test_gen_kprobe_cmd() and test_gen_kretprobe_cmd()
> to properly set trace_event_file pointers to NULL when errors occur after
> event creation but before successful completion.
>
> The changes ensure proper resource management and prevent potential memory
> corruption or leaks during module initialization and cleanup.
>
> Signed-off-by: Fidal palamparambil <rootuserhere@...il.com>
Please just stop.
Luis
Powered by blists - more mailing lists