]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: limit the path size in send to PATH_MAX
authorChris Mason <clm@fb.com>
Sat, 26 Apr 2014 12:02:03 +0000 (05:02 -0700)
committerChris Mason <clm@fb.com>
Sat, 26 Apr 2014 12:02:03 +0000 (05:02 -0700)
commit6d3b4244353c49f550929b66f64e6ecd8b6b9d50
tree03380f86411c67a7ba84d3af697dcdfd01b9f66f
parent1d5b55822c66351e2eaec7c55f4a1f4b80296750
Btrfs: limit the path size in send to PATH_MAX

fs_path_ensure_buf is used to make sure our path buffers for
send are big enough for the path names as we construct them.
The buffer size is limited to 32K by the length field in
the struct.

But bugs in the path construction can end up trying to build
a huge buffer, and we'll do invalid memmmoves when the
buffer length field wraps.

This patch is step one, preventing the overflows.

Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/send.c