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] [day] [month] [year] [list]
Message-ID: <20130813191841.GA55109@Ed-Cashins-MacBook-Pro.local>
Date:	Tue, 13 Aug 2013 15:18:43 -0400
From:	Ed L Cashin <ecashin@...aid.com>
To:	Kent Overstreet <kmo@...erainc.com>
CC:	"axboe@...nel.dk" <axboe@...nel.dk>,
	"neilb@...e.de" <neilb@...e.de>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
	"dm-devel@...hat.com" <dm-devel@...hat.com>,
	"linux-raid@...r.kernel.org" <linux-raid@...r.kernel.org>
Subject: Re: [PATCH 04/22] block: Abstract out bvec iterator

On Tue, Aug 13, 2013 at 11:51:58AM -0700, Kent Overstreet wrote:
> On Tue, Aug 13, 2013 at 10:03:04AM -0400, Ed Cashin wrote:
> > On Aug 9, 2013, Ed Cashin wrote:
> > > On Aug 8, 2013, at 9:05 PM, Kent Overstreet wrote:
> > > ...
> > > > It's in the for-jens branch now.
> > > 
> > > 
> > > Just examining the patches, I like the way it cleans up the aoe code.  I
> > > had a question about a new BUG added by the for-jens branch the
> > > read-response handling path of the aoe driver.
> > 
> > The aoe driver in linux-bcache/for-jens commit 4c36c973a8f45 is
> > passing my tests.
> > 
> > Here is a patch against that branch illustrating my suggestion for
> > handling bad target responses gracefully.
> 
> Thanks - shall I just fold that into the aoe immutable bvec patch?

Yes, that would be good, thanks.

Unfortunately, the way I usually send patches to vger didn't work
this time.  It looks like the MTA didn't retry after the
greylisting used SMTP temporary failures.  So I'm trying a
different way to send and including the same patch for the
benefit of the Cc list.

commit 2c39f50b1ee02e2ac07fd072a883a91713da53cc
Author: Ed Cashin <ecashin@...aid.com>
Date:   Tue Aug 13 10:50:28 2013 -0400

    aoe: bad AoE responses fail I/O without BUG
    
    Instead of having a BUG when the AoE target does something wrong,
    just fail the I/O and log the problem with rate limiting.

diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index cacd48e..b9916a6 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -1096,7 +1096,6 @@ bvcpy(struct sk_buff *skb, struct bio *bio, struct bvec_iter iter, long cnt)
 	int soff = 0;
 	struct bio_vec bv;
 
-	BUG_ON(cnt > iter.bi_size);
 	iter.bi_size = cnt;
 
 	__bio_for_each_segment(bv, bio, iter, iter) {
@@ -1196,6 +1195,14 @@ noskb:		if (buf)
 			clear_bit(BIO_UPTODATE, &buf->bio->bi_flags);
 			break;
 		}
+		if (n > f->iter.bi_size) {
+			pr_err_ratelimited("%s e%ld.%d.  bytes=%ld need=%u\n",
+				"aoe: too-large data size in read from",
+				(long) d->aoemajor, d->aoeminor,
+				n, f->iter.bi_size);
+			clear_bit(BIO_UPTODATE, &buf->bio->bi_flags);
+			break;
+		}
 		bvcpy(skb, f->buf->bio, f->iter, n);
 	case ATA_CMD_PIO_WRITE:
 	case ATA_CMD_PIO_WRITE_EXT:

-- 
  Ed
--
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