lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200906240249.22531.bzolnier@gmail.com>
Date:	Wed, 24 Jun 2009 02:49:21 +0200
From:	Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
To:	David Miller <davem@...emloft.net>
Cc:	linux-ide@...r.kernel.org, linux-kernel@...r.kernel.org,
	petkovbb@...il.com, htejun@...il.com
Subject: Re: [patch 2/6] ide: fix ide_kill_rq() for special ide-{floppy,tape} driver requests

On Wednesday 24 June 2009 01:16:11 David Miller wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
> Date: Tue, 23 Jun 2009 23:26:06 +0200
> 
> > From: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
> > Subject: [PATCH] ide: fix ide_kill_rq() for special ide-{floppy,tape} driver requests
> > 
> > Such requests should be failed with -EIO (like all other requests
> > in this function) instead of being completed successfully.
> > 
> > Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
> > ---
> > Untested, you may try pinging Borislav and/or Tejun about possible
> > testing if you would like to verify the patch before applying.
> 
> This must be tested in some way.  I can see this potentially
> breaking something.
> 
> Especially this is true because ide_complete_rq() does it's
> "complete whole request right now" logic for error <= 0.

        /*
         * if failfast is set on a request, override number of sectors
         * and complete the whole request right now
         */
        if (blk_noretry_request(rq) && error <= 0)
                nr_bytes = blk_rq_sectors(rq) << 9;

It is a historical leftover from the days that we did partial request
completions.  Please notice that the patch doesn't affect this chunk.

> Borislov/Tejun, can either of you test this code path with this
> change applied?  I'd very much appreciate it.
> 
> Thanks!
> 
> >  drivers/ide/ide-io.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > Index: b/drivers/ide/ide-io.c
> > ===================================================================
> > --- a/drivers/ide/ide-io.c
> > +++ b/drivers/ide/ide-io.c
> > @@ -152,7 +152,7 @@ void ide_kill_rq(ide_drive_t *drive, str
> >  
> >  	if ((media == ide_floppy || media == ide_tape) && drv_req) {
> >  		rq->errors = 0;
> > -		ide_complete_rq(drive, 0, blk_rq_bytes(rq));
> > +		ide_complete_rq(drive, -EIO, blk_rq_bytes(rq));
> >  	} else {
> >  		if (media == ide_tape)
> >  			rq->errors = IDE_DRV_ERROR_GENERAL;
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ