cdrom_id utility incorrectly treats failed SCSI requests which leads to incorrect udev events generation

Bug #651277 reported by mixel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
udev (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: udev

The bug was discovered while working with emulated USB CDROM device.

Usually such devices do not implement all SCSI MMC-3 commands like the normal optical drives and replay with fail in case of unimplemented SCSI request.

Bug was reproduced on various lab. boxes with Ubuntu 9.04 and 9.10 installed, thus probably not HW dependent.

It possible to reproduce bug the following way, attach usb device to PC, run usb tracer, run command:

/lib/udev/cdrom_id /dev/sr1

I receive the following output:

ID_CDROM=1
ID_CDROM_MEDIA=1
ID_CDROM_MEDIA_CD=1
ID_CDROM_MEDIA_SESSION_NEXT=20
ID_CDROM_MEDIA_TRACK_COUNT=1
ID_CDROM_MEDIA_TRACK_COUNT_DATA=1

I did a special build of firmware for USB device to fail on reception of SCSI Read Disk Information command, this command is not obligatory for USB CDROM emulator devices according to, so it's quite typical situation.

You can find SCSI Read Disk Information request on the attached USB trace. USB trace confirms that device respond with STALL. But ID_CDROM_MEDIA_SESSION_NEXT value appeared in cdrom_id utility output. If we will look into cdrom_id.c and cd_media_info() function we will see that it's only should happen on successful completion of corresponding SCSI request.

Ellisys USB Analysis software to read attached USB trace file can be downloaded here:
http://ellisys.com/products/usbex260/download.php

If USB device do not respond on SCSI READ TOC request correctly broken ID_CDROM_MEDIA_SESSION_LAST_OFFSET variable to be attached to the list as above, which in turn leads to auto-mount failure.

As the result of incorrect cd information processing some devices emulating CDROM by various manufacturers we have in laboratory were not automounted by Ubuntu, I will provide some device models soon.

ProblemType: Bug
Architecture: i386
Date: Wed Sep 29 21:45:45 2010
DistroRelease: Ubuntu 9.10
Lsusb:
 Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
MachineType: System manufacturer System Product Name
Package: udev 147~-6.1
ProcCmdLine: root=UUID=1aca6938-237c-4d90-98c2-9b89bedc767e ro quiet splash
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-22.65-generic
SourcePackage: udev
Uname: Linux 2.6.31-22-generic i686
XsessionErrors:
 (gnome-settings-daemon:18874): GLib-CRITICAL **: g_propagate_error: assertion `src != NULL' failed
 (gnome-settings-daemon:18874): GLib-CRITICAL **: g_propagate_error: assertion `src != NULL' failed
 (polkit-gnome-authentication-agent-1:18942): GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed
 (synaptic:23635): Gtk-CRITICAL **: gtk_tree_view_unref_tree_helper: assertion `node != NULL' failed
dmi.bios.date: 03/27/2006
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 0501
dmi.board.name: P5WD2
dmi.board.vendor: ASUSTeK Computer INC.
dmi.board.version: Rev 1.xx
dmi.chassis.asset.tag: Asset-1234567890
dmi.chassis.type: 3
dmi.chassis.vendor: Chassis Manufacture
dmi.chassis.version: Chassis Version
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr0501:bd03/27/2006:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKComputerINC.:rnP5WD2:rvrRev1.xx:cvnChassisManufacture:ct3:cvrChassisVersion:
dmi.product.name: System Product Name
dmi.product.version: System Version
dmi.sys.vendor: System manufacturer

Revision history for this message
mixel (mixel-net) wrote :
Revision history for this message
mixel (mixel-net) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.