linux-s390.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiko Carstens <hca@linux.ibm.com>
To: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: David Hildenbrand <david@redhat.com>, linux-s390@vger.kernel.org
Subject: Re: [PATCH 2/3] s390/vmem: fix possible memory overwrite
Date: Tue, 17 Nov 2020 19:44:22 +0100	[thread overview]
Message-ID: <20201117184422.GE4746@osiris> (raw)
In-Reply-To: <20201110105052.GA11672@oc3871087118.ibm.com>

On Tue, Nov 10, 2020 at 11:50:52AM +0100, Alexander Gordeev wrote:
> > >  static void __vmemmap_use_sub_pmd(unsigned long start, unsigned long end)
> > >  {
> > >+	unsigned long size = min(end - start, sizeof(struct page));
> > >+
> > >  	/*
> > >  	 * As we expect to add in the same granularity as we remove, it's
> > >  	 * sufficient to mark only some piece used to block the memmap page from
> > >  	 * getting removed (just in case the memmap never gets initialized,
> > >  	 * e.g., because the memory block never gets onlined).
> > >  	 */
> > >-	memset(__va(start), 0, sizeof(struct page));
> > >+	memset(__va(start), 0, size);
> > >  }
> > >  static void vmemmap_use_sub_pmd(unsigned long start, unsigned long end)
> > >
> > 
> > I don't really see a need for that. Can you spell out one possible
> > configuration that would trigger that in the future? It's sounds
> > very unlikely and I have the feeling there might be more to change
> > at other points.
> 
> No configuration in mind. But dependency on struct page is the only
> obstacle that prevents the whole thing to become generic (unless I
> am missing something). Moreover, the memset() would not be needed
> also - just a single non-PAGE_UNUSED word within [start..end) should
> be enough.

Well, I agree with David here - so not applying.

  reply	other threads:[~2020-11-17 18:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-10  9:36 [PATCH 0/3] s390/vmem: minor cleanup Alexander Gordeev
2020-11-10  9:36 ` [PATCH 1/3] s390/vmem: remove redundant check Alexander Gordeev
2020-11-10  9:41   ` David Hildenbrand
2020-11-17 18:43   ` Heiko Carstens
2020-11-10  9:36 ` [PATCH 2/3] s390/vmem: fix possible memory overwrite Alexander Gordeev
2020-11-10  9:41   ` David Hildenbrand
2020-11-10 10:50     ` Alexander Gordeev
2020-11-17 18:44       ` Heiko Carstens [this message]
2020-11-10  9:36 ` [PATCH 3/3] s390/vmem: make variable and function names consistent Alexander Gordeev
2020-11-17 18:44   ` Heiko Carstens

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=20201117184422.GE4746@osiris \
    --to=hca@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=linux-s390@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;
as well as URLs for NNTP newsgroup(s).