Subject: kern/33193: rev 1.72 src/sys/dev/usb/usb.h breaks 3.0 binary compat
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <chuck@ece.cmu.edu>
List: netbsd-bugs
Date: 04/04/2006 23:55:00
>Number:         33193
>Category:       kern
>Synopsis:       rev 1.72 src/sys/dev/usb/usb.h breaks 3.0 binary compat
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 04 23:55:00 +0000 2006
>Originator:     Chuck Cranor
>Release:        NetBSD 3.0
>Organization:
CMU
>Environment:
System: NetBSD xxx.pdl.cmu.edu 3.0 NetBSD 3.0 (XXX) #0: Thu Jan 19 14:18:58 EST 2006 chuck@bum.pdl.cmu.edu:/home/netbsd/30/src/sys/arch/i386/compile/XXX i386
Architecture: i386
Machine: i386
>Description:

	rev 1.72 of src/sys/dev/usb/usb.h changes the size of 
	"struct usb_device_info" --- this causes the ioctl number
	of USB_DEVICEINFO to change.   this causes applications that
	work just fine with a 3.0 kernel to fail with 
	"errno 22 Invalid argument" ...

>How-To-Repeat:

	1. compile "gphoto2" from pkgsrc under 3.0.   
	2. upgrade your kernel to something past "2005/05/02 15:32:18"
		(e.g. -current in order to get the new ath driver)
	3. attach USB camera (e.g. canon powershot SD450) and run 
	   "gphoto2 --auto-detect"---it will fail here:

    51 gphoto2  CALL  open(0x80be008,0,0)
    51 gphoto2  NAMI  "/dev/usb0"
    51 gphoto2  RET   open 6
    51 gphoto2  CALL  ioctl(6,_IOWR('U',0x4,0x74),0xbfbfc830)
    51 gphoto2  GIO   fd 6 wrote 372 bytes
       "\0\^A\^E\b\0 \M^\\M-=\^E\0\0\0\M-0\M->\M-(\M-=\0\0\0\0\^T\0\0\0x\M-H\
        \M-?\M-?\M-p\M^C\M-'\M-=\^T\0\0\0\0\0\0\0\0\0\0\0\M->\M^C\M-'\M-=|\M-j\
        \M-?\M-=\0\0\0\0\0\0\f\b\M-0\M->\M-(\M-=\0\^P\0\0\0\0\f\b\M-8\M-H\M-?\
        \M-?O\M^L\M-'\M-=\^T\0\0\0\0\0\0\0|\M-j\M-?\M-=\M^@\M-G\M->\M-=\0\0\0\
        \0\^A\0\0\0\M-){\M-?\M-=i\f\M^]\M-=\^T\0\0\0\^C\00033\0\0\0\0\0\0\0\0\
        \0\0\0\0\0\0\0\0\M-4\M-H\M-?\M-?p=\M-5\M-=|\M-j\M-?\M-=I\0\0\0b|\M-?\
        \M-=\M-`        \M^]\M-=\M-`    \M^]\M-= \M-`\M-?\M-=\^[|\M-?\M-=\0\0\
        \0\0\0\0\0\0\0 \M^\\M-=|\M-j\M-?\M-=`\M-&\M-5\M-=\0\0\0\0\^A\0\0\0\M-)\
        {\M-?\M-=\M-`   \M^]\M-=\M^S\M-V\M^T\^C\0\M-@\M-5\M-=\^A\0\0\0\M-{f\
        \M^]\M-=\M-O    \M^]\M-=\0\M-@\M-5\M-=|\M-j\M-?\M-=@\M-&\M-5\M-=\0\0\0\
        \0\M-`  \M^]\M-=\^?}\M-?\M-=\M-`        \M^]\M-=\M^S\M-V\M^T\^C\M-D\
        \M^N\M-5\M-=d\M-I\M-?\M-?\^A\0\0\0\^Sx\^E\^O\0\M-@\M-5\M-=\^A\0\0\0\
        \M-9\M^]\M-4\M-=\M^P\M-I\M-?\M-?\0\M-@\M-5\M-=\M^S\M-V\M^T\^C\0\M-@\
        \M-5\M-=\M-L\a\M^]\M-=\0\M-@\M-5\M-=|\M-j\M-?\M-=\^\\^N\M^]\M-=T[\M^]\
        \M-=\b\M-J\M-?\M-?\M-Bg\M-?\M-=I\0\0\0\0\M-@\M-5\M-=\M^X\M-I\M-?\M-?\
        \^A\0\0\0\0\b\f\b/dev/usb\0\M-@\M-5\M-=\M-PZ\M^]\M-=\M-4\M-N\M-?\M-?"
    51 gphoto2  RET   ioctl -1 errno 22 Invalid argument

>Fix:

provide old ABI with COMPAT_30 like we usually do with libc, etc.
[or we we are going to intentionally break the 3.0 ABI and force
recompile of USB programs, make sure it is noted in the docs somewhere
for 4.0]