lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aFy4QaXmKicMLGLR@casper.infradead.org>
Date: Thu, 26 Jun 2025 04:02:25 +0100
From: Matthew Wilcox <willy@...radead.org>
To: "Vishal Moola (Oracle)" <vishal.moola@...il.com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	David Hildenbrand <david@...hat.com>,
	Jordan Rome <linux@...danrome.com>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [RFC PATCH 1/3] mm/memory.c: convert __copy_remote_vm_str() to
 folios

On Wed, Jun 25, 2025 at 07:00:22PM +0100, Matthew Wilcox wrote:
> > +		folio_offset = offset_in_folio(folio, addr);
> 
> Umm.  Not sure this is safe.  A folio might be mapped misaligned, so
> 'addr' might not give you the right offset within the folio.  I think
> you might need to use addr - (vma->vm_pgoff << PAGE_SHIFT).  But I'd
> defer to others here ... particularly when it comes to anonymous folios.

Sorry, this calculation is obviously wrong.  It should be something like
the calculation in linear_page_index(), only without throwing away the
bottom PAGE_SHIFT bits.  But that's for file VMAs only, and I'm not sure
what should be done for anon vmas.  Possibly there is no way?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ