]> git.proxmox.com Git - mirror_zfs.git/commit - lib/libzfs/libzfs_sendrecv.c
Avoid core dump on invalid redaction bookmark
authorRyan Moeller <ryan@iXsystems.com>
Wed, 18 Mar 2020 19:54:12 +0000 (15:54 -0400)
committerGitHub <noreply@github.com>
Wed, 18 Mar 2020 19:54:12 +0000 (12:54 -0700)
commit22df2457a7b8265d999a2fe48f3e8e941c8fdde5
tree78a33a544b885b5cdbfcff1d2c7c16c44e35f529
parent4df8b2c3739c50be2e0a5aa5b6d0d131e8b8e3f3
Avoid core dump on invalid redaction bookmark

libzfs aborts and dumps core on EINVAL from the kernel when trying to
do a redacted send with a bookmark that is not a redaction bookmark.

Move redacted bookmark validation into libzfs.

Check if the bookmark given for redactions is actually a redaction
bookmark.  Print an error message and exit gracefully if it is not.

Don't abort on EINVAL in zfs_send_one.

Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #10138
cmd/zfs/zfs_main.c
lib/libzfs/libzfs_sendrecv.c
tests/zfs-tests/tests/functional/cli_root/zfs_bookmark/zfs_bookmark_cliargs.ksh
tests/zfs-tests/tests/functional/redacted_send/redacted_negative.ksh