[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210401160710.45a7a9b8@gandalf.local.home>
Date: Thu, 1 Apr 2021 16:07:10 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [GIT PULL] ftrace: Check if pages were allocated before calling
free_pages()
On Wed, 31 Mar 2021 11:03:21 -0700
Linus Torvalds <torvalds@...ux-foundation.org> 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;
Powered by blists - more mailing lists