btrfs-progs/common
Boris Burkov aa1ca3789e btrfs-progs: receive: support v2 send stream DATA tlv format
The new format privileges the BTRFS_SEND_A_DATA attribute by
guaranteeing it will always be the last attribute in any command that
needs it, and by implicitly encoding the data length as the difference
between the total command length in the command header and the sizes of
the rest of the attributes (and of course the tlv_type identifying the
DATA attribute). To parse the new stream, we must read the tlv_type and
if it is not DATA, we proceed normally, but if it is DATA, we don't
parse a tlv_len but simply compute the length.

In addition, we add some bounds checking when parsing each chunk of
data, as well as for the tlv_len itself.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Boris Burkov <boris@bur.io>
Signed-off-by: David Sterba <dsterba@suse.com>
2022-06-07 13:59:32 +02:00
..
box.h btrfs-progs: build most common tools into one binary (busybox style) 2019-07-04 15:30:40 +02:00
defs.h btrfs-progs: move common-defs to common/ 2020-03-31 18:37:35 +02:00
device-scan.c btrfs-progs: remove temporary buffer for super block 2021-11-05 12:50:03 +01:00
device-scan.h btrfs-progs: clean up test_uuid_unique 2021-10-08 20:46:33 +02:00
device-utils.c btrfs-progs: fix discard support check 2021-11-18 10:17:21 +01:00
device-utils.h btrfs-progs: introduce btrfs_pread wrapper for pread 2021-10-20 18:59:23 +02:00
extent-cache.c btrfs-progs: unify GPL header comments 2021-09-07 13:58:44 +02:00
extent-cache.h btrfs-progs: libbtrfs: drop ifdef BTRFS_FLAT_INCLUDES where not necessary 2022-06-06 15:48:52 +02:00
format-output.c btrfs-progs: split unit related helpers from utils.c 2021-05-06 16:41:47 +02:00
format-output.h btrfs-progs: lots of typo fixes (codespell) 2020-03-31 18:37:38 +02:00
fsfeatures.c btrfs-progs: common: allow users to select extent-tree-v2 option 2021-11-30 19:07:34 +01:00
fsfeatures.h btrfs-progs: drop ZONED flag from BTRFS_CONVERT_ALLOWED_FEATURES 2021-10-08 20:47:04 +02:00
help.c btrfs-progs: split global help HELPINFO_INSERT_GLOBALS 2020-06-12 19:30:36 +02:00
help.h btrfs-progs: add global verbose and quiet options and helper functions 2020-06-12 19:30:43 +02:00
internal.h btrfs-progs: move internal.h to common/ 2019-07-03 20:49:03 +02:00
messages.c btrfs-progs: add global verbose and quiet options and helper functions 2020-06-12 19:30:43 +02:00
messages.h btrfs-progs: add separate verbosity level for on-by-default messages 2020-06-12 19:32:29 +02:00
open-utils.c btrfs-progs: split open/close helpers from utils.c 2021-05-06 16:41:47 +02:00
open-utils.h btrfs-progs: split open/close helpers from utils.c 2021-05-06 16:41:47 +02:00
parse-utils.c btrfs-progs: make "btrfs filesystem df" command show upper case profile 2021-11-05 12:50:03 +01:00
parse-utils.h btrfs-progs: move parse_qgroupid to parse utils 2021-09-07 14:20:42 +02:00
path-utils.c btrfs-progs: receive: fix btrfs_mount_root substring bug 2021-02-19 16:29:40 +01:00
path-utils.h btrfs-progs: remove unnecessary linux/*.h includes 2021-05-06 16:41:47 +02:00
rbtree-utils.c btrfs-progs: move rbtree-utils.[ch] to common/ 2019-07-03 20:49:04 +02:00
rbtree-utils.h btrfs-progs: remove c++ protection from internal headers 2021-10-08 20:47:04 +02:00
repair.c btrfs-progs: check: handle the block group tree properly 2022-03-09 18:07:12 +01:00
repair.h btrfs-progs: search all extent roots for marking used space 2021-11-30 19:00:12 +01:00
send-stream.c btrfs-progs: receive: support v2 send stream DATA tlv format 2022-06-07 13:59:32 +02:00
send-stream.h btrfs-progs: remove BTRFS_FLAT_INCLUDES from internal send headers 2021-10-08 20:46:34 +02:00
send-utils.c btrfs-progs: remove unused subvol_uuid_search_add 2021-10-08 20:47:04 +02:00
send-utils.h btrfs-progs: remove unused subvol_uuid_search_add 2021-10-08 20:47:04 +02:00
string-table.c btrfs-progs: move string-table.[ch] to common/ 2019-07-03 20:49:03 +02:00
string-table.h btrfs-progs: move string-table.[ch] to common/ 2019-07-03 20:49:03 +02:00
task-utils.c btrfs-progs: move task-utils.[ch] to common/ 2019-07-03 20:49:03 +02:00
task-utils.h btrfs-progs: move task-utils.[ch] to common/ 2019-07-03 20:49:03 +02:00
units.c btrfs-progs: split unit related helpers from utils.c 2021-05-06 16:41:47 +02:00
units.h btrfs-progs: split unit related helpers from utils.c 2021-05-06 16:41:47 +02:00
utils.c btrfs-progs: make device add and paused balance work together 2022-05-03 22:48:14 +02:00
utils.h btrfs-progs: make device add and paused balance work together 2022-05-03 22:48:14 +02:00