[Devel] [PATCH hci-8.2 v2 1/3] dm/push_backup: return -EINVAL for malformed target messages

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Wed Nov 18 17:00:42 MSK 2026


> pb_message() sets ret to -EINVAL before it checks the arguments, but
> then it overwrites ret with the result of taking ctl_rwsem, which is 0
> on success. Because of that every argument check after the lock jumps
> to unlock with ret == 0. The message is rejected and nothing is done,
> but the caller sees success:
> 
>   # dmsetup message pbt 0 push_backup_start abc
>   # echo $?
>   0
>   # dmsetup status pbt
>   0 2097152 push_backup 7:0 128 0 inactive
> 
> This affects push_backup_start with a wrong number of arguments or an
> unparsable timeout or mask, push_backup_read and push_backup_get_fd
> with extra arguments, and push_backup_write with a malformed range.
> push_backup_stop is not affected, because it checks its arguments
> before the lock is taken.
> 
> Fix this by setting ret back to -EINVAL after the lock is taken.
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-155761
> 
> Feature: dm-backup: push backup target driver
> Fixes: 162123bc62c7 ("dm: Add push backup driver")
> Signed-off-by: Vasileios Almpanis <vasileios.almpanis at virtuozzo.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261118-vstor-153891-v2-0-e91753150b91@virtuozzo.com?part=1




More information about the Devel mailing list