Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yuntao Wang <ytcoode@gmail.com>
To: akpm@linux-foundation.org
Cc: bhe@redhat.com, ebiederm@xmission.com, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, ytcoode@gmail.com
Subject: Re: [PATCH] kexec_core: fix the assignment to kimage->control_page
Date: Fri, 22 Dec 2023 21:20:33 +0800	[thread overview]
Message-ID: <20231222132033.92651-1-ytcoode@gmail.com> (raw)
In-Reply-To: <20231221141258.7113f9b2599ea6d3b6638e08@linux-foundation.org>

On Thu, 21 Dec 2023 14:12:58 -0800, Andrew Morton <akpm@linux-foundation.org> wrote:

> On Thu, 21 Dec 2023 12:23:08 +0800 Yuntao Wang <ytcoode@gmail.com> wrote:
> 
> > image->control_page represents the starting address for allocating the next
> > control page, while hole_end represents the address of the last valid byte
> > of the currently allocated control page.
> > 
> > Therefore, after successfully allocating a control page, image->control_page
> > should be updated to `hole_end + 1`, rather than hole_end.
> 
> Thanks.  Again, please include a description of the userspace-visible effects of the bug.

This bug actually does not affect the correctness of allocating control
pages, because image->control_page is currently only used in
kimage_alloc_crash_control_pages(), and this function, when allocating
control pages, will first align image->control_page up to the nearest
`(1 << order) << PAGE_SHIFT` boundary, then use this value as the starting
address of the next control page. This ensures that the newly allocated
control page will use the correct starting address and not overlap with
previously allocated control pages.

Although it does not affect the correctness of the final result, it is
better for us to set image->control_page to the correct value, in case it
might be used elsewhere in the future, potentially causing errors.

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

      reply	other threads:[~2023-12-22 13:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-21  4:23 [PATCH] kexec_core: fix the assignment to kimage->control_page Yuntao Wang
2023-12-21 22:12 ` Andrew Morton
2023-12-22 13:20   ` Yuntao Wang [this message]

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=20231222132033.92651-1-ytcoode@gmail.com \
    --to=ytcoode@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.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