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] [day] [month] [year] [list]
Message-ID: <ZLgnbMet0jgxbak/@casper.infradead.org>
Date:   Wed, 19 Jul 2023 19:11:56 +0100
From:   Matthew Wilcox <willy@...radead.org>
To:     Sidhartha Kumar <sidhartha.kumar@...cle.com>
Cc:     linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        akpm@...ux-foundation.org, songmuchun@...edance.com,
        mike.kravetz@...cle.com
Subject: Re: [PATCH] mm/hugetlb: get rid of page_hstate()

On Wed, Jul 19, 2023 at 10:59:44AM -0700, Sidhartha Kumar wrote:
> -			skip_pages = compound_nr(head) - (page - head);
> +			skip_pages = folio_nr_pages(folio) - (page - &folio->page);

It turns out that you can't do (page - head) under all configs.  It
works on all common ones, but the safe way to do what you want here is:

			skip_pages = folio_nr_pages(folio) -
					folio_page_idx(folio, page);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ