OT] Joerg Schilling flames Linux on his Blog
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 3 lines · "Bodo Eggert <[email protected]>" <[email protected]>…
I just burned a CD on my IDE-burner using
mmc_cdrwith cdrtools-2.01 (the one without the hack) on a vanilla 2.6.11.10. I can even scan both my SCSI and IDE devices using -dev=ATAPI, but not without -dev.
The unability to give this kind of convenience to cdrecord users is a result of the refusal of the Linux kernel crew to include the kernel internal device instance numbers in the ioctl structures I need to read. Note that the fields are there but the information is intentionally obscured for come of the calls just to make the life of cdrecord useers harder :-(
Quoted 1 line
(I'm running as user, and cdrecord has no need for suid bits.)
I am frequently reading false claims like this. Usually from people who do not have the needed SCSI background knowledge to understand that SCSI is a protocol where commands frequently fail by intention in order to propagate a state or a implementation level to the application.
If you don't call cdrecord as root, you will not be able to lock in memory and to raise priority in order to prevent buffer underuns. In addition (with Linux-2.6.8.1 or newer) you will not be able to send some of the important SCSI commands mainly related to newer CD or DVD drives. As a result, cdrecord cannot write DVDs or ultra speed CD-RWs or cannot do other things....
Quoted 5 lines
Quoted 3 lines
If Linux plans to implement incompatible changes, I would expect that "important users" are informed in advance so that it is possible to discuss the problems an to have a planned smooth migration.
While, in the meantime, users can destroy the hardware.
Not true: if only R/W fd would be allowed, no non root program could do that.
Quoted 10 lines
<OT>
BTW while talking about destroying hardware: Turning off burnproof so the drives that have this feature
_forareason_will destroy my CD-Rs like a outdated CD-recorder would is doubleplusungood, even if it creates consistent behaviour across drives. It's like waring no seat belt in your car just because curricles didn't have them. ¢¢</OT>
See above, this false claim is a result of the fact that you miss the background knowledge on CD/DVD writing. Turning burnproof on degrades the quality of the media and writing without burnproof but with the apropriate privilleges just works fine.
Quoted 3 lines
There are other uses for write access to devices. Disabeling SCSI commands for r/o fds would only be a quickfix. (IMHO it could have been introduced as a config option and gone away in 2.6.13.)
The good/bad SCSI commands table that is currently used is a really bad and ugly (incorrect) hack and much worse than my proposal.
Quoted 6 lines
Quoted 2 lines
P.S.: About 10 days ago, I made an attempt to include a workaround for the interface changes in Linux, check cdrtools-2.01.01a03The fix is wrong: You're asuming root is capable of everything. This doesn't need to be true (missing
CAP_SYS_RAWIO) and you'll run into a loop in that case.
If you are really true, then there is a design problem in Linux.
BTW: If Linux starts introducing fine grained rights manamement like on Solaris, why does it miss the apropriate management tools at user level?
On Solaris, I could run cdrecord rootless if I use pfksh as my shell and if the roles database would include cdrecord with its needed privilleges and me as a member of the cdwriters role.
Jörg
Signature · 4 lines
EMail:[email protected] (home) Jörg Schilling D-13353 Berlin [email protected] (uni) [email protected] (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily
Quoted 8 lines · Joerg Schilling
Quoted 3 lines · "Bodo Eggert <[email protected]>" <[email protected]>…
I just burned a CD on my IDE-burner using
mmc_cdrwith cdrtools-2.01 (the one without the hack) on a vanilla 2.6.11.10. I can even scan both my SCSI and IDE devices using -dev=ATAPI, but not without -dev.The unability to give this kind of convenience to cdrecord users is a result of the refusal of the Linux kernel crew to include the kernel internal device instance numbers in the ioctl structures I need to read.
There is a specific reason that the numbers are _kernel_internal_!!! I set up my udev so that my green CD burner is /dev/green_burner, and my blue CD burner is /dev/blue_burner. Please tell me again why exactly I can't just give the option -dev=/dev/green_burner and have it use my green CD burner? That's a lot easier than messing with random groups of 3 numbers and trying to remember in which order I plugged in my burners, and which kernel I'm running, so I can remember the enumeration order, etc.
Quoted 2 lines
Note that the fields are there but the information is intentionally obscured for come of the calls just to make the life of cdrecord useers harder :-(
The information is obscured because userspace shouldn't know or care
Quoted 6 lines
Quoted 1 line
(I'm running as user, and cdrecord has no need for suid bits.)
I am frequently reading false claims like this. Usually from people who do not have the needed SCSI background knowledge to understand that SCSI is a protocol where commands frequently fail by intention in order to propagate a state or a implementation level to the application.
What exactly is false about the claim?
Quoted 2 lines
If you don't call cdrecord as root, you will not be able to lock in memory and to raise priority in order to prevent buffer underuns.
I burn CDs fine all the time as a user, and I _don't_ need to lock memory or raise priority, because I have a good scheduler, plenty of RAM, and dual CPUs. It would be nice if you could let me leave on the _hardware_ BurnProof technology designed to prevent that sort of thing, but it doesn't appear to fit with your ideals of 100% perfect CDs, does it? Besides, by the time we hit the point where BurnProof would turn on, the disk is either completely dead and useless (no burnproof), or slightly scarred and still useable (with burnproof). Personally, I'd rather have the latter.
Quoted 3 lines
In addition (with Linux-2.6.8.1 or newer) you will not be able to send some of the important SCSI commands mainly related to newer CD or DVD drives. As a result, cdrecord cannot write DVDs
I was not under the impression that the free cdrecord could write DVDs.
Quoted 1 line
or ultra speed CD-RWs or cannot do other things....
Did you try submitting a list of important SCSI commands and their functions? I suspect that if you provide a clear, concise list of harmless commands, they would be included in the available command set.
Quoted 1 line
Not true: if only R/W fd would be allowed, no non root program could do that.
Uhh, but I don't run cdrecord as root. My /dev/green_burner device is owned by root, has group "media", and perms rw-rw-r--. Since this is a somewhat public machine with lots of users in the "media" group, I don't want anybody to be able to turn my drives into bricks.
Quoted 4 lines
See above, this false claim is a result of the fact that you miss the background knowledge on CD/DVD writing. Turning burnproof on degrades the quality of the media and writing without burnproof but with the apropriate privilleges just works fine.
Why can't you just provide an option to leave it on? My Mac and Windows computers seem to do just fine with it. In fact, all modern CD-ROM drives were designed to be able to read such "degraded" media, even "degraded" media that also has scratches and dents and dings and scars and all sorts of other glitches in the CD surface.
Re: [OT] Joerg Schilling flames Linux on his Blog
Quoted 5 lines · Kyle Moffett
Did you try submitting a list of important SCSI commands and their functions?
I suspect that if you provide a clear, concise list of harmless commands,
they would be included in the available command set.
That list would be device-dependent. See two examples below.
1) cdrecord uses some Sony proprietary commands instead of standard MMC ones if the drive seems to be made by Sony. What is the effect of those Sony commands on non-Sony drives?
2) I have the following DVD-ROM + CD-RW combo drive:
'PHILIPS ' 'CDD5301 ' 'P1.2'
Originally, I bought it with the 'B1.1' firmware revision. This drive with old firmware is a security hole by itself: if one calls cdrecord dev=/dev/hdd -dao some-image.iso, the drive will enter some strange mode at the end. In particular, it will flash its light randomly, will never give the CD back (waited 15 minutes), and will prevent communication with /dev/hdc until I power off the computer (pressing Reset is not enough). Burning CDs with -raw switch instead of -dao works. With newer firmware, -dao doesn't lock up the drive, but still results in damaged CDs.
Also this drive always silently produces CDs with a lot of wrong bits (but a useless and broken image can still be read with dd or readcd) when BurnFree is off.
So this filter, if it is in the kernel, should forbid commands specific to SAO burning for this drive _and_ also return a modified list of capabilities for this drive (i.e. say that this drive _cannot_ burn in SAO mode).
Isn't this too much knowledge for the kernel?
Signature · 4 lines
Alexander E. Patrakov P.S. I know that the proper solution would be to replace the drive. I tried returning it to the shop, they said "no, it is in order because it works with Nero in Windows" and fined me for $25 for their "expertize".
Re: [OT] Joerg Schilling flames Linux on his Blog
Quoted 23 lines · Alexander E. Patrakov
That list would be device-dependent. See two examples below.
1) cdrecord uses some Sony proprietary commands instead of standard MMC ones if the drive seems to be made by Sony. What is the effect of those Sony commands on non-Sony drives?
2) I have the following DVD-ROM + CD-RW combo drive:
'PHILIPS ' 'CDD5301 ' 'P1.2'
Originally, I bought it with the 'B1.1' firmware revision. This drive with old firmware is a security hole by itself: if one calls cdrecord dev=/dev/hdd -dao some-image.iso, the drive will enter some strange mode at the end. In particular, it will flash its light randomly, will never give the CD back (waited 15 minutes), and will prevent communication with
/dev/hdcuntil I power off the computer (pressing Reset is not enough). Burning CDs with -raw switch instead of -dao works. With newer firmware, -dao doesn't lock up the drive, but still results in damaged CDs.Also this drive always silently produces CDs with a lot of wrong bits (but a useless and broken image can still be read with dd or readcd) when BurnFree is off.
Quoted 5 lines
So this filter, if it is in the kernel, should forbid commands specific to SAO burning for this drive _and_ also return a modified list of capabilities for this drive (i.e. say that this drive _cannot_ burn in SAO mode).
Isn't this too much knowledge for the kernel?
Isn't this exactly the knowledge the kernel, not the apps, should have? What if I wanted to use a different CD burning program? Why should we have duplicate knowledge about the hardware?
Do you picture every PCI-accessing userland program to have its own copy of pciids & relative knowledge?
Signature · 3 lines
Giuseppe "Oblomov" Bilotta "I weep for our generation" -- Charlie Brown
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [OT] Joerg Schilling flames Linux on his Blog
Quoted 5 lines · Bodo Eggert
So we can
1) give up and let any application with write access destroy the hardware
That won't be a problem if all apps with write access are running as root or setuid and thus the list of them is well-controlled by root.
Quoted 4 lines
2) implement a basic filter (common for all deviced) and a device-specific filter, which can be set by a userspace application.
In fact both approaches are used in the kernel.
(1) is used in the usbfs code, and thus SANE and gPhoto2 rely upon it (BTW it's still possible for a user to install an old version of SANE into /home/user and damage a scanner). Proper filtering in the kernel would be probably just too complex in this "usb generic" case.
(2) is used e.g. in DRM code.
What's missing is a clearly stated policy that says which of those two approaches should be applied in each particular case.
Signature · 1 line
Alexander E. Patrakov
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [OT] Joerg Schilling flames Linux on his Blog
Quoted 5 lines · Bodo Eggert
Quoted 4 lines · Alexander E. Patrakov
Quoted 2 lines · Bodo Eggert
So we can
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
1) give up and let any application with write access destroy the hardware
That won't be a problem if all apps with write access are running as root or setuid and thus the list of them is well-controlled by root.
And if all these apps are guaranteed to have no buffer-overflow or other exploits.
If you cleanly separate the ability to send SCSI commands from the ability to write to a UNIX block or raw devive, you only need to check the programs that explicitly need to send SCSI commands.
In former times, Linux did have this kind of clean separation between e.g. /dev/sd0 and /dev/sg0. Just go back to the clean old model...
This could easily be done: Remove SG_IO from the list of ioctl functions supported by drivers like /dev/sd0 and /dev/hda fix the bugs in ide_scsi.
Jörg
Signature · 4 lines
EMail:[email protected] (home) Jörg Schilling D-13353 Berlin [email protected] (uni) [email protected] (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily
Quoted 14 lines · Kyle Moffett
Quoted 10 lines · Joerg Schilling
Quoted 3 lines · "Bodo Eggert <[email protected]>" <[email protected]>…
I just burned a CD on my IDE-burner using
mmc_cdrwith cdrtools-2.01 (the one without the hack) on a vanilla 2.6.11.10. I can even scan both my SCSI and IDE devices using -dev=ATAPI, but not without -dev.The unability to give this kind of convenience to cdrecord users is a result of the refusal of the Linux kernel crew to include the kernel internal device instance numbers in the ioctl structures I need to read.
Quoted 4 lines
There is a specific reason that the numbers are _kernel_internal_!!! I set up
my udev so that my green CD burner is/dev/green_burner, and my blue CD burner is/dev/blue_burner. Please tell me again why exactly I can't just give the option -dev=/dev/green_burner and have it use my green CD burner?
You do realize that you can?
Quoted 10 lines
That's a lot
easier than messing with random groups of 3 numbers and trying to remember in which order I plugged in my burners, and which kernel I'm running, so I can remember the enumeration order, etc.Quoted 2 lines
Note that the fields are there but the information is intentionally obscured for come of the calls just to make the life of cdrecord useers harder :-(
The information is obscured because userspace shouldn't know or care
So having you see the information to set up your udev is a good use and having Joerg use them is bad? If you want to have names mapped into "humanspace" why is program use bad? I agree numbers are ugly and confusing, but if I wanted someone to make those choices for me I'd run another o/s.
The "support is accidental" message pisses me off, because it isn't true. Code was added, I'm betting by design.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
(I'm running as user, and cdrecord has no need for suid bits.)
Which is fine if you have a system to dedicate to burning CDs. But on a loaded system Joerg is right, you get a better burn if you don't have the burnfree used. Like any other minor defect it may or may not bite you, a lot of them will measurably reduce your CD capacity, which actually will bite you if you are trying to use every last byte.
Quoted 14 lines
Quoted 6 lines
I am frequently reading false claims like this. Usually from people who do not have the needed SCSI background knowledge to understand that SCSI is a protocol where commands frequently fail by intention in order to propagate a state or a implementation level to the application.
What exactly is false about the claim?
Quoted 2 lines
If you don't call cdrecord as root, you will not be able to lock in memory and to raise priority in order to prevent buffer underuns.
Quoted 8 lines
I burn CDs fine all the time as a user, and I _don't_ need to lock memory or raise priority, because I have a good scheduler, plenty of RAM, and dual CPUs. It would be nice if you could let me leave on the _hardware_ BurnProof technology designed to prevent that sort of thing, but it doesn't appear to fit with your ideals of 100% perfect CDs, does it? Besides, by the time we hit the point where BurnProof would turn on, the disk is either completely dead and useless (no burnproof), or slightly scarred and still useable (with burnproof). Personally, I'd rather have the latter.
See above. It hasn't bitten you, therefore it doesn't bite... it's generally safe on a fast unloaded system.
Quoted 6 lines
Quoted 4 lines
In addition (with Linux-2.6.8.1 or newer) you will not be able to send some of the important SCSI commands mainly related to newer CD or DVD drives. As a result, cdrecord cannot write DVDs
Quoted 8 lines
I was not under the impression that the free cdrecord could write DVDs.
Quoted 1 line
or ultra speed CD-RWs or cannot do other things....
Did you try submitting a list of important SCSI commands and their functions? I suspect that if you provide a clear, concise list of harmless commands, they would be included in the available command set.
Possibly true, didn't work for me.
Quoted 8 lines
Quoted 2 lines
Not true: if only R/W fd would be allowed, no non root program could do that.
Uhh, but I don't run cdrecord as root. My
/dev/green_burnerdevice is owned by root, has group "media", and perms rw-rw-r--. Since this is a somewhat public machine with lots of users in the "media" group, I don't want anybody to be able to turn my drives into bricks.
No argument with that.
Quoted 7 lines
Quoted 5 lines
See above, this false claim is a result of the fact that you miss the background knowledge on CD/DVD writing. Turning burnproof on degrades the quality of the media and writing without burnproof but with the apropriate privilleges just works fine.
Quoted 6 lines
Why can't you just provide an option to leave it on? My Mac and Windows computers seem to do just fine with it. In fact, all modern CD-ROM drives were designed to be able to read such "degraded" media, even "degraded" media that also has scratches and dents and dings and scars and all sorts of other glitches in the CD surface.
There is an option if you would read the manpage. There are legitimate complaints, this doesn't seem to be one of them.
Quoted 5 lines · Bill Davidsen
Quoted 4 lines
There is a specific reason that the numbers are _kernel_internal_!!! I set up
my udev so that my green CD burner is/dev/green_burner, and my blue CD burner is/dev/blue_burner. Please tell me again why exactly I can't just give the option -dev=/dev/green_burner and have it use my green CD burner?You do realize that you can?
Well, yes, and I do all the time, but the dammed deprecation warning is just plain stupid. That's not the deprecated method, that's the reasonable method.
Quoted 1 line
So having you see the information to set up your udev is a good use and having Joerg use them is bad? If you want to have names mapped into "humanspace" why is program use bad? I agree numbers are ugly and confusing, but if I wanted someone to make those choices for me I'd run another o/s.
I don't use the three-number made-up SCSI-over-USB IDs that Joerg was complaining about being unavailable. I have mine set up based on the UUID of the burner. I'm sorry for being unclear, but my objection is to his desire to expose the SCSI IDs to userspace as the primary naming scheme, when said SCSI IDs are frequently just made up by the kernel for USB devices, etc.
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
(I'm running as user, and cdrecord has no need for suid bits.)
Which is fine if you have a system to dedicate to burning CDs. But on a loaded system Joerg is right, you get a better burn if you don't have the burnfree used. Like any other minor defect it may or may not bite you, a lot of them will measurably reduce your CD capacity, which actually will bite you if you are trying to use every last byte.
Agreed. My personal gripe is that it screams at me even when I'm just doing a quickie burn of a 60MB debian netinst CD for a one-use-only thing.
Quoted 1 line
There is an option if you would read the manpage. There are legitimate complaints, this doesn't seem to be one of them.
Ah, crap. I just realized that some accidental disk corruption took a chunk out of the middle of my copy of the manpage. A reinstall of the package seems to have fixed the problem. Sorry about the noise.
Cheers,
Kyle Moffett
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCM/CS/IT/U d- s++: a18 C++++>$ UB/L/X/*++++(+)>$ P+++(++++)>$ L++++(+++) E W++(+) N+++(++) o? K? w--- O? M++ V? PS+() PE+(-) Y+ PGP+++ t+(+++) 5 X R? tv-(--) b++++(++) DI+ D+ G e->++++$ h!*()>++$ r !y?(-) ------END GEEK CODE BLOCK------
Quoted 6 lines · Kyle Moffett
I don't use the three-number made-up SCSI-over-USB IDs that Joerg was complaining about being unavailable. I have mine set up based on the UUID of the burner. I'm sorry for being unclear, but my objection is to his desire to expose the SCSI IDs to userspace as the primary naming scheme, when said SCSI IDs are frequently just made up by the kernel for USB devices, etc.
Given that I know the SCSI IDs of every single device I install, am not using SCAM, I don't object to using SCSI IDs, unfortunately, SCSI CD or DVD writers are rare and costly - I'd prefer them over ATAPI every day since I take one PCI device to connect like half a dozen narrow SCSI devices. ATAPI is so wasteful. And I have bought SCSI for as long as somewhat up-to-date devices were available.
Things get interesting though with ATAPI, ATAPICAM, ide-scsi, ide-cd and all sorts of interfaces since probing various busses is something that requires user intervention or trial & error to list _all_ devices in different buses, and drives have unlogical bus numbers (seen these on FreeBSD), or more generally, when cdrecord tries to coerce a device numbering scheme on devices that are not enumerated, or devices that are hotplug with device numbers changing with every plug-in action, or whatever.
Signature · 1 line
Matthias Andree
Quoted 8 lines · Kyle Moffett
Quoted 4 lines · Joerg Schilling
The unability to give this kind of convenience to cdrecord users is a result
of the refusal of the Linux kernel crew to include the kernel internal device instance numbers in the ioctl structures I need to read.There is a specific reason that the numbers are _kernel_internal_!!!
So if you really believe this, you should immediately remove all stuff under /proc.
Quoted 6 lines
I set up
my udev so that my green CD burner is/dev/green_burner, and my blue CD burner
is/dev/blue_burner. Please tell me again why exactly I can't just give the
option -dev=/dev/green_burner and have it use my green CD burner?
Try to start with reading the cdrecord manual page. Your question is answered in there.....but if you issue a command that is only halfway correct you will never be able to get the full set of features from cdrtools. Using UNIX device names for SCSI devices is highly nonportable and for this reason not supported by a portable program like cdrecord.
Cdrecord includes the needed features to do what you like, but do not asume that you will be able to force me to make nonportable and Linux specific interfaces a gauge for the design of a portable program. If you read the cdrecord man page, you know that you could happily call cdrecord dev=green_burner.....
Quoted 6 lines
That's a lot
easier than messing with random groups of 3 numbers and trying to remember in
which order I plugged in my burners, and which kernel I'm running, so I can
remember the enumeration order, etc.
Aha, so you would prefer /dev/ftp.kernel.org also?
Before trying to make inadequate comparisons and before you request inadequate similarities, it often helps a lot if you first try to look around and check whether your claims are really a tautology.
Quoted 7 lines
Quoted 5 lines
Note that the fields are there but the information is intentionally obscured
for come of the calls just to make the life of cdrecord useers harder :-(The information is obscured because userspace shouldn't know or care
If you read the LKML archives, it would be easy for you to prove that this is not true :-(
The numbers are obscured _only_ in order to prevent me to implement a workaround for the fact that Linux does not implement _one_ unique interface for sending generic SCSI commands to all devices that talk SCSI.
I aked for a non obscured interface in 2002 (note that the fields _are_ present inside the ioctl parameter structure) in order to hide this drawback from Linux users, but I have been told that the Linux developers don't like nice and _unique_ interfaces for their users.
- The fields are in the ioctl structures for user land
communication.
- The kernel knows the numbers that would allow libscg
to detect duplikate drive appearances when trying to implement a global umbrella for all different SCSI interfaces in the Linux kernel
- The kernel hides the fact only to make it impossible for
cdrecord to implement a better user interface.
Quoted 8 lines
Quoted 3 lines
If you don't call cdrecord as root, you will not be able to lock in memory
and to raise priority in order to prevent buffer underuns.I burn CDs fine all the time as a user, and I _don't_ need to lock memory or
raise priority, because I have a good scheduler, plenty of RAM, and dual CPUs.
Do you really believe this? It would help a lot if you did a reality check.
Quoted 4 lines
It would be nice if you could let me leave on the _hardware_ BurnProof technology designed to prevent that sort of thing, but it doesn't appear to
fit with your ideals of 100% perfect CDs, does it? Besides, by the
Again, try do do some reallity check.... Cdrecord by default uses the setup that grant best media quality. I asume you are able to read, so just read the man page and set up your defaults the way you like them.
Quoted 1 line
burnproof). Personally, I'd rather have the latter.
So why do you refuse to read the manual and to setup the parameters you like?
Quoted 5 lines
Did you try submitting a list of important SCSI commands and their functions?
I suspect that if you provide a clear, concise list of harmless commands,
they would be included in the available command set.
Having such a list in inherently wrong. It never could be made correct.
There are a lot of different drives with a lot of overlapping commands in the vendor unique part of the name space. Cdrecord needs the vendor unique commands for old writers in order to be able to write at all, and cdrecord needs the vendor unique commands in order to implement the nice features people like for their convenience.
Nut even in the non vendor unique part the list in Linux is incomplete.
****
And please note: Cdrecord uses some of the commands that are used for firmware upgrade in order to do DMA speed metering........ This is definitely _not_ a security issue with cdrecord.
In special on Linux, users frequelty did complain about insufficient DMA speed before I did add this feature. Not cdrecord refuses to write faster than possible after metering the transfer speed from/to the drive.
****
In case you don't understand this correectly, let me explain:
A security problem may only be correctly dealt with by having a coherent and consistent security strategy. The SCSI op code table is not part of a security strategy but just a bad hack.
Jörg
Signature · 4 lines
EMail:[email protected] (home) Jörg Schilling D-13353 Berlin [email protected] (uni) [email protected] (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily
Quoted 11 lines · Joerg Schilling
Try to start with reading the cdrecord manual page. Your question is answered in there.....but if you issue a command that is only halfway correct you will never be able to get the full set of features from cdrtools. Using UNIX device names for SCSI devices is highly nonportable and for this reason not supported by a portable program like cdrecord.
Cdrecord includes the needed features to do what you like, but do not asume that you will be able to force me to make nonportable and Linux specific interfaces a gauge for the design of a portable program. If you read the cdrecord man page, you know that you could happily call cdrecord dev=green_burner.....
Portable programs have specifics to each OS that it can be compiled on. Why do you think some portatble programs use automake? Not ever OS defines variables the same way or uses them the same way as others.
You are going to have to realize that accessing devices directly under different OSes will require different code. I've read all the stuff you've posted and it is apparent that you want all OSes to use the scsi scheme.
I don't use cdrecord much anymore since 1) I have a DVDRW and 2) I burn DVDs mostly. It happily uses /dev/<whatever> instead of compilaining that it's unintentional.
As far as I can see, you can use scsi ioctls on regular devices so why do you really need to use the 3 numbers? To find the right /dev/sg and use it? Doesn't make sense. I looked at the eject program one day. The IOCTL used to eject a cdrom is different than solaris. Gee, I guess eject is not portable. You should probably write a library that deals specifically with each OS. I don't ever see something like this being portable. Especially between a Unix environment and a Windows environment.
P.S. This is the first and will be the last time I post on this thread. I'm not trying to flame anyone, this is mostly an enduser observation. The native OS device usage should be used instead of something supposedly portable.
Signature · 1 line
Lab tests show that use of micro$oft causes cancer in lab animals
Quoted 14 lines · Joerg Schilling
Quoted 6 lines · Kyle Moffett
I set up
my udev so that my green CD burner is/dev/green_burner, and my blue CD burner
is/dev/blue_burner. Please tell me again why exactly I can't just give the
option -dev=/dev/green_burner and have it use my green CD burner?Try to start with reading the cdrecord manual page. Your question is answered in there.....but if you issue a command that is only halfway correct you will never be able to get the full set of features from cdrtools. Using UNIX device names for SCSI devices is highly nonportable and for this reason not supported by a portable program like cdrecord.
Quoted 6 lines
Cdrecord includes the needed features to do what you like, but do not asume that you will be able to force me to make nonportable and Linux specific interfaces a gauge for the design of a portable program. If you read the cdrecord man page, you know that you could happily call cdrecord dev=green_burner.....
No, that static mapping is not good. I have an external enclosure that does firewire and USB. I want to be able to use "sony-dvd" to access it no matter whether it is onnected to USB bus or Firewire and whether there are other devices (disks) on USB or firewire. It is possible to do with udev creating a link to /dev/sony-dvd.
Signature · 1 line
Dmitry
Quoted 7 lines · Dmitry Torokhov
Quoted 6 lines
Cdrecord includes the needed features to do what you like, but do not asume that you will be able to force me to make nonportable and Linux specific interfaces a gauge for the design of a portable program. If you read the cdrecord man page, you know that you could happily call cdrecord dev=green_burner.....
Quoted 5 lines
No, that static mapping is not good. I have an external enclosure that does firewire and USB. I want to be able to use "sony-dvd" to access it no matter whether it is onnected to USB bus or Firewire and whether there are other devices (disks) on USB or firewire. It is possible to do with udev creating a link to
/dev/sony-dvd.
I am not sure what you like to do.....
But what you claim is simply impossible.
As you started to introduce the allegory with the colors, let me make an assumption based on your claim:
- Buy two identical drives and varnish one in red and the other
in green.
- Connect both drives to your computer to let the OS "learn" the
drives.
- Do any setup you like
- Now disconnect the drives and after that, connect the green one
the way the red one has been connected before.
- Connect the red one too.
- Insert a medium into the green drive
- Let your software try whether it is able to connect you
to the green one.
If this always works as expected, then you are a magician!
So let me sum up: Never rely on things that cannot be made 100% unique in case you like to run security relevent software like cdrecord.
Jörg
Signature · 4 lines
EMail:[email protected] (home) Jörg Schilling D-13353 Berlin [email protected] (uni) [email protected] (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily
Quoted 9 lines · Joerg Schilling
Quoted 7 lines · Dmitry Torokhov
Quoted 6 lines
Cdrecord includes the needed features to do what you like, but do not asume that you will be able to force me to make nonportable and Linux specific interfaces a gauge for the design of a portable program. If you read the cdrecord man page, you know that you could happily call cdrecord dev=green_burner.....
Quoted 7 lines
Quoted 5 lines
No, that static mapping is not good. I have an external enclosure that does firewire and USB. I want to be able to use "sony-dvd" to access it no matter whether it is onnected to USB bus or Firewire and whether there are other devices (disks) on USB or firewire. It is possible to do with udev creating a link to
/dev/sony-dvd.I am not sure what you like to do.....
He wants to be able to access his dvd recorder via dev=/sony-dvd. And it should not matter how it is connected (USB/firewire).
Quoted 1 line
But what you claim is simply impossible.
No it is not.
Quoted 5 lines
As you started to introduce the allegory with the colors, let me make an assumption based on your claim:
(quoted diff) +0
-1- Buy two identical drives and varnish one in red and the otherin green.
That is indeed impossible, but as soon as there are two different drives, it is possible with udev and not possible with a static assignment.
regards
Markus
Quoted 40 lines · Joerg Schilling
Quoted 7 lines · Dmitry Torokhov
Quoted 6 lines
Cdrecord includes the needed features to do what you like, but do not asume that you will be able to force me to make nonportable and Linux specific interfaces a gauge for the design of a portable program. If you read the cdrecord man page, you know that you could happily call cdrecord dev=green_burner.....
Quoted 5 lines
No, that static mapping is not good. I have an external enclosure that does firewire and USB. I want to be able to use "sony-dvd" to access it no matter whether it is onnected to USB bus or Firewire and whether there are other devices (disks) on USB or firewire. It is possible to do with udev creating a link to
/dev/sony-dvd.I am not sure what you like to do.....
But what you claim is simply impossible.
As you started to introduce the allegory with the colors, let me make an assumption based on your claim:
(quoted diff) +0
-1- Buy two identical drives and varnish one in red and the otherin green.
(quoted diff) +0
-1- Connect both drives to your computer to let the OS "learn" thedrives.
(quoted diff) +0
-2- Do any setup you like - Now disconnect the drives and after that, connect the green onethe way the red one has been connected before.
(quoted diff) +0
-3- Connect the red one too. - Insert a medium into the green drive - Let your software try whether it is able to connect youto the green one.
Quoted 2 lines
If this always works as expected, then you are a magician!
It will not work if drives are absolutely identical, however if there is something even slightly different about them (serial number, model, firmware version - anything) you can set up udev to produce "stable" name.
FWIW, my example was about a single drive that can "change" it's X,Y,Z depending on how and when it was connected.
Quoted 2 lines
So let me sum up: Never rely on things that cannot be made 100% unique in case you like to run security relevent software like cdrecord.
Are you talking about <bus>,<target>,<lun> numbering by any chance ;) ? Because for the most types of devices out there they don't make any sense and just provided for compatibility with legacy software.
Also, from a bit different perspective - do you also want users to mount the CD they burnt using not device (/dev/xxx) but <bus>,<target>,<lun>? If not why writing application should use different addressing?
Signature · 1 line
Dmitry
Quoted 6 lines · Dmitry Torokhov
Quoted 2 lines
So let me sum up: Never rely on things that cannot be made 100% unique in case you like to run security relevent software like cdrecord.
Are you talking about <bus>,<target>,<lun> numbering by any chance ;) ? Because for the most types of devices out there they don't make any sense and just provided for compatibility with legacy software.
Like cdrecord.
Quoted 3 lines
Also, from a bit different perspective - do you also want users to mount the CD they burnt using not device (
/dev/xxx) but <bus>,<target>,<lun>? If not why writing application should use different addressing?
Let's start referring to files by device and inode number instead. It's so much easier than using pathnames. Maybe we can even force them into a bus,target,lun scheme. Then the device files and the corresponding scsi addresses will automatically collapse, and all problems will be solved.
Signature · 2 lines
Måns Rullgård [email protected]
This thead has become ultimately boring, Joerg's views are irreconcilably anti linux and pro Solaris,
there are, fortunately, alternatives to cdrrecord that work, especially for DVD,
let us just thank Joerg for his work and move on quietly!
Signature · 1 line
mit freundlichen Grüßen, Brian.
Quoted 2 lines · Brian O'Mahoney
This thead has become ultimately boring, Joerg's views are irreconcilably anti linux and pro Solaris,
If you are anti Linux, just try to stay quiet......
This is the first time that I experienced a non insulting discussion at LKML.....
Jörg
Signature · 4 lines
EMail:[email protected] (home) Jörg Schilling D-13353 Berlin [email protected] (uni) [email protected] (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily
Quoted 6 lines · Dmitry Torokhov
Quoted 2 lines
So let me sum up: Never rely on things that cannot be made 100% unique in case you like to run security relevent software like cdrecord.
Are you talking about <bus>,<target>,<lun> numbering by any chance ;) ? Because for the most types of devices out there they don't make any sense and just provided for compatibility with legacy software.
Well, this is the way most OS on the planet deal with SCSI.
And please explain me why the Linux kernel internally uses these numbers for driver instancing? Is the Linux kernel a piece of legacy software?
Quoted 3 lines
Also, from a bit different perspective - do you also want users to mount the CD they burnt using not device (
/dev/xxx) but <bus>,<target>,<lun>? If not why writing application should use different addressing?
Using SCSI addresses is just the way that works more universally for sending SCSI commands. There are several OS that don't support /dev/ names and all other UNIX like OS do not artificial hide the SCSI addresses from userland programs.
Jörg
Signature · 4 lines
EMail:[email protected] (home) Jörg Schilling D-13353 Berlin [email protected] (uni) [email protected] (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 8 lines · Bodo Eggert
[...]
Quoted 2 lines
If you don't call cdrecord as root, you will not be able to lock in memory and to raise priority in order to prevent buffer underuns.
My problem is the speed of the network or the fragmentation of my HD, RT privileges won't do the magic needed here[tm]. In fact, even a kernel compile while doesn't harm. On a reasonably busy system, I would probably have to reconsider.
If you have fragmentation problems, do you use the wrong filesystem type? I never had any similar problem on a ufs type filesystem.
With network speed, you should set up a sufficiently designed infrastructure. If you like to write a CD in 32x, you need 5.6 MB/s which easily goes over a 100 MB/s network connection.
Quoted 7 lines
Quoted 4 lines
In addition (with
Linux-2.6.8.1 or newer) you will not be able to send some of the important SCSI commands mainly related to newer CD or DVD drives. As a result, cdrecord cannot write DVDs or ultra speed CD-RWs or cannot do other things....If I need them, I'll notice and I can ask for them to be added.-) Your patch will just hide this need, but that's what your otherusers will need.
There are many other commands needed by cdrecord.
The initiator of the good/bad SCSI op code table hack claimed to have checked cdrecord for a list of used commands. If you check the current table, you may easily find that this cannot be true.
Quoted 2 lines
Maybe the failed command should be stored and printed after burning the CD, so new comands will get added quickly?
Please try to check the cdrecord source in order to understand the background.
Quoted 2 lines
You'll want to grant raw disk access for some databases, which will run as a unprivileged user. These databases should not be able to kill HDDs.
A database may kill a hdd in many other ways. It is higly improbable that a trustworthy database includes the knowwledge to set up a firmware to the drive that us accepted by the drive but does not work. The same applies for your kernel. You need to trust your database the same way as you need to trust your kernel.
Quoted 4 lines
Quoted 2 lines
The good/bad SCSI commands table that is currently used is a really bad and ugly (incorrect) hack and much worse than my proposal.
Your proposal has it's limitations, see above.
It has less limitations that the good/bad SCSI commands table has, see above.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
The fix is wrong: You're asuming root is capable of everything. This doesn't need to be true (missing
CAP_SYS_RAWIO) and you'll run into a loop in that case.If you are really true, then there is a design problem in Linux.
No, it's a feature, see man 3
cap_get_proc.
If Linux is designed in a way that needs applications like cdrecord to be changed in order to include support for a Linux proprietary new security mechanism, then the new mechanism should be rethought.
Quoted 4 lines
Quoted 2 lines
BTW: If Linux starts introducing fine grained rights manamement like on Solaris, why does it miss the apropriate management tools at user level?
Washing dishes is faster than drying them :)
If you go into a restaurant, they wash the dishes before they serve them to you, but they wait until they did dry before they get them out of the kitchen :-)
It is a matter of style of the kitchen personal whether to serve wet dishes or not.
So for the Linux equivalent: don't force users tu use interfaces that are not yet ready for the public.
Quoted 6 lines
Quoted 3 lines
On Solaris, I could run cdrecord rootless if I use pfksh as my shell and if the roles database would include cdrecord with its needed privilleges and me as a member of the cdwriters role.
There was some discusssion on LKML about non-root access to RT privileges. Maybe there is something in the queue.
So it makes sense for the Linux to have a look at the Solaris implementation. The database is much simpler to manage than what is present for Linux.
BTW: it would also make sense to implement the new holey file interface I designed together with the Solaris kernel crew for star.
Jörg
Signature · 4 lines
EMail:[email protected] (home) Jörg Schilling D-13353 Berlin [email protected] (uni) [email protected] (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 4 lines · Bodo Eggert
Quoted 1 line
If you have fragmentation problems, do you use the wrong filesystem type?
No, just small writes to random locations in large sparse files on filled disks.
Did you ever try to compare this behavior with UFS?
The last time I did notice fragmentation problems on UFS is more than 15 years a go when I had full news feed with B-news running on a Sun-3/50 and did a higly selective expire.
I am still sure that your problems are a problem of the filesystem implementation you use.
Quoted 5 lines
Quoted 3 lines
With network speed, you should set up a sufficiently designed infrastructure. If you like to write a CD in 32x, you need 5.6 MB/s which easily goes over a 100 MB/s network connection.
Mostly it does, but sometimes there are other users on my server.
This is why cdrecord puts itself into the highest priority real time class on every OS that supports this. If you voluntarily decline on this feature, please don't blame cdrecord.
Quoted 7 lines
Quoted 4 lines
There are many other commands needed by cdrecord.
The initiator of the good/bad SCSI op code table hack claimed to have checked cdrecord for a list of used commands. If you check the current table, you may easily find that this cannot be true.So we'll need a function to add more commands to the allowed list of each device.
No, the command list was an ungly hack from the beginning and it just is not suitable for what it is used.
If you like decent and reliable security, you need privillege separation.
- Disallow sending SCSI commands via ioctl() on /dev/hd*
- Tell people that they have to use /dev/sg* in order to send SCSI
commands to devices.
- Introduce a privillege check for /dev/hd* that is suitable for the
users of a block device interface.
- Introduce a privillege check for /dev/sg* that is suitable for the
users of a SCSI pass though interface.
The current problems in Linux are just a result of mixing unrelated interfaces together.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
You'll want to grant raw disk access for some databases, which will run as a unprivileged user. These databases should not be able to kill HDDs.
A database may kill a hdd in many other ways.
IMO, those should be plugged, too, and I'm sure they will.
See above: the clean solution is privilleges separation.
Quoted 6 lines
Quoted 3 lines
It is higly improbable that
a trustworthy database includes the knowwledge to set up a firmware to the drive that us accepted by the drive but does not work.A database may very well have exploits or provide system access to the database admin. Neither should result in raw SCSI access.
See above: If you have clean privilleges separation (and Linux did have it before the unsuited SG_IO ioctl was introduced on /dev/hd*) you don't even come close to similar problems.
Just give the database an interfase that allows the database to do what a database needs to do (reading and writing to a media) but not more.
Quoted 5 lines
Quoted 3 lines
The same applies for
your kernel. You need to trust your database the same way as you need to trust your kernel.NACK. Databases can't be trusted.
Wunderfull, so you are also a fan of privillege separation. Let us together vote for removing ioctl(sg_IO) from /dev/hd* and similar devices.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
No, it's a feature, see man 3
cap_get_proc.If Linux is designed in a way that needs applications like cdrecord to be changed in order to include support for a Linux proprietary new security mechanism, then the new mechanism should be rethought.
You don't need to implement that, but you shouldn't asume root to be more special than other users.
In contrary to many other programs, cdrecord is cleanly written and does not make such assumptions! It will have no problems as long as the environment is not contradictive.
Quoted 6 lines
BTW: IIRC, it was ported from solaris. There will probably the same issue.
Quoted 2 lines
So for the Linux equivalent: don't force users tu use interfaces that are not yet ready for the public.
You're not forced to use it, but you might be served non-dirty plates.
It seems that you did not understand this, so let me explain it in a different
way: If you start to implement a new security mechanism, either do it in a way that does not affect software that assumes historical UNIX interfaces at all, or keep it private for developers untill it is suitable for the mass.
Quoted 4 lines
Quoted 2 lines
So it makes sense for the Linux to have a look at the Solaris implementation. The database is much simpler to manage than what is present for Linux.
This is a userspace issue. The kernel doesn't enforce anything.
An OS is the kernel _and_ the user space support software. Even a "kernel only" subsystem like Linux cannot ignore these facts when trying to introduce interfaces that need special useland programs in order to mahe use out of it.
Quoted 4 lines
Quoted 2 lines
BTW: it would also make sense to implement the new holey file interface I designed together with the Solaris kernel crew for star.
Google gives no good pointers.
If it did, soneone would have ignored his NDA. The current interface is not yet 100% stable, it will be officially published when it is closer to something that could be used by anyone. If someone from LKML is really interested in implementing the interface soon, I would be willing to give away basic details that allow to implement 99% if the code. The error handling is still in dispute.
Jörg
Signature · 4 lines
EMail:[email protected] (home) Jörg Schilling D-13353 Berlin [email protected] (uni) [email protected] (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 5 lines · Bodo Eggert
Quoted 5 lines
No, the command list was an ungly hack from the beginning and it just is not suitable for what it is used.
If you like decent and reliable security, you need privillege separation.
Quoted 7 lines
Quoted 4 lines
(quoted diff) +0
-2- Disallow sending SCSI commands via ioctl() on /dev/hd* - Tell people that they have to use /dev/sg* in order to send SCSIcommands to devices.
- Each CD player would have to run suid. I'm talking about programs running a GUI, peeking in CDDB databases and doing other ugly stuff.
If you don't already have fine grained process permissions ready, you are right. In the other cases, pfksh or somethign similar would know about the special rights of a program from checking the databases in /etc/security/ and call /usr/bin/pfexec to set up only the needed rights and then call the program in question.
Note that in case you call the ability to send SCSI commands a security risk, then you need to implement all the consequences.....
Quoted 2 lines
- Each CD player will have permission to erase the firmware on all installed devices.
As you may not know which SCSI commands are used for a specific device, this is correct.
Quoted 3 lines
- You've seen how ugly scanning for the correct sg device is, and udev will make it site-dependant. You are no longer "guaranteed" to find any
/dev/sg*devices.
As it seems that this program called "udev" (if I am right) does some strange lookup and setup which is basically the same from editing /etc/default/cdrecord why is this program not implemented to give full support for Linux users and _does_ edit /etc/default/cdrecord?
I don't know that program but in contrary to the concepts of Solaris where a similar program (devlinks) that exists since 1992 creates links based only on information found in the names from /devices, and crerates links to /dev like this one:
lrwxrwxrwx 1 root other 45 Jul 14 2003 /dev/scg0 -> ../devices/pci@0,0/pci-ide@7,1/ide@1/scg@0,0: lrwxrwxrwx 1 root other 39 Jul 14 2003 /dev/scg1 -> ../devices/pci@0,0/pci1000,f@9/scg@0,0:
it seems that the program udev either has access to private kernel data structures (from the definition of the people who like to deny access to this information to cdrecord::libscg) or does other strange things.
On Solaris, handling of driver instances is done inside the kernel and used to set up device names.
You should rethink whether you still believe that udev is a clean program while cdrecord is not.....
Please note that /etc/default/cdrecord must likely predates udev by many years and polite authors of such a program would have added support for not only creating links to /dev but also for adding device aliased into /etc/default/cdrecord.
Quoted 5 lines
Quoted 2 lines
In contrary to many other programs, cdrecord is cleanly written and does not make such assumptions!
It does asume not to get permission denied errors after seteuid(0) was successfull.
Wrong: please check the source.....
It does not make _any_ asumption based on uid values except for the fact that it still tells you to become root in case something did not work.
So if there was a useful framework for the current attempt to implement fine grained process privilleges into Linux, cdrecord would be a candidate for testing....
Quoted 7 lines
Quoted 4 lines
It seems that you did not understand this, so let me explain it in a different
way: If you start to implement a new security mechanism, either do it in a way that does not affect software that assumes historical UNIX interfaces at all, or keep it private for developers untill it is suitable for the mass.It's not new. My manpage is from 1997, and the function was ported from solaris (IIRC).
What are you talking about?
Quoted 6 lines
Quoted 1 line
An OS is the kernel _and_ the user space support software.
The linux kernel is just the linux kernel. Unlike other systems, no special userland is enforced (with minimal exceptions like
/sbin/init). You can run supervise, busybox, sysvinit, use pam or classic login etc. If you like, you can get rid of /dev and put it somewhere else.
If you really make this assumtion, you would not be allowed to implement fine grained process privielleges into Linux because you could not support it at shell level. It just makes no sense to add special (currently) nonstandard features to a kernel without providing the supporting user land programs.
Quoted 8 lines
Quoted 3 lines
Even a "kernel only" subsystem like Linux cannot ignore these facts when trying to introduce interfaces that need special useland programs in order to mahe use out of it.
If you're developing a monolithic OS, you can hide the interface untill you've written the applications, but you can't do that for a standalone kernel. The interface is mostly(?) there, and as soon as somebody starts to care enough, it will be used.
You can do the same for something like Linux. You just need to implement the interface in a way that does not contradict or influence historical UNIX practice that made it into POSIX.
Quoted 10 lines
Quoted 6 lines
If it did, soneone would have ignored his NDA. The current interface is not yet 100% stable, it will be officially published when it is closer to something that could be used by anyone. If someone from LKML is really interested in implementing the interface soon, I would be willing to give away basic details that allow to implement 99% if the code. The error handling is still in dispute.
I'm too lazy to implement that, but I'd like an abstract. (I suspect it's something like
http://www.olafdietsche.de/linux/capability/)
Did you forget what question from you I was replying to?
I see no relation to a holey file interface here.
Jörg
Signature · 4 lines
EMail:[email protected] (home) Jörg Schilling D-13353 Berlin [email protected] (uni) [email protected] (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily