On Wed, 31 Mar 2021 11:03:21 -0700
Linus Torvalds <[email protected]> wrote:

> @@ -6231,7 +6231,8 @@ static int ftrace_process_locs(struct module *mod,
>               if (!addr)
>                       continue;
>  
> -             if (pg->index == pg->size) {
> +             end_offset = (pg->index+1) * sizeof(pg->records[0]);
> +             if (end_offset < PAGE_SIZE << pg->order) {

I believe that needs to be:

        if (end_offset >= PAGE_SIZE << pg->order) {

But as you said, you didn't test it. I'll look to see what else needs to be
fixed.

-- Steve


>                       /* We should have allocated enough */
>                       if (WARN_ON(!pg->next))
>                               break;

Reply via email to