Re: [PATCH 2/3] s390/vmem: fix possible memory overwrite

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux