lkml.org 
[lkml]   [2023]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] tracing: Fix uaf issue when open the hist or hist_debug file
On Wed, 13 Dec 2023 09:51:38 +0800
Zheng Yejian <zhengyejian1@huawei.com> wrote:

> ---
> kernel/trace/trace_events_hist.c | 18 ++++++++++++++----
> 1 file changed, 14 insertions(+), 4 deletions(-)
>
> Steve, thanks for your review!
>
> v2:
> - Introduce tracing_single_release_file_tr() to add the missing call for
> single_release() as suggested by Steve;
> Link: https://lore.kernel.org/all/20231212113546.6a51d359@gandalf.local.home/
> - Slightly modify the commit message and comments.
>
> v1:
> Link: https://lore.kernel.org/all/20231212113317.4159890-1-zhengyejian1@huawei.com/
>
> diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
> index 1abc07fba1b9..5296a08c0641 100644
> --- a/kernel/trace/trace_events_hist.c
> +++ b/kernel/trace/trace_events_hist.c
> @@ -5619,14 +5619,22 @@ static int hist_show(struct seq_file *m, void *v)
> return ret;
> }
>
> +static int tracing_single_release_file_tr(struct inode *inode, struct file *filp)
> +{
> + tracing_release_file_tr(inode, filp);
> + return single_release(inode, filp);
> +}
> +

Hi Zheng,

Could you put the tracing_single_release_file_tr() into trace.c as a non
static function. Put the protocol in kernel/trace/trace.h.

Even though it's only used in trace_events_hist.c, I rather not hide it
there. If this issue appears for another file, I would look in trace.c and
trace.h for available functions to use.

Thanks,

-- Steve

\
 
 \ /
  Last update: 2023-12-13 14:02    [W:0.039 / U:0.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site