<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="/static/style.xsl" type="text/xsl"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
  <channel>
    <title>Most recent entries from all</title>
    <link>https://vulnerability.circl.lu</link>
    <description>Contains only the most 10 recent entries.</description>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>python-feedgen</generator>
    <language>en</language>
    <lastBuildDate>Wed, 07 Oct 2026 17:22:27 +0000</lastBuildDate>
    <item>
      <title>CVE-2024-26960 — mm: swap: fix race between free_swap_and_cache() and swapoff()</title>
      <link>https://vulnerability.circl.lu/vuln/cve-2024-26960</link>
      <description>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; Linux, linux_kernel, Siemens SIMATIC S7-1500 TM MFP - GNU/Linux subsystem&lt;/p&gt;
&lt;p&gt;In the Linux kernel, the following vulnerability has been resolved:&lt;/p&gt;
&lt;p&gt;mm: swap: fix race between free_swap_and_cache() and swapoff()&lt;/p&gt;
&lt;p&gt;There was previously a theoretical window where swapoff() could run and
teardown a swap_info_struct while a call to free_swap_and_cache() was
running in another thread.  This could cause, amongst other bad
possibilities, swap_page_trans_huge_swapped() (called by
free_swap_and_cache()) to access the freed memory for swap_map.&lt;/p&gt;
&lt;p&gt;This is a theoretical problem and I haven&amp;#39;t been able to provoke it from a
test case.  But there has been agreement based on code review that this is
possible (see link below).&lt;/p&gt;
&lt;p&gt;Fix it by using get_swap_device()/put_swap_device(), which will stall
swapoff().  There was an extra check in _swap_info_get() to confirm that
the swap entry was not free.  This isn&amp;#39;t present in get_swap_device()
because it doesn&amp;#39;t make sense in general due to the race between getting
the reference and swapoff.  So I&amp;#39;ve added an equivalent check directly in
free_swap_and_cache().&lt;/p&gt;
&lt;p&gt;Details of how to provoke one possible issue (thanks to David Hildenbrand
for deriving this):&lt;/p&gt;
&lt;p&gt;--8&amp;lt;-----&lt;/p&gt;
&lt;p&gt;__swap_entry_free() might be the last user and result in
&amp;#34;count == SWAP_HAS_CACHE&amp;#34;.&lt;/p&gt;
&lt;p&gt;swapoff-&amp;gt;try_to_unuse() will stop as soon as soon as si-&amp;gt;inuse_pages==0.&lt;/p&gt;
&lt;p&gt;So the question is: could someone reclaim the folio and turn
si-&amp;gt;inuse_pages==0, before we completed swap_page_trans_huge_swapped().&lt;/p&gt;
&lt;p&gt;Imagine the following: 2 MiB folio in the swapcache. Only 2 subpages are
stil…&lt;/p&gt;</description>
      <content:encoded>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; Linux, linux_kernel, Siemens SIMATIC S7-1500 TM MFP - GNU/Linux subsystem&lt;/p&gt;
&lt;p&gt;In the Linux kernel, the following vulnerability has been resolved:&lt;/p&gt;
&lt;p&gt;mm: swap: fix race between free_swap_and_cache() and swapoff()&lt;/p&gt;
&lt;p&gt;There was previously a theoretical window where swapoff() could run and
teardown a swap_info_struct while a call to free_swap_and_cache() was
running in another thread.  This could cause, amongst other bad
possibilities, swap_page_trans_huge_swapped() (called by
free_swap_and_cache()) to access the freed memory for swap_map.&lt;/p&gt;
&lt;p&gt;This is a theoretical problem and I haven&amp;#39;t been able to provoke it from a
test case.  But there has been agreement based on code review that this is
possible (see link below).&lt;/p&gt;
&lt;p&gt;Fix it by using get_swap_device()/put_swap_device(), which will stall
swapoff().  There was an extra check in _swap_info_get() to confirm that
the swap entry was not free.  This isn&amp;#39;t present in get_swap_device()
because it doesn&amp;#39;t make sense in general due to the race between getting
the reference and swapoff.  So I&amp;#39;ve added an equivalent check directly in
free_swap_and_cache().&lt;/p&gt;
&lt;p&gt;Details of how to provoke one possible issue (thanks to David Hildenbrand
for deriving this):&lt;/p&gt;
&lt;p&gt;--8&amp;lt;-----&lt;/p&gt;
&lt;p&gt;__swap_entry_free() might be the last user and result in
&amp;#34;count == SWAP_HAS_CACHE&amp;#34;.&lt;/p&gt;
&lt;p&gt;swapoff-&amp;gt;try_to_unuse() will stop as soon as soon as si-&amp;gt;inuse_pages==0.&lt;/p&gt;
&lt;p&gt;So the question is: could someone reclaim the folio and turn
si-&amp;gt;inuse_pages==0, before we completed swap_page_trans_huge_swapped().&lt;/p&gt;
&lt;p&gt;Imagine the following: 2 MiB folio in the swapcache. Only 2 subpages are
stil…&lt;/p&gt;</content:encoded>
      <guid isPermaLink="false">https://vulnerability.circl.lu/vuln/cve-2024-26960</guid>
    </item>
  </channel>
</rss>
