Report forwarded to debian-devel@lists.debian.org, Simon Shapiro <Shimon@i-connect.net>:
Bug#3516; Package kernel.
debian-devel@lists.debian.orgSimon Shapiro <Shimon@i-connect.net>
Sorry, this message was lost when this bug report was restored from a backup.
Acknowledgement sent to Ian Jackson <ian@chiark.chu.cam.ac.uk>:
New bug report received and forwarded. Copy sent to Simon Shapiro <Shimon@i-connect.net>.
Ian Jackson <ian@chiark.chu.cam.ac.uk>
Sorry, this message was lost when this bug report was restored from a backup.
Received: (at submit) by bugs.debian.org; 3 Jul 1996 08:50:37 +0000
Received: (qmail-queue invoked from smtpd); 3 Jul 1996 08:36:27 -0000
Received: from artemis.chu.cam.ac.uk (root@131.111.131.1)
by master.debian.org with SMTP; 3 Jul 1996 08:36:26 -0000
Received: from chiark.chu.cam.ac.uk by artemis.chu.cam.ac.uk with smtp
(Smail3.1.29.1 #33) id m0ubcMW-0007wDC; Thu, 4 Jul 96 01:33 BST
Received: by chiark.chu.cam.ac.uk
id m0ubcMV-0002ZEC
(Debian /\oo/\ Smail3.1.29.1 #29.35); Thu, 4 Jul 96 01:33 BST
Message-Id:
Date: Thu, 4 Jul 96 01:33 BST
From: Ian Jackson
To: Debian bugs submission address
Subject: SCSI_IOCTL_SEND_COMMAND can cause major corruption
Package: kernel
Version: 2.0.0
I ran the program below with the arguments 5000 170 10.
(/dev/cdrom is my SCSI CD-ROM device). It is supposed to read digital
audio from the CD-ROM drive and save it to a file; the 10 is the
request size. Usually I run it with a request size of 1.
This time I ran it with a request size of 10, and it appeared to lock.
I interrupted it and ran it again and it coredumped. I tried to
remove the core and rm coredumped. I tried to do something else (I
forget what) and got a coredump from the copy of bash that had been
forked to do whatever it was, with a bizarre message about
relocations being all screwed up or something.
I conjecture that my in-memory copy of some important thing like the
libc had been badly damaged, and decided to hit the reset switch
rather than letting any more garbage be written to the disk.
I have a file that looks like one of the corefiles generated during
this incident. Let me know if you want it; it's 450K, or 55K
compressed.
I don't intend to try doing the same thing again to see whether the
problem is repeatable. Unfortunately it will be hard to reproduce
unless you have an NEC SCSI-2 CD-ROM drive, or some other drive with
the same commands for reading digital audio. However, you can
probably generate the problem by issuing perfectly ordinary READ
commands to a disk.
My SCSI controller is an NCR53c810:
scsi-ncr53c7,8xx : at PCI bus 0, device 11, function 0
scsi-ncr53c7,8xx : NCR53c810 at memory 0xfbff0000, io 0xe800, irq 10
scsi0 : burst length 8
scsi0 : NCR code relocated to 0x1c600 (virt 0x0001c600)
scsi0 : test 1 started
scsi0 : NCR53c{7,8}xx (rel 17)
scsi : 1 host.
...
scsi0 : target 5 accepting period 200ns offset 8 5.00MHz synchronous SCSI
scsi0 : setting target 5 to period 200ns offset 8 5.00MHz synchronous SCSI
Vendor: NEC Model: CD-ROM DRIVE:211 Rev: 1.0
Type: CD-ROM ANSI SCSI revision: 02
Detected scsi CD-ROM sr0 at scsi0, channel 0, id 5, lun 0
Ian.
#include
#include
#include
#include
#include
#include
#include
#include
#include
#ifndef SCSI_IOCTL_SEND_COMMAND
#define SCSI_IOCTL_SEND_COMMAND 1
#endif
#define IOCBUFSZ 1638400
#define BLOCKAUDIO 2352
#define BLOCKSUBQ 16
#define BLOCKSUBCODE 96
#define BLOCKTOTAL (BLOCKAUDIO+BLOCKSUBCODE)
struct msf { unsigned char m,s,f; };
struct subq {
unsigned control:4;
unsigned address:4;
unsigned char tno, indexx;
struct msf elapsed;
unsigned char zero1;
struct msf absolute;
unsigned char zero6[6];
};
int main(int argc, char **argv) {
int fd, r, e, i, nn, ns, ne, j, dfd, sfd;
char *s;
unsigned long ul;
unsigned short us;
struct subq *subq;
struct {
int length_of_input_data;
int length_of_output_buffer;
char actualstuff[IOCBUFSZ];
} ioctlbuf;
fd= open("/dev/cdrom",O_RDONLY);
if (fd<0) { perror("open device"); exit(1); }
dfd= open("rawsample",O_WRONLY|O_CREAT|O_TRUNC,0666);
if (dfd<0) { perror("create rawsample"); exit(1); }
sfd= open("subcode",O_WRONLY|O_CREAT|O_TRUNC,0666);
if (sfd<0) { perror("create subcode"); exit(1); }
ns= argc>1 ? atoi(argv[1]) : 0; /* Starting request number */
nn= argc>2 ? atoi(argv[2]) : 1; /* Number of requests */
ne= argc>3 ? atoi(argv[3]) : 1; /* Quantity in each request */
for (i=0; icontrol&0x0d],
(subq->control&0x02) ? '!' : '+',
subq->address,
subq->indexx, subq->tno,
subq->elapsed.m, subq->elapsed.s, subq->elapsed.f /*BCD!*/,
subq->absolute.m, subq->absolute.s, subq->absolute.f /*BCD!*/,
subq->zero1,
subq->zero6[0], subq->zero6[1], subq->zero6[2],
subq->zero6[3], subq->zero6[4], subq->zero6[5]);
}
}
}
exit(0);
}