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: <20241108232901.3631-1-hdanton@sina.com>
Date: Sat,  9 Nov 2024 07:29:01 +0800
From: Hillf Danton <hdanton@...a.com>
To: syzbot <syzbot+078be8bfa863cb9e0c6b@...kaller.appspotmail.com>
Cc: Johannes Weiner <hannes@...xchg.org>,
	linux-kernel@...r.kernel.org,
	linux-mm@...ck.org,
	syzkaller-bugs@...glegroups.com,
	Kairui Song <ryncsn@...il.com>,
	Daan De Meyer <daan.j.demeyer@...il.com>
Subject: Re: [syzbot] [mm?] general protection fault in swap_reclaim_full_clusters

On Thu, 7 Nov 2024 09:23:35 -0500 Johannes Weiner <hannes@...xchg.org>
> On Tue, Nov 05, 2024 at 05:23:23PM -0800, syzbot wrote:
> > Hello,
> > 
> > syzbot found the following issue on:
> > 
> > HEAD commit:    59b723cd2adb Linux 6.12-rc6
> > git tree:       upstream
> > console output: https://syzkaller.appspot.com/x/log.txt?x=1076c740580000
> > kernel config:  https://syzkaller.appspot.com/x/.config?x=b77c8a55ccf1d9e2
> > dashboard link: https://syzkaller.appspot.com/bug?extid=078be8bfa863cb9e0c6b
> > compiler:       gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
> > syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=167aa1f7980000
> > C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=110d86a7980000

#syz test

The syzbot console output indicates a virtual environment where
swapfile is on a rotational device. In this case, clusters aren't
actually used, and si->full_clusters is not initialized. Daan's report
is from qemu, so likely rotational too.

Make sure to only schedule the cluster reclaim work when clusters are
actually in use.

Link: https://lore.kernel.org/lkml/672ac50b.050a0220.2edce.1517.GAE@google.com/
Link: https://github.com/systemd/systemd/issues/35044
Fixes: 5168a68eb78f ("mm, swap: avoid over reclaim of full clusters")
Reported-by: syzbot+078be8bfa863cb9e0c6b@...kaller.appspotmail.com
Reported-by: Daan De Meyer <daan.j.demeyer@...il.com>
Signed-off-by: Johannes Weiner <hannes@...xchg.org>
---
 mm/swapfile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/swapfile.c b/mm/swapfile.c
index 46bd4b1a3c07..9c85bd46ab7f 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -929,7 +929,7 @@ static void swap_range_alloc(struct swap_info_struct *si, unsigned long offset,
 		si->highest_bit = 0;
 		del_from_avail_list(si);
 
-		if (vm_swap_full())
+		if (si->cluster_info && vm_swap_full())
 			schedule_work(&si->reclaim_work);
 	}
 }
-- 
2.47.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ