commit f812466f68b8e020818c6454d7b7a7e278bc99f6
Author: Martin Wilck <email address hidden>
Date: Wed Aug 24 19:05:08 2022 +0200
multipathd: more robust command parsing
Before this patch, multipathd command "map 36589cfc0000007507940a4aaf05aead6 setprkey key 214872831593209" was fine.
With this patch, it has to be "setprkey map 36589cfc0000007507940a4aaf05aead6 key 214872831593209"
Hi,
scsi3 pgr managed by mpathpersist command is broken in multipath-tools (0.8.8- 1ubuntu1. 22.04.1)
1) Release
----------
root@qau22c13n2:~# lsb_release -rd
Description: Ubuntu 22.04.2 LTS
Release: 22.04
2) Package version
------------------
root@qau22c13n2:~# apt-cache policy multipath-tools 22.04.1 22.04.1 22.04.1 500 us.archive. ubuntu. com/ubuntu jammy-updates/main amd64 Packages us.archive. ubuntu. com/ubuntu jammy-security/main amd64 Packages dpkg/status us.archive. ubuntu. com/ubuntu jammy/main amd64 Packages
multipath-tools:
Installed: 0.8.8-1ubuntu1.
Candidate: 0.8.8-1ubuntu1.
Version table:
*** 0.8.8-1ubuntu1.
500 http://
500 http://
100 /var/lib/
0.8.8-1ubuntu1 500
500 http://
3) What you expected to happen ------- ------- ------- --
-------
Log from 20.04, which is not impacted by the issue
root@qau20c26n1:~# mpathpersist -i -k /dev/dm-18 sark=0x21487283 1999999 /dev/dm-18 3203b03118b408d b8c: pr message=map 36589cfc0000006 3203b03118b408d b8c setprkey key 214872831999999 3203b03118b408d b8c: message=map 36589cfc0000006 3203b03118b408d b8c setprkey key 214872831999999 reply=ok
PR generation=0x4, 0 registered reservation key.
root@qau20c26n1:~# mpathpersist -v2 --out --register-ignore --param-
Jul 11 17:10:27 | 36589cfc0000006
Jul 11 17:10:27 | 36589cfc0000006
Jul 11 17:10:27 | 36589cfc0000006 3203b03118b408d b8c: pr message=map 36589cfc0000006 3203b03118b408d b8c setprstatus 3203b03118b408d b8c: message=map 36589cfc0000006 3203b03118b408d b8c setprstatus reply=ok
Jul 11 17:10:27 | 36589cfc0000006
root@qau20c26n1:~# echo $? 999999 999999
0
root@qau20c26n1:~# mpathpersist -i -k /dev/dm-18
PR generation=0x6, 2 registered reservation keys follow:
0x214872831
0x214872831
=> the key is correctly registered
4) What happened instead ------- ------- ---
-------
root@qau22c13n2:~# mpathpersist -i -k /dev/dm-14 sark=0x21487283 1593209 /dev/dm-14 507940a4aaf05ae ad6: adding new path sdv 507940a4aaf05ae ad6: adding new path sdac 507940a4aaf05ae ad6: pr message=map 36589cfc0000007 507940a4aaf05ae ad6 setprkey key 214872831593209 507940a4aaf05ae ad6: message=map 36589cfc0000007 507940a4aaf05ae ad6 setprkey key 214872831593209 reply=map 36589cfc0000007 507940a4aaf05ae ad6 setprkey key 214872831593209: Missing argument
PR generation=0x3, 0 registered reservation key.
root@qau22c13n2:~# mpathpersist -v2 --out --register-ignore --param-
8710.372441 | 36589cfc0000007
8710.375149 | 36589cfc0000007
8710.375236 | 36589cfc0000007
8710.375393 | 36589cfc0000007
multipath-tools v0.8.8 (03/12, 2021)
CLI commands reference:
list|show paths
list|show paths format $format
list|show paths raw format $format
list|show path $path
list|show maps|multipaths
list|show status
list|show daemon
list|show maps|multipaths status
list|show maps|multipaths stats
list|show maps|multipaths format $format
list|show maps|multipaths raw format $format
list|show maps|multipaths topology
list|show topology
list|show maps|multipaths json
list|show map|multipath $map topology
list|show map|multipath $map format $format
list|show map|multipath $map raw format $format
list|show map|multipath $map json
list|show config local
list|show config
list|show blacklist
list|show devices
list|show wildcards
reset maps|multipaths stats
reset map|multipath $map stats
add path $path
remove|del path $path
add map|multipath $map
remove|del map|multipath $map
remove|del maps|multipaths
switch|switchgroup map|multipath $map group $group
reconfigure
reconfigure all
suspend map|multipath $map
resume map|multipath $map
resize map|multipath $map
reload map|multipath $map
reset map|multipath $map
reinstate path $path
fail path $path
disablequeueing map|multipath $map
restorequeueing map|multipath $map
disablequeueing maps|multipaths
restorequeueing maps|multipaths
quit|exit
shutdown
getprstatus map|multipath $map
setprstatus map|multipath $map
unsetprstatus map|multipath $map
forcequeueing daemon
restorequeueing daemon
getprkey map|multipath $map
setprkey map|multipath $map key $key
unsetprkey map|multipath $map
setmarginal path $path
unsetmarginal path $path
unsetmarginal map|multipath $map
8710.375427 | 36589cfc0000007 507940a4aaf05ae ad6: failed to set prkey for multipathd.
PR out: command failed
root@qau22c13n2:~# echo $?
13
root@qau22c13n2:~# mpathpersist -i -k /dev/dm-14
PR generation=0x3, 0 registered reservation key.
=> the key is not registered
5) Root Cause
-------------
multipath-tools (0.8.8- 1ubuntu1. 22.04.1) introduced a regression from the patch below (from CVE-2022-41974)
https:/ /github. com/opensvc/ multipath- tools/commit/ f812466f68b8e02 0818c6454d7b7a7 e278bc99f6
commit f812466f68b8e02 0818c6454d7b7a7 e278bc99f6
Author: Martin Wilck <email address hidden>
Date: Wed Aug 24 19:05:08 2022 +0200
multipathd: more robust command parsing
Before this patch, multipathd command "map 36589cfc0000007 507940a4aaf05ae ad6 setprkey key 214872831593209" was fine. 507940a4aaf05ae ad6 key 214872831593209"
With this patch, it has to be "setprkey map 36589cfc0000007
It has been fixed upstream in the patch below:
https:/ /github. com/opensvc/ multipath- tools/commit/ 04912e2fea94da2 e7ccedabab5725b 07ade2bcd4
commit 04912e2fea94da2 e7ccedabab5725b 07ade2bcd4
Author: Benjamin Marzinski <email address hidden>
Date: Tue Nov 29 22:56:48 2022 -0600
libmpathper sist: fix command keyword ordering
Thanks for your work.