Open SpComb opened 1 year ago
Symptoms similar to https://github.com/WayneD/rsync/issues/376, but cause is entirely different.
Interestingly it seems like rsync --old-args
also works - it doesn't seem to have any effect on the rsync server command, but I suppose it has some effect on the client file-list validation?
Using
USER@HOST:lvm:vgFoo/lvBar
as an rsync source fails with an rsync protocol incompatibility error if the rsync client version includes the fixes for CVE-2022-29154:However, the command actually executed by the rsync wrapper looks like this:
Note the additional trailing
/
on the rsync server source, which was NOT present in the originalUSER@HOST:lvm:vgFoo/lvBar
rsync source. This triggers the protocol error, and usingUSER@HOST:lvm:vgFoo/lvBar/
(with trailing/
) works as an rsync source.The extra trailing
/
is added by thepath
logic in the rsync wrapper'sLVMSource
- due to theqmsk.rsync-ssh-command
wrapper's use of temporary mountpoints for the LVM snapshots, it doesn't make any sense to send the mountpoint directory as-is, only its contents:https://github.com/qmsk/backup/blob/47e991a195136b28767eae7d51f6cfd448441884/qmsk/backup/rsync.py#L287 https://github.com/qmsk/backup/blob/47e991a195136b28767eae7d51f6cfd448441884/qmsk/backup/rsync.py#L315
The mismatch between the client and server trailing slash worked just fine in earlier versions of rsync, but breaks the increased validation of file names required by the CVE-2022-29154 fix. This is not an rsync regression, but rather a qmsk-backup bug and resulting rsync incompatibility.
The rsync wrapper logic must be fixed to require the client to supply the trailing
/
for any send from an LVM snapshot source, with a clear error message if this is missing. The rsync wrapper must never attempt to insert any additional trailing/
, as this will fail with the fixed rsync validation.