lkml.org 
[lkml]   [2021]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kprobes: Limit max data_size of the kretprobe instances
On Wed,  1 Dec 2021 23:45:50 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:

> The kretprobe::data_size is unsigned (size_t) but it is
> used as 'data_size + sizeof(struct kretprobe_instance)'.
> Thus, it can be smaller than sizeof(struct kretprobe_instance)
> while allocating memory for the kretprobe_instance.

The above doesn't make sense.

data_size is unsigned but it is used as
'data_size + sizeof(struct kretprobe_instance)'.

What does that mean?

What can be smaller than sizeof(struct kretprobe_instance) and why does it
matter?

-- Steve


>
> To avoid this issue, introduce a max limitation of the
> kretprobe::data_size. 4KB per instance should be OK.
>

\
 
 \ /
  Last update: 2021-12-01 17:20    [W:0.027 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site