Messages in this thread Patch in this message | | | Date | Sat, 22 Jul 2000 10:36:02 +0200 | From | Vojtech Pavlik <> | Subject | Re: IF only........ |
| |
On Fri, Jul 21, 2000 at 08:25:06PM -0500, Oliver Xymoron wrote: > On Fri, 21 Jul 2000, Andre Hedrick wrote: > > > With out the full touch it will not work. > > 20% are functionally that have to be there for 2.4 to stand a chance of > > being correct. > > Ok, separate out those parts and submit them on their own. I read your > patch and I figured that some percentage was clearly unrelated. > > > 80% is TASKFILE rewrite to give us the armor. > > That means still 50k and that's way too large a rewrite to be > considered a bugfix. I think something like the below can do it in less > than 10 lines for 2.4 and might even pass the "obviously correct" > criterion. Save the command parser business for 2.5.
Ok, what about just this simple little patch?
It gives the protection to systems that need it and can afford it, and for those systems it's even safer.
That's because even using the 'non-killer' commands to the drive you can hose the system rather easily (SETFEATURES, SETMULT, or just STANDBY/SLEEP/STANDBY/SLEEP which would almost definitely overheat the drive ...). This disables all raw commands to IDE drives if CAP_RAWIO isn't present.
-- Vojtech Pavlik SuSE Labs --- ide.c.old Sat Jul 22 10:19:37 2000 +++ ide.c Sat Jul 22 10:22:02 2000 @@ -2557,7 +2557,7 @@ byte args[4], *argbuf = args; byte xfer_rate = 0; int argsize = 4; - if (!capable(CAP_SYS_ADMIN)) return -EACCES; + if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RAWIO)) return -EACCES; if (NULL == (void *) arg) return ide_do_drive_cmd(drive, &rq, ide_wait); if (copy_from_user(args, (void *)arg, 4)) @@ -2595,7 +2595,7 @@ { byte args[7], *argbuf = args; int argsize = 7; - if (!capable(CAP_SYS_ADMIN)) return -EACCES; + if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RAWIO)) return -EACCES; if (copy_from_user(args, (void *)arg, 7)) return -EFAULT; err = ide_wait_cmd_task(drive, argbuf); | |