udev has truncated ID_SERIAL value for scsi disk
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sg3-utils (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Eoan |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
High
|
Unassigned |
Bug Description
[impact]
ID_SERIAL in udev for scsi disks is truncated.
[test case]
1. boot a vm with a scsi disk attached, e.g.
kvm -m 1024 -hda ~/images/focal.img -device virtio-
2. make sure sg3-utils is installed (it probably will be for eoan and will not for bionic)
3. reboot
4. check udevadm info --query=property /dev/sdX | grep ID_SERIAL=.
5. the value should be "322dc58dc023c7
[regression potential]
it's a one line change in a udev rule. It's possible some users have inadvertently depended on the serial being the same for all disks but it seems very unlikely. No other behaviour should change as a result of this fix.
[original report]
1.
root@ubuntu:
build_name: server
serial: 20200106
root@ubuntu:
Description: Ubuntu Focal Fossa (development branch)
Release: 20.04
2.
root@ubuntu:
systemd:
Installed: 244-3ubuntu1
Candidate: 244-3ubuntu1
Version table:
*** 244-3ubuntu1 500
500 http://
100 /var/lib/
3. ID_SERIAL value should be 322dc58dc023c7008
4. ID_SERIAL value is 3
--
Launching a qemu VM with the same extra scsi disk like so:
-drive file=extra_
-device scsi-hd,
On Focal udevadm info output:
root@ubuntu:
DEVPATH=
DEVNAME=/dev/sdc
DEVTYPE=disk
MAJOR=8
MINOR=32
SUBSYSTEM=block
USEC_INITIALIZE
SCSI_TPGS=0
SCSI_TYPE=disk
SCSI_VENDOR=QEMU
SCSI_VENDOR_
SCSI_MODEL=
SCSI_MODEL_
SCSI_REVISION=2.5+
ID_SCSI=1
ID_SCSI_INQUIRY=1
ID_VENDOR=QEMU
ID_VENDOR_
ID_MODEL=
ID_MODEL_
ID_REVISION=2.5+
ID_TYPE=disk
SCSI_IDENT_
SCSI_IDENT_
SCSI_IDENT_
ID_WWN=
ID_WWN_
ID_BUS=scsi
ID_SERIAL=3
ID_SERIAL_
MPATH_SBIN_
DM_MULTIPATH_
ID_PATH=
ID_PATH_
ID_FS_UUID=
ID_FS_UUID_
ID_FS_UUID_
ID_FS_UUID_
ID_FS_TYPE=btrfs
ID_FS_USAGE=
ID_BTRFS_READY=1
DEVLINKS=
TAGS=:systemd:
On Bionic:
root@ubuntu:~# cat /etc/cloud/
build_name: server
serial: 20200112
root@ubuntu:~# lsb_release -rd
Description: Ubuntu 18.04.3 LTS
Release: 18.04
root@ubuntu:~# apt-cache policy systemd
systemd:
Installed: 237-3ubuntu10.33
Candidate: 237-3ubuntu10.33
Version table:
*** 237-3ubuntu10.33 500
500 http://
100 /var/lib/
237-
500 http://
237-3ubuntu10 500
500 http://
root@ubuntu:~# udevadm info --query=property /dev/sdc
DEVLINKS=
DEVNAME=/dev/sdc
DEVPATH=
DEVTYPE=disk
ID_BTRFS_READY=1
ID_BUS=scsi
ID_FS_TYPE=btrfs
ID_FS_USAGE=
ID_FS_UUID=
ID_FS_UUID_
ID_FS_UUID_
ID_FS_UUID_
ID_MODEL=
ID_MODEL_
ID_PATH=
ID_PATH_
ID_REVISION=2.5+
ID_SCSI=1
ID_SCSI_
ID_SERIAL=
ID_SERIAL_
ID_TYPE=disk
ID_VENDOR=QEMU
ID_VENDOR_
ID_WWN=
ID_WWN_
MAJOR=8
MINOR=32
SUBSYSTEM=block
TAGS=:systemd:
USEC_INITIALIZE
ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: udev 244-3ubuntu1
ProcVersionSign
Uname: Linux 5.3.0-24-lowlatency x86_64
NonfreeKernelMo
ApportVersion: 2.20.11-0ubuntu15
Architecture: amd64
Date: Wed Jan 15 18:17:35 2020
Lsusb: Error: command ['lsusb'] failed with exit code 1:
Lsusb-t:
Lsusb-v: Error: command ['lsusb', '-v'] failed with exit code 1:
MachineType: QEMU Standard PC (i440FX + PIIX, 1996)
ProcEnviron:
TERM=xterm
PATH=(custom, no user)
LANG=C.UTF-8
SHELL=/bin/bash
ProcKernelCmdLine: root=squash:http://
SourcePackage: systemd
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 04/01/2014
dmi.bios.vendor: SeaBIOS
dmi.bios.version: 1.13.0-1
dmi.chassis.type: 1
dmi.chassis.vendor: QEMU
dmi.chassis.
dmi.modalias: dmi:bvnSeaBIOS:
dmi.product.name: Standard PC (i440FX + PIIX, 1996)
dmi.product.
dmi.sys.vendor: QEMU
Related branches
- Canonical Server: Pending requested
-
Diff: 37792 lines (+18706/-5241) (has conflicts)218 files modifiedBSD_LICENSE (+4/-1)
COVERAGE (+3/-1)
CREDITS (+10/-1)
ChangeLog (+102/-0)
Makefile.am (+2/-0)
Makefile.in (+11/-6)
README (+36/-14)
README.freebsd (+2/-1)
README.solaris (+2/-1)
README.win32 (+2/-1)
aclocal.m4 (+97/-113)
ar-lib (+2/-2)
archive/align_b4_memalign.c (+7/-2)
compile (+7/-6)
config.h.in (+6/-0)
configure (+145/-110)
configure.ac (+18/-1)
debian/changelog (+48/-17)
debian/control (+6/-3)
debian/gbp.conf (+4/-0)
debian/libsgutils2-2.symbols (+27/-2)
debian/libsgutils2-2.symbols.kfreebsd (+1/-1)
debian/patches/0001-Fix-path-for-udevadm.patch (+17/-7)
debian/patches/series (+4/-0)
debian/rules (+8/-2)
debian/upstream/metadata (+1/-0)
depcomp (+4/-4)
dev/null (+0/-79)
doc/Makefile.am (+10/-9)
doc/Makefile.in (+19/-16)
doc/rescan-scsi-bus.sh.8 (+2/-2)
doc/scsi_logging_level.8 (+1/-1)
doc/sg3_utils.8 (+58/-12)
doc/sg_dd.8 (+23/-3)
doc/sg_decode_sense.8 (+9/-9)
doc/sg_format.8 (+121/-71)
doc/sg_get_elem_status.8 (+100/-0)
doc/sg_get_lba_status.8 (+28/-13)
doc/sg_logs.8 (+15/-11)
doc/sg_luns.8 (+3/-3)
doc/sg_modes.8 (+6/-3)
doc/sg_raw.8 (+6/-4)
doc/sg_read.8 (+11/-3)
doc/sg_read_buffer.8 (+29/-5)
doc/sg_readcap.8 (+13/-4)
doc/sg_reassign.8 (+2/-2)
doc/sg_rep_zones.8 (+17/-6)
doc/sg_requests.8 (+17/-7)
doc/sg_sat_identify.8 (+3/-3)
doc/sg_scan.8.win32 (+2/-2)
doc/sg_ses.8 (+25/-12)
doc/sg_turs.8 (+11/-9)
doc/sg_verify.8 (+24/-12)
doc/sg_vpd.8 (+25/-8)
doc/sg_write_buffer.8 (+1/-1)
doc/sg_write_same.8 (+17/-11)
doc/sg_write_x.8 (+3/-3)
doc/sg_xcopy.8 (+31/-20)
doc/sgm_dd.8 (+3/-3)
doc/sgp_dd.8 (+11/-4)
examples/scsi_inquiry.c (+21/-19)
examples/sdiag_sas_p0_prbs9.txt (+12/-0)
examples/sdiag_sas_p1_prbs15.txt (+12/-0)
examples/sg_compare_and_write.txt (+1/-1)
examples/sg_excl.c (+26/-21)
examples/sg_sat_chk_power.c (+2/-3)
examples/sg_sat_smart_rd_data.c (+2/-3)
examples/sg_simple1.c (+29/-25)
examples/sgq_dd.c (+33/-30)
examples/transport_ids.txt (+1/-1)
include/Makefile.in (+8/-5)
include/freebsd_nvme_ioctl.h (+9/-2)
include/sg_cmds_basic.h (+5/-3)
include/sg_cmds_extra.h (+2/-0)
include/sg_cmds_mmc.h (+2/-0)
include/sg_io_linux.h (+11/-1)
include/sg_lib.h (+58/-17)
include/sg_lib_data.h (+11/-1)
include/sg_linux_inc.h (+1/-0)
include/sg_pr2serr.h (+2/-0)
include/sg_pt.h (+23/-4)
include/sg_pt_linux.h (+25/-3)
include/sg_pt_nvme.h (+10/-6)
include/sg_unaligned.h (+2/-0)
inhex/README (+50/-0)
inhex/get_elem_status.hex (+35/-0)
inhex/get_lba_status.hex (+14/-0)
inhex/ses_areca_all.hex (+186/-0)
inhex/vpd_consistuents.hex (+38/-0)
inhex/vpd_dev_id.hex (+5/-0)
inhex/vpd_lbpro.hex (+4/-0)
inhex/vpd_sfs.hex (+3/-0)
install-sh (+23/-13)
lib/BSD_LICENSE (+3/-1)
lib/Makefile.am (+2/-2)
lib/Makefile.in (+69/-26)
lib/sg_cmds_basic.c (+127/-71)
lib/sg_cmds_basic2.c (+112/-110)
lib/sg_cmds_extra.c (+524/-524)
lib/sg_cmds_mmc.c (+22/-24)
lib/sg_io_linux.c (+5/-2)
lib/sg_lib.c (+445/-90)
lib/sg_lib_data.c (+30/-5)
lib/sg_pt_common.c (+12/-4)
lib/sg_pt_freebsd.c (+77/-10)
lib/sg_pt_linux.c (+223/-36)
lib/sg_pt_linux_nvme.c (+125/-36)
lib/sg_pt_osf1.c (+63/-2)
lib/sg_pt_solaris.c (+64/-2)
lib/sg_pt_win32.c (+64/-4)
ltmain.sh (+153/-60)
missing (+8/-8)
scripts/40-usb-blacklist.rules (+6/-2)
scripts/54-before-scsi-sg3_id.rules (+55/-0)
scripts/55-scsi-sg3_id.rules (+83/-23)
scripts/58-scsi-sg3_symlink.rules (+2/-4)
scripts/59-fc-wwpn-id.rules (+3/-3)
scripts/Makefile.in (+8/-5)
scripts/rescan-scsi-bus.sh (+323/-287)
scripts/scsi-enable-target-scan.sh (+15/-0)
sg3_utils.spec (+7/-3)
src/BSD_LICENSE (+3/-1)
src/Makefile.am (+14/-12)
src/Makefile.in (+294/-94)
src/sg_bg_ctl.c (+12/-9)
src/sg_compare_and_write.c (+11/-9)
src/sg_copy_results.c (+15/-12)
src/sg_dd.c (+168/-93)
src/sg_decode_sense.c (+13/-159)
src/sg_emc_trespass.c (+2/-0)
src/sg_format.c (+300/-65)
src/sg_get_config.c (+2/-0)
src/sg_get_elem_status.c (+588/-0)
src/sg_get_lba_status.c (+216/-157)
src/sg_ident.c (+2/-0)
src/sg_inq.c (+25/-200)
src/sg_inq_data.c (+18/-13)
src/sg_logs.c (+267/-291)
src/sg_luns.c (+7/-5)
src/sg_map.c (+9/-6)
src/sg_map26.c (+2/-0)
src/sg_modes.c (+23/-5)
src/sg_opcodes.c (+52/-24)
src/sg_persist.c (+5/-3)
src/sg_prevent.c (+2/-0)
src/sg_raw.c (+31/-225)
src/sg_rbuf.c (+17/-15)
src/sg_rdac.c (+2/-0)
src/sg_read.c (+25/-21)
src/sg_read_attr.c (+16/-197)
src/sg_read_block_limits.c (+2/-0)
src/sg_read_buffer.c (+186/-31)
src/sg_read_long.c (+2/-0)
src/sg_readcap.c (+8/-6)
src/sg_reassign.c (+8/-2)
src/sg_referrals.c (+2/-0)
src/sg_rep_zones.c (+61/-20)
src/sg_requests.c (+170/-27)
src/sg_reset.c (+2/-0)
src/sg_reset_wp.c (+12/-10)
src/sg_rmsn.c (+2/-0)
src/sg_rtpg.c (+2/-0)
src/sg_safte.c (+2/-0)
src/sg_sanitize.c (+15/-17)
src/sg_sat_identify.c (+2/-0)
src/sg_sat_phy_event.c (+2/-0)
src/sg_sat_read_gplog.c (+2/-0)
src/sg_sat_set_features.c (+2/-0)
src/sg_scan_linux.c (+2/-0)
src/sg_scan_win32.c (+37/-17)
src/sg_seek.c (+8/-3)
src/sg_senddiag.c (+9/-6)
src/sg_ses.c (+100/-60)
src/sg_ses_microcode.c (+14/-14)
src/sg_start.c (+2/-0)
src/sg_stpg.c (+2/-0)
src/sg_stream_ctl.c (+18/-14)
src/sg_sync.c (+11/-9)
src/sg_test_rwbuf.c (+24/-19)
src/sg_timestamp.c (+19/-15)
src/sg_turs.c (+7/-5)
src/sg_unmap.c (+2/-0)
src/sg_verify.c (+45/-19)
src/sg_vpd.c (+443/-455)
src/sg_vpd_vendor.c (+16/-5)
src/sg_wr_mode.c (+2/-0)
src/sg_write_buffer.c (+53/-10)
src/sg_write_long.c (+2/-0)
src/sg_write_same.c (+29/-19)
src/sg_write_verify.c (+11/-10)
src/sg_write_x.c (+15/-19)
src/sg_xcopy.c (+25/-6)
src/sg_zone.c (+12/-10)
src/sginfo.c (+8/-3)
src/sgm_dd.c (+52/-40)
src/sgp_dd.c (+407/-247)
testing/Makefile (+42/-15)
testing/Makefile.freebsd (+3/-3)
testing/README (+26/-8)
testing/bsg_queue_tst.c (+3/-3)
testing/sg_chk_asc.c (+6/-5)
testing/sg_iovec_tst.c (+19/-15)
testing/sg_queue_tst.c (+100/-31)
testing/sg_sense_test.c (+3/-1)
testing/sg_tst_async.cpp (+1086/-164)
testing/sg_tst_bidi.c (+602/-0)
testing/sg_tst_context.cpp (+7/-9)
testing/sg_tst_excl.cpp (+336/-38)
testing/sg_tst_excl2.cpp (+12/-23)
testing/sg_tst_excl3.cpp (+14/-25)
testing/sg_tst_ioctl.c (+1198/-0)
testing/sg_tst_nvme.c (+6/-5)
testing/sgh_dd.cpp (+4676/-0)
testing/sgs_dd.c (+1343/-0)
testing/tst_sg_lib.c (+5/-3)
testing/uapi_sg.h (+484/-0)
utils/hxascdmp.1 (+9/-4)
utils/hxascdmp.c (+210/-6)
tags: | added: rls-ff-incoming |
tags: | removed: rls-ff-incoming |
tags: | added: id-5e3321e6edacef1db146c8bf |
Changed in systemd (Ubuntu Focal): | |
importance: | Undecided → High |
description: | updated |
Fairly sure the problem is this line from https:/ /git.launchpad. net/ubuntu/ +source/ sg3-utils/ tree/scripts/ 55-scsi- sg3_id. rules?h= applied/ 1.44-1ubuntu1# n48:
ENV{ID_ SERIAL} !="?*", ENV{SCSI_ IDENT_LUN_ NAA_EXT} =="?*", ENV{ID_BUS}="scsi", ENV{ID_ SERIAL} ="3$env{ SCSI_IDENT_ LUN_NAA} ", ENV{ID_ SERIAL_ SHORT}= "$env{SCSI_ IDENT_LUN_ NAA_EXT} "
(the variable being checked for and used are different). This appears to be fixed in a recent upstream commit https:/ /github. com/hreinecke/ sg3_utils/ commit/ c4c6af020963d11 b624da6abb53f79 2074f943b2# diff-20e0363765 997dae20aaceb68 ba039e3 that contains a whole bunch of other stuff. Cherry-picking just that fix would presumably help (and then the patch can be removed when next upstream release is uploaded).
FWIW, this buggy rule is present in bionic too, but I guess it doesn't fire for some reason -- I guess SCSI_IDENT_ LUN_NAA_ EXT isn't being emitted for some reason, but I haven't actually checked.