linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [GIT PULL] ftrace: Check if pages were allocated before calling free_pages()
Date: Thu, 1 Apr 2021 16:07:10 -0400	[thread overview]
Message-ID: <20210401160710.45a7a9b8@gandalf.local.home> (raw)
In-Reply-To: <CAHk-=whyMxheOqXAORt9a7JK9gc9eHTgCJ55Pgs4p=X3RrQubQ@mail.gmail.com>

On Wed, 31 Mar 2021 11:03:21 -0700
Linus Torvalds <torvalds@linux-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;

  parent reply	other threads:[~2021-04-01 20:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-31 13:27 [GIT PULL] ftrace: Check if pages were allocated before calling free_pages() Steven Rostedt
2021-03-31 17:45 ` Linus Torvalds
2021-03-31 18:03   ` Linus Torvalds
2021-03-31 19:03     ` Steven Rostedt
2021-04-01 20:07     ` Steven Rostedt [this message]
2021-04-01 20:18       ` Linus Torvalds
2021-04-01 20:53         ` Steven Rostedt
2021-04-01 20:25       ` Steven Rostedt
2021-03-31 18:51   ` Steven Rostedt
2021-03-31 19:01     ` Linus Torvalds
2021-03-31 18:05 ` pr-tracker-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210401160710.45a7a9b8@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).