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-next>] [day] [month] [year] [list]
Date:   Tue, 1 Jun 2021 15:23:17 +0200
From:   Vincent Whitchurch <vincent.whitchurch@...s.com>
To:     <jack@...e.cz>
CC:     <linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>
Subject: __buffer_migrate_page() vs ll_rw_block()

I'm seeing occasional squashfs read failures ("squashfs_read_data failed
to read block") when compaction is run at the same time as reading from
squashfs, with something like the commands below.  The kernel version is
the latest stable/v5.4 kernel, v5.4.123.

 while :; do echo 1 > /proc/sys/vm/compact_memory; done &
 while :; do echo 3 > /proc/sys/vm/drop_caches; find fs/ > /dev/null; done &

On this kernel, squashfs uses ll_rw_block().  The problem is that
ll_rw_block() ignores BHs which it can't get a lock on, but
__buffer_migrate_page() can take the lock on the BHs in order to check
if they can be migrated.  If __buffer_migrate_page() holds the lock at
the same time that ll_rw_block() wants it, the BH is skipped and I/O is
not issued for these blocks, and squashfs ends up seeing
!buffer_uptodate() and erroring out.

On newer kernels, squashfs doesn't use ll_rw_block() anymore, but I
still see other users of that function in other filesystems, and AFAICS
the underlying problem of the race with __buffer_migrate_page() has not
yet been fixed.

I'd be happy to receive any suggestions about the right way to fix this.

Thank you.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ