]> git.proxmox.com Git - pve-storage.git/commit
ZFSPlugin: untaint lun number
authorStoiko Ivanov <s.ivanov@proxmox.com>
Fri, 9 Oct 2020 15:13:44 +0000 (17:13 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 9 Oct 2020 16:07:37 +0000 (18:07 +0200)
commit609f117ff24d2cff6b155e1d4b1175ceebe5bd7b
tree25dc10bead1264c18c6c1515307b41fd66526e16
parent4731eb11180b0894814b58717eb78457ef4b03b6
ZFSPlugin: untaint lun number

ZFS over iSCSI fetches information about the disk-images via ssh, thus
the obtainted data is tainted (perlsec (1)).

Since pvedaemon runs with '-T' enabled trying to start a VM via GUI/API failed,
while it still worked via `qm` or `pvesh`.

The issue surfaced after commit cb9db10c1a9855cf40ff13e81f9dd97d6a9b2698 in
pve-common ('run_command: improve performance for logging and long lines'),
and results from concatenating the original (tainted) buffer to a variable,
instead of a captured subgroup.

Untainting the value in ZFSPlugin should not cause any regressiosn, since the
other 3 target providers already have a match on '\d+' for retrieving the
lun number.

reported via pve-user [0].

reproduced and tested by setting up a LIO-target (on top of a virtual PVE),
adding it as storage and trying to start a guest (with a disk on the
ZFS over iSCSI storage) with `perl -T /usr/sbin/qm start $vmid`

[0] https://lists.proxmox.com/pipermail/pve-user/2020-October/172055.html

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
PVE/Storage/ZFSPlugin.pm