]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
btrfs: fix unaligned access in readdir
authorDavid Sterba <dsterba@suse.com>
Mon, 16 Apr 2018 19:10:14 +0000 (21:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Apr 2018 09:00:36 +0000 (11:00 +0200)
commitdf84c88faa0bd09d18f1b7dfaf506f0eb05a5702
treeffa130dd528811219b6729168360520aea918fd4
parent7a8b85c5d4df3b80609c8de6dedf7536b5bfba8b
btrfs: fix unaligned access in readdir

commit 92d32170847bfff2dd08af2c016085779f2fd2a1 upstream.

The last update to readdir introduced a temporary buffer to store the
emitted readdir data, but as there are file names of variable length,
there's a lot of unaligned access.

This was observed on a sparc64 machine:

  Kernel unaligned access at TPC[102f3080] btrfs_real_readdir+0x51c/0x718 [btrfs]

Fixes: 23b5ec74943 ("btrfs: fix readdir deadlock with pagefault")
CC: stable@vger.kernel.org # 4.14+
Reported-and-tested-by: René Rebe <rene@exactcode.com>
Reviewed-by: Liu Bo <bo.liu@linux.alibaba.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/inode.c