]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: fix unaligned access in readdir
authorDavid Sterba <dsterba@suse.com>
Mon, 16 Apr 2018 19:10:14 +0000 (21:10 +0200)
committerDavid Sterba <dsterba@suse.com>
Wed, 18 Apr 2018 22:35:08 +0000 (00:35 +0200)
commit7fbdb27ee3d707bb0d69df3105b97f3f497eeb51
treea86cbb655e5a787084da9c57b96de6bdcfd93b2e
parenta3b5a49d0adc0d73501c61f2548517203a77ae97
btrfs: fix unaligned access in readdir

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: d1e67115cbd ("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>
fs/btrfs/inode.c