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: <20241230120231.706-1-hdanton@sina.com>
Date: Mon, 30 Dec 2024 20:02:30 +0800
From: Hillf Danton <hdanton@...a.com>
To: syzbot <syzbot+c0673e1f1f054fac28c2@...kaller.appspotmail.com>
Cc: linux-kernel@...r.kernel.org,
	syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [mm?] WARNING in __folio_rmap_sanity_checks (2)

On Fri, 27 Dec 2024 20:56:21 -0800
> syzbot has found a reproducer for the following issue on:
> 
> HEAD commit:    8155b4ef3466 Add linux-next specific files for 20241220
> git tree:       linux-next
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=1652fadf980000

#syz test

--- x/mm/filemap.c
+++ y/mm/filemap.c
@@ -3636,6 +3636,10 @@ static vm_fault_t filemap_map_folio_rang
 		continue;
 skip:
 		if (count) {
+			for (unsigned int i = 0; i < count; i++) {
+				if (page_folio(page + i) != folio)
+					goto out;
+			}
 			set_pte_range(vmf, folio, page, count, addr);
 			*rss += count;
 			folio_ref_add(folio, count);
@@ -3658,6 +3662,7 @@ skip:
 			ret = VM_FAULT_NOPAGE;
 	}
 
+out:
 	vmf->pte = old_ptep;
 
 	return ret;
@@ -3738,8 +3743,8 @@ vm_fault_t filemap_map_pages(struct vm_f
 		addr += (xas.xa_index - last_pgoff) << PAGE_SHIFT;
 		vmf->pte += xas.xa_index - last_pgoff;
 		last_pgoff = xas.xa_index;
-		end = folio_next_index(folio) - 1;
-		nr_pages = min(end, end_pgoff) - xas.xa_index + 1;
+		end = folio_next_index(folio) -1;
+		nr_pages = min(end, end_pgoff) - xas.xa_index;
 
 		if (!folio_test_large(folio))
 			ret |= filemap_map_order0_folio(vmf,
--

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ