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]
Date: Wed, 28 Feb 2024 21:06:19 +0530
From: Charan Teja Kalla <quic_charante@...cinc.com>
To: Zi Yan <ziy@...dia.com>, David Hildenbrand <david@...hat.com>
CC: Matthew Wilcox <willy@...radead.org>, <gregkh@...uxfoundation.org>,
        <akpm@...ux-foundation.org>, <vbabka@...e.cz>, <dhowells@...hat.com>,
        <surenb@...gle.com>, <linux-mm@...ck.org>,
        <linux-kernel@...r.kernel.org>,
        #
 see patch description <stable@...r.kernel.org>,
        Huang Ying
	<ying.huang@...el.com>,
        Naoya Horiguchi <naoya.horiguchi@...ux.dev>
Subject: Re: [PATCH] mm/huge_memory: fix swap entry values of tail pages of
 THP

Thanks David/Zi Yan,

On 2/27/2024 9:45 PM, Zi Yan wrote:
> So likely we'd have to fix the stable kernels:
> 
> 4.19
> 5.4
> 5.10
> 5.15
> 6.1
> 
> That's a lot of pre-folio code. A backport of my series likely won't really make any sense.

So, I assume this is a consensus to have stable-only fix for this issue.

> 
> For v6.1, the fix would like below?
> 
> diff --git a/mm/migrate.c b/mm/migrate.c
> index c93dd6a31c31..c5968021fde0 100644
> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -423,8 +423,12 @@ int folio_migrate_mapping(struct address_space *mapping,
>         if (folio_test_swapbacked(folio)) {
>                 __folio_set_swapbacked(newfolio);
>                 if (folio_test_swapcache(folio)) {
> +                       int i;
> +
>                         folio_set_swapcache(newfolio);
> -                       newfolio->private = folio_get_private(folio);
> +                       for (i = 0; i < nr; i++)
> +                               set_page_private(folio_page(newfolio, i),
> +                                       page_private(folio_page(folio, i)));
>                 }
>                 entries = nr;
>         } else {

Similar to this is what we had tested[1] internally and observed no issues.

Can this be taken to 6.1, please?

[1]https://lore.kernel.org/linux-mm/8620c1a0-e091-46e9-418a-db66e621b9c4@quicinc.com/

Thanks,
Charan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ