Messages in this thread Patch in this message | | | Date | Fri, 21 Jul 2000 18:11:47 -0700 (PDT) | From | Andre Hedrick <> | Subject | Re: IF only........ |
| |
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. 80% is TASKFILE rewrite to give us the armor.
You want just the armor fine, but the other will come next.
On Fri, 21 Jul 2000, Oliver Xymoron wrote:
> On Fri, 21 Jul 2000, Andre Hedrick wrote: > > > I wrote the patch but it is not wanted "ide.2.4.0-t5-2.all.4c.patch.bz2" > > I proved the tool to try and break it. > > Andre, what's the smallest patch to the current code which will kill raw > writes? I suspect a couple lines in drivers/ide/ide.c of the form
ide.2.4.0-t5-2.kludge.patch
This expose the hole with no real method to protect.
> case HDIO_DRIVE_CMD: > . > . > . > int i, raw_cmds[]={WIN_WRITE, WIN_WRITEDMA, ...,0}; > for(i=0; raw_cmds[i]; i++) > if(cmd==raw_cmds[i] && !capable(CAP_SYS_RAW)) > return -EACCESS; > > I agree with Alan that we should limit those commands to people with > CAP_SYS_RAW. The above is arguably the correct thing to do under the > capabilities model anyway and is simple enough that it's not likely to > impact anything. Chances of getting accepted are much higher than your 64k > patch which touches many files and rewrites many functions.
Cheers,
Andre Hedrick The Linux ATA/IDE guy diff -urN linux-2.4.0-t5-2-pristine/drivers/ide/ide.c linux-2.4.0-t5-2-kludge/drivers/ide/ide.c --- linux-2.4.0-t5-2-pristine/drivers/ide/ide.c Sun Jul 9 10:04:35 2000 +++ linux-2.4.0-t5-2-kludge/drivers/ide/ide.c Wed Jul 19 17:14:18 2000 @@ -2566,6 +2566,37 @@ return ide_do_drive_cmd(drive, &rq, ide_wait); if (copy_from_user(args, (void *)arg, 4)) return -EFAULT; + + /* + * Kludge to prevent taskfile commands executing + * in a read or write. Rewriting the taskfile commands + * is the only safe solution. This patch exposes a + * data security risk. + */ + switch (args[0]) { + case WIN_SETFEATURES: + case WIN_IDENTIFY: + case WIN_PIDENTIFY: + case WIN_SMART: + case WIN_SEEK: + case WIN_SPECIFY: + case WIN_STANDBYNOW1: + case WIN_STANDBYNOW2: + case WIN_SLEEPNOW1: + case WIN_SLEEPNOW2: + case WIN_SETIDLE1: + case DISABLE_SEAGATE: + case WIN_CHECKPOWERMODE1: + case WIN_CHECKPOWERMODE2: + case WIN_SETMULT: + case EXABYTE_ENABLE_NEST: + case WIN_DOORLOCK: + case WIN_DOORUNLOCK: + break; + default: + return -EFAULT; + } + if (args[3]) { argsize = 4 + (SECTOR_WORDS * 4 * args[3]); argbuf = kmalloc(argsize, GFP_KERNEL);
| |