From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S268130AbUJDM6j (ORCPT ); Mon, 4 Oct 2004 08:58:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S268132AbUJDM6j (ORCPT ); Mon, 4 Oct 2004 08:58:39 -0400 Received: from open.hands.com ([195.224.53.39]:43686 "EHLO open.hands.com") by vger.kernel.org with ESMTP id S268130AbUJDM6d (ORCPT ); Mon, 4 Oct 2004 08:58:33 -0400 Date: Mon, 4 Oct 2004 14:09:42 +0100 From: Luke Kenneth Casson Leighton To: linux-kernel@vger.kernel.org Subject: [bug] 2.6.8: CDROM_SEND_PACKET ioctls failing as non-root on ide scsi drives Message-ID: <20041004130941.GE19341@lkcl.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.5.1+cvs20040105i X-hands-com-MailScanner: Found to be clean X-hands-com-MailScanner-SpamScore: s X-MailScanner-From: lkcl@lkcl.net Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org kernel 2.6.8. ioctl ("/dev/hdc", CDROM_SEND_PACKET, cmd) commands that are failing as non-root, even when permission is granted rwxrwxrwx to /dev/hdc, are, according to some debug info added to k3b: GET CONFIGURATION (46) error code: 0 sense key: NO SENSE (2) asc: 0 ascq: 0 and: MODE SELECT (55) error code: 0 sense key: NO SENSE (2) asc: 0 ascq: 0 the result is that k3b cannot determine that the drive exists, therefore it cannot use it even though cdrecord might actually work. as root, the following errors occur: MODE SELECT (46) errorcode: 70 sense key: ILLEGAL REQUEST (5) asc: 26 ascq: 0 READ DVD STRUCTURE (ad) errorcode: 70 sense key: NOT READY (2) asc: 3a ascq: 0 presumably it can be concluded that the GET CONFIGURATION ioctl command is the one at fault. ... what gives? l. -- -- Truth, honesty and respect are rare commodities that all spring from the same well: Love. If you love yourself and everyone and everything around you, funnily and coincidentally enough, life gets a lot better. -- lkcl.net
lkcl@lkcl.net
From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S268137AbUJDNCa (ORCPT ); Mon, 4 Oct 2004 09:02:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S268138AbUJDNC3 (ORCPT ); Mon, 4 Oct 2004 09:02:29 -0400 Received: from ns.virtualhost.dk ([195.184.98.160]:9113 "EHLO virtualhost.dk") by vger.kernel.org with ESMTP id S268137AbUJDNC1 (ORCPT ); Mon, 4 Oct 2004 09:02:27 -0400 Date: Mon, 4 Oct 2004 14:59:37 +0200 From: Jens Axboe To: Luke Kenneth Casson Leighton Cc: linux-kernel@vger.kernel.org Subject: Re: [bug] 2.6.8: CDROM_SEND_PACKET ioctls failing as non-root on ide scsi drives Message-ID: <20041004125937.GQ2287@suse.de> References: <20041004130941.GE19341@lkcl.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041004130941.GE19341@lkcl.net> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 04 2004, Luke Kenneth Casson Leighton wrote: > kernel 2.6.8. ioctl ("/dev/hdc", CDROM_SEND_PACKET, cmd) please search the archives, this has been discussed extensively over the last month. frankly, I don't know how you were even able to miss it :) -- Jens Axboe From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S267405AbUJDNbE (ORCPT ); Mon, 4 Oct 2004 09:31:04 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S267769AbUJDNbD (ORCPT ); Mon, 4 Oct 2004 09:31:03 -0400 Received: from zork.zork.net ([64.81.246.102]:1774 "EHLO zork.zork.net") by vger.kernel.org with ESMTP id S267405AbUJDNaG (ORCPT ); Mon, 4 Oct 2004 09:30:06 -0400 To: Luke Kenneth Casson Leighton Cc: linux-kernel@vger.kernel.org Subject: Re: [bug] 2.6.8: CDROM_SEND_PACKET ioctls failing as non-root on ide scsi drives References: <20041004130941.GE19341@lkcl.net> From: Sean Neakums Mail-Followup-To: Luke Kenneth Casson Leighton , linux-kernel@vger.kernel.org Date: Mon, 04 Oct 2004 14:30:03 +0100 In-Reply-To: <20041004130941.GE19341@lkcl.net> (Luke Kenneth Casson Leighton's message of "Mon, 4 Oct 2004 14:09:42 +0100") Message-ID: <6u4qlaehlw.fsf@zork.zork.net> User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: sneakums@zork.net X-SA-Exim-Scanned: No (on zork.zork.net); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Luke Kenneth Casson Leighton writes: > kernel 2.6.8. ioctl ("/dev/hdc", CDROM_SEND_PACKET, cmd) > > commands that are failing as non-root, even when permission is granted > rwxrwxrwx to /dev/hdc, are, according to some debug info added to k3b: > > GET CONFIGURATION (46) > error code: 0 > sense key: NO SENSE (2) > asc: 0 > ascq: 0 > > and: > > MODE SELECT (55) > error code: 0 > sense key: NO SENSE (2) > asc: 0 > ascq: 0 > > the result is that k3b cannot determine that the drive exists, therefore > it cannot use it even though cdrecord might actually work. > > > as root, the following errors occur: > > MODE SELECT (46) > errorcode: 70 > sense key: ILLEGAL REQUEST (5) > asc: 26 > ascq: 0 > > READ DVD STRUCTURE (ad) > errorcode: 70 > sense key: NOT READY (2) > asc: 3a > ascq: 0 > > presumably it can be concluded that the GET CONFIGURATION ioctl command > is the one at fault. > > ... what gives? CDROM_SEND_PACKET calls down to sg_io, which calls verify_command, which will not permit anyone but root to use any unrecognised commands. GET CONFIGURATION does not seems to be one of those recognised. This check for unrecognised commands is a fairly recent addition, IIRC. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S267362AbUJDNjD (ORCPT ); Mon, 4 Oct 2004 09:39:03 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S267449AbUJDNjD (ORCPT ); Mon, 4 Oct 2004 09:39:03 -0400 Received: from ns.virtualhost.dk ([195.184.98.160]:37032 "EHLO virtualhost.dk") by vger.kernel.org with ESMTP id S267362AbUJDNjB (ORCPT ); Mon, 4 Oct 2004 09:39:01 -0400 Date: Mon, 4 Oct 2004 15:36:10 +0200 From: Jens Axboe To: Luke Kenneth Casson Leighton , linux-kernel@vger.kernel.org Subject: Re: [bug] 2.6.8: CDROM_SEND_PACKET ioctls failing as non-root on ide scsi drives Message-ID: <20041004133610.GT2287@suse.de> References: <20041004130941.GE19341@lkcl.net> <6u4qlaehlw.fsf@zork.zork.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6u4qlaehlw.fsf@zork.zork.net> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 04 2004, Sean Neakums wrote: > CDROM_SEND_PACKET calls down to sg_io, which calls verify_command, > which will not permit anyone but root to use any unrecognised > commands. GET CONFIGURATION does not seems to be one of those > recognised. This check for unrecognised commands is a fairly recent > addition, IIRC. 2.6.8 didn't have any command granularity, you must be root to issue any comand there. -- Jens Axboe From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S266117AbUJDNto (ORCPT ); Mon, 4 Oct 2004 09:49:44 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S267353AbUJDNto (ORCPT ); Mon, 4 Oct 2004 09:49:44 -0400 Received: from zork.zork.net ([64.81.246.102]:8836 "EHLO zork.zork.net") by vger.kernel.org with ESMTP id S266117AbUJDNtm (ORCPT ); Mon, 4 Oct 2004 09:49:42 -0400 To: Jens Axboe Cc: Luke Kenneth Casson Leighton , linux-kernel@vger.kernel.org Subject: Re: [bug] 2.6.8: CDROM_SEND_PACKET ioctls failing as non-root on ide scsi drives References: <20041004130941.GE19341@lkcl.net> <6u4qlaehlw.fsf@zork.zork.net> <20041004133610.GT2287@suse.de> From: Sean Neakums Mail-Followup-To: Jens Axboe , Luke Kenneth Casson Leighton , linux-kernel@vger.kernel.org Date: Mon, 04 Oct 2004 14:49:39 +0100 In-Reply-To: <20041004133610.GT2287@suse.de> (Jens Axboe's message of "Mon, 4 Oct 2004 15:36:10 +0200") Message-ID: <6uu0tad24s.fsf@zork.zork.net> User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: sneakums@zork.net X-SA-Exim-Scanned: No (on zork.zork.net); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Jens Axboe writes: > On Mon, Oct 04 2004, Sean Neakums wrote: >> CDROM_SEND_PACKET calls down to sg_io, which calls verify_command, >> which will not permit anyone but root to use any unrecognised >> commands. GET CONFIGURATION does not seems to be one of those >> recognised. This check for unrecognised commands is a fairly recent >> addition, IIRC. > > 2.6.8 didn't have any command granularity, you must be root to issue any > comand there. I was looking at 2.6.8.1 when I wrote the above, although it's possible my eye skipped over something. verify_command certainly seems to do the check: http://lxr.linux.no/source/drivers/block/scsi_ioctl.c?v=2.6.8.1#L113 And it looks the same in the 2.6.8 tree I have here, too. (Not trying to be an ass, just concerned about my reading comprehension.) From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S267353AbUJDN6g (ORCPT ); Mon, 4 Oct 2004 09:58:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S267449AbUJDN6g (ORCPT ); Mon, 4 Oct 2004 09:58:36 -0400 Received: from ns.virtualhost.dk ([195.184.98.160]:38832 "EHLO virtualhost.dk") by vger.kernel.org with ESMTP id S267353AbUJDN6e (ORCPT ); Mon, 4 Oct 2004 09:58:34 -0400 Date: Mon, 4 Oct 2004 15:55:44 +0200 From: Jens Axboe To: Luke Kenneth Casson Leighton , linux-kernel@vger.kernel.org Subject: Re: [bug] 2.6.8: CDROM_SEND_PACKET ioctls failing as non-root on ide scsi drives Message-ID: <20041004135544.GW2287@suse.de> References: <20041004130941.GE19341@lkcl.net> <6u4qlaehlw.fsf@zork.zork.net> <20041004133610.GT2287@suse.de> <6uu0tad24s.fsf@zork.zork.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6uu0tad24s.fsf@zork.zork.net> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 04 2004, Sean Neakums wrote: > Jens Axboe writes: > > > On Mon, Oct 04 2004, Sean Neakums wrote: > >> CDROM_SEND_PACKET calls down to sg_io, which calls verify_command, > >> which will not permit anyone but root to use any unrecognised > >> commands. GET CONFIGURATION does not seems to be one of those > >> recognised. This check for unrecognised commands is a fairly recent > >> addition, IIRC. > > > > 2.6.8 didn't have any command granularity, you must be root to issue any > > comand there. > > I was looking at 2.6.8.1 when I wrote the above, although it's > possible my eye skipped over something. > > verify_command certainly seems to do the check: > > http://lxr.linux.no/source/drivers/block/scsi_ioctl.c?v=2.6.8.1#L113 > > And it looks the same in the 2.6.8 tree I have here, too. You are right, it was added before, my recollection of the events apparently isn't so good either. You are right in that GET_CONFIGURATION was added later, post 2.6.8 release. > (Not trying to be an ass, just concerned about my reading comprehension.) :-) -- Jens Axboe From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S267971AbUJDOMN (ORCPT ); Mon, 4 Oct 2004 10:12:13 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S267951AbUJDOMN (ORCPT ); Mon, 4 Oct 2004 10:12:13 -0400 Received: from open.hands.com ([195.224.53.39]:53162 "EHLO open.hands.com") by vger.kernel.org with ESMTP id S268157AbUJDOJo (ORCPT ); Mon, 4 Oct 2004 10:09:44 -0400 Date: Mon, 4 Oct 2004 15:20:50 +0100 From: Luke Kenneth Casson Leighton To: linux-kernel@vger.kernel.org Cc: 274867@bugs.debian.org, 274870@bugs.debian.org Subject: Re: [bug] 2.6.8: CDROM_SEND_PACKET ioctls failing as non-root on ide scsi drives Message-ID: <20041004142050.GC20930@lkcl.net> References: <20041004130941.GE19341@lkcl.net> <6u4qlaehlw.fsf@zork.zork.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="oC1+HKm2/end4ao3" Content-Disposition: inline In-Reply-To: <6u4qlaehlw.fsf@zork.zork.net> User-Agent: Mutt/1.5.5.1+cvs20040105i X-hands-com-MailScanner: Found to be clean X-hands-com-MailScanner-SpamScore: s X-MailScanner-From: lkcl@lkcl.net Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org --oC1+HKm2/end4ao3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Oct 04, 2004 at 02:30:03PM +0100, Sean Neakums wrote: > > ... what gives? > > CDROM_SEND_PACKET calls down to sg_io, which calls verify_command, > which will not permit anyone but root to use any unrecognised > commands. GET CONFIGURATION does not seems to be one of those > recognised. oh, right, i didn't think of checking that. so if i just add that command, everything works hunky-dory. well, i'll try it! l. -- -- Truth, honesty and respect are rare commodities that all spring from the same well: Love. If you love yourself and everyone and everything around you, funnily and coincidentally enough, life gets a lot better. -- lkcl.net
lkcl@lkcl.net
--oC1+HKm2/end4ao3 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="scsi_ioctl.diff" Index: drivers/block/scsi_ioctl.c =================================================================== RCS file: /cvsroot/selinux/nsa/linux-2.6/drivers/block/scsi_ioctl.c,v retrieving revision 1.1.1.9 diff -u -r1.1.1.9 scsi_ioctl.c --- drivers/block/scsi_ioctl.c 19 Aug 2004 14:25:16 -0000 1.1.1.9 +++ drivers/block/scsi_ioctl.c 4 Oct 2004 14:07:25 -0000 @@ -146,6 +146,7 @@ safe_for_read(GPCMD_READ_TOC_PMA_ATIP), safe_for_read(GPCMD_REPORT_KEY), safe_for_read(GPCMD_SCAN), + safe_for_read(GPCMD_GET_CONFIGURATION), /* Basic writing commands */ safe_for_write(WRITE_6), --oC1+HKm2/end4ao3-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S268156AbUJDOMo (ORCPT ); Mon, 4 Oct 2004 10:12:44 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S268157AbUJDOMo (ORCPT ); Mon, 4 Oct 2004 10:12:44 -0400 Received: from open.hands.com ([195.224.53.39]:57514 "EHLO open.hands.com") by vger.kernel.org with ESMTP id S268156AbUJDOMk (ORCPT ); Mon, 4 Oct 2004 10:12:40 -0400 Date: Mon, 4 Oct 2004 15:23:41 +0100 From: Luke Kenneth Casson Leighton To: Jens Axboe , linux-kernel@vger.kernel.org Subject: Re: [bug] 2.6.8: CDROM_SEND_PACKET ioctls failing as non-root on ide scsi drives Message-ID: <20041004142341.GD20930@lkcl.net> References: <20041004130941.GE19341@lkcl.net> <6u4qlaehlw.fsf@zork.zork.net> <20041004133610.GT2287@suse.de> <6uu0tad24s.fsf@zork.zork.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6uu0tad24s.fsf@zork.zork.net> User-Agent: Mutt/1.5.5.1+cvs20040105i X-hands-com-MailScanner: Found to be clean X-hands-com-MailScanner-SpamScore: s X-MailScanner-From: lkcl@lkcl.net Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 04, 2004 at 02:49:39PM +0100, Sean Neakums wrote: > Jens Axboe writes: > > > On Mon, Oct 04 2004, Sean Neakums wrote: > >> CDROM_SEND_PACKET calls down to sg_io, which calls verify_command, > >> which will not permit anyone but root to use any unrecognised > >> commands. GET CONFIGURATION does not seems to be one of those > >> recognised. This check for unrecognised commands is a fairly recent > >> addition, IIRC. > > > > 2.6.8 didn't have any command granularity, you must be root to issue any > > comand there. > > I was looking at 2.6.8.1 when I wrote the above, although it's > possible my eye skipped over something. ah yes now i have found the issue i have a confession to make, i'm actually running 2.6.8.1-selinux1. i didn't want to mention that in case it was selinux that was the problem :) l. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S268169AbUJDO1x (ORCPT ); Mon, 4 Oct 2004 10:27:53 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S268168AbUJDO1w (ORCPT ); Mon, 4 Oct 2004 10:27:52 -0400 Received: from open.hands.com ([195.224.53.39]:31403 "EHLO open.hands.com") by vger.kernel.org with ESMTP id S268169AbUJDO1S (ORCPT ); Mon, 4 Oct 2004 10:27:18 -0400 Date: Mon, 4 Oct 2004 15:38:24 +0100 From: Luke Kenneth Casson Leighton To: Jens Axboe Cc: linux-kernel@vger.kernel.org Subject: Re: [bug] 2.6.8: CDROM_SEND_PACKET ioctls failing as non-root on ide scsi drives Message-ID: <20041004143824.GH20930@lkcl.net> References: <20041004130941.GE19341@lkcl.net> <20041004125937.GQ2287@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041004125937.GQ2287@suse.de> User-Agent: Mutt/1.5.5.1+cvs20040105i X-hands-com-MailScanner: Found to be clean X-hands-com-MailScanner-SpamScore: s X-MailScanner-From: lkcl@lkcl.net Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 04, 2004 at 02:59:37PM +0200, Jens Axboe wrote: > On Mon, Oct 04 2004, Luke Kenneth Casson Leighton wrote: > > kernel 2.6.8. ioctl ("/dev/hdc", CDROM_SEND_PACKET, cmd) > > please search the archives, this has been discussed extensively over the > last month. frankly, I don't know how you were even able to miss it :) by not subscribing to the list, and searching for things as-and-when. ... i _did_ do a google search first, though, i promise! "linux kernel cdrom ioctl CDROM_SEND_PACKET" gave this: http://www.cs.helsinki.fi/linux/linux-kernel/2003-13/0617.html which isn't exactly this month... l.