Date: Wed, 21 Feb 2001 01:47:16 +0000 From: Tony Finch <dot@dotat.at> To: FreeBSD-gnats-submit@freebsd.org Subject: kern/25240: incomplete CDIOCREADSUBCHANNEL support in atapi-cd Message-ID: <E14VONA-0000FZ-00@hand.dotat.at>
next in thread | raw e-mail | index | archive | help
>Number: 25240 >Category: kern >Synopsis: incomplete CDIOCREADSUBCHANNEL support in atapi-cd >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Feb 20 17:50:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: Tony Finch >Release: FreeBSD 4.2-STABLE i386 >Organization: Covalent Technologies, Inc. >Environment: FreeBSD hand.dotat.at 4.2-STABLE FreeBSD 4.2-STABLE #4: Wed Feb 21 00:26:12 GMT 2001 fanf@hand.dotat.at:/FreeBSD/obj/FreeBSD/releng4/sys/DELL-Latitude-CSx i386 >Description: The implementation of CDIOCREADSUBCHANNEL in sys/dev/ata/atapi-cd.c only supports the CD_CURRENT_POSITION data_format, but it doesn't actually check the data_format to ensure that it is CD_CURRENT_POSITION. This manifests as garbage printed by `cdcontrol status media`. >How-To-Repeat: `cdcontrol status media` with an audio CD in an ATAPI drive prints garbage for the catalogue number. >Fix: This patch just checks that the data_format is supported. I'm not sure if ENODEV is right: would EOPNOTSUPP (as suggested by bfumerola) be more appropriate or does the fact that it isn't mentioned in the ioctl(2) man page mean that isn't allowed? Index: atapi-cd.c =================================================================== RCS file: /home/ncvs/src/sys/dev/ata/atapi-cd.c,v retrieving revision 1.48.2.9 diff -u -r1.48.2.9 atapi-cd.c --- atapi-cd.c 2001/01/29 18:07:18 1.48.2.9 +++ atapi-cd.c 2001/02/21 01:42:14 @@ -730,6 +730,11 @@ sizeof(cdp->subchan)>>8, sizeof(cdp->subchan), 0, 0, 0, 0, 0, 0, 0 }; + if (args->data_format != CD_CURRENT_POSITION) { + error = ENODEV; + break; + } + if (len > sizeof(data) || len < sizeof(struct cd_sub_channel_header)) { error = EINVAL; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E14VONA-0000FZ-00>