public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* SG_IO and security
@ 2004-08-12 12:17 Alan Cox
  2004-08-12 16:39 ` Linus Torvalds
  0 siblings, 1 reply; 33+ messages in thread
From: Alan Cox @ 2004-08-12 12:17 UTC (permalink / raw)
  To: Linux Kernel Mailing List, torvalds

Since the entire thread seems to have died again unresolved I'd suggest
the following patch should get into 2.6.8 so that anyone with read
access to any block device cannot issue arbitary scsi commands to it
(like writes or firmware erase)

--- drivers/block/scsi_ioctl.c~	2004-08-12 14:14:38.078821640 +0100
+++ drivers/block/scsi_ioctl.c	2004-08-12 14:14:38.079821488 +0100
@@ -115,6 +115,8 @@
 	char sense[SCSI_SENSE_BUFFERSIZE];
 	unsigned char cmd[BLK_MAX_CDB];
 
+	if (!capable(CAP_SYS_RAWIO))
+		return -EPERM;
 	if (hdr->interface_id != 'S')
 		return -EINVAL;
 	if (hdr->cmd_len > BLK_MAX_CDB)


^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2004-08-16 22:24 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-12 12:17 SG_IO and security Alan Cox
2004-08-12 16:39 ` Linus Torvalds
2004-08-12 16:45   ` Linus Torvalds
2004-08-12 16:55     ` Jeff Garzik
2004-08-12 17:01       ` Jeff Garzik
2004-08-12 17:02       ` Linus Torvalds
2004-08-12 17:13         ` Jeff Garzik
2004-08-12 19:22         ` Kai Makisara
2004-08-13 19:25           ` Peter Jones
2004-08-13 19:37             ` Jeff Garzik
2004-08-14  7:22               ` Kai Makisara
2004-08-14 15:33                 ` Alan Cox
2004-08-16 22:24               ` Bill Davidsen
2004-08-16 22:00         ` Bill Davidsen
2004-08-12 17:06       ` Arjan van de Ven
2004-08-12 17:35     ` Jens Axboe
2004-08-12 18:29       ` Jens Axboe
2004-08-12 18:37         ` Jeff Garzik
2004-08-12 18:43           ` Jens Axboe
2004-08-12 18:45             ` Christoph Hellwig
2004-08-12 18:48               ` Jens Axboe
2004-08-12 20:19         ` Alan Cox
2004-08-12 20:16     ` Alan Cox
2004-08-12 22:51       ` Eric Lammerts
2004-08-13  0:09       ` Linus Torvalds
2004-08-13  6:59         ` Jens Axboe
2004-08-13  7:22           ` viro
2004-08-13  7:43           ` Arjan van de Ven
2004-08-13  7:46             ` Jens Axboe
2004-08-13 19:18               ` Jeff Garzik
2004-08-13 19:37                 ` Linus Torvalds
2004-08-13 19:44                   ` Jeff Garzik
2004-08-13 19:49     ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox