Re: [PATCH 7/9] Guard bvec iteration logic v3

2017-04-06 Thread Christoph Hellwig
> if (bio_no_advance_iter(bio)) > iter->bi_size -= bytes; > - else > - bvec_iter_advance(bio->bi_io_vec, iter, bytes); > + else { > + int err; > + err = bvec_iter_advance(bio->bi_io_vec, iter, bytes); > + if

Re: [PATCH 7/9] Guard bvec iteration logic v3

2017-04-06 Thread Christoph Hellwig
> if (bio_no_advance_iter(bio)) > iter->bi_size -= bytes; > - else > - bvec_iter_advance(bio->bi_io_vec, iter, bytes); > + else { > + int err; > + err = bvec_iter_advance(bio->bi_io_vec, iter, bytes); > + if

Re: [PATCH 7/9] Guard bvec iteration logic v3

2017-04-05 Thread Hannes Reinecke
On 04/04/2017 08:56 PM, Dmitry Monakhov wrote: > Currently if some one try to advance bvec beyond it's size we simply > dump WARN_ONCE and continue to iterate beyond bvec array boundaries. > This simply means that we endup dereferencing/corrupting random memory > region. > > Sane reaction would

Re: [PATCH 7/9] Guard bvec iteration logic v3

2017-04-05 Thread Hannes Reinecke
On 04/04/2017 08:56 PM, Dmitry Monakhov wrote: > Currently if some one try to advance bvec beyond it's size we simply > dump WARN_ONCE and continue to iterate beyond bvec array boundaries. > This simply means that we endup dereferencing/corrupting random memory > region. > > Sane reaction would

[PATCH 7/9] Guard bvec iteration logic v3

2017-04-04 Thread Dmitry Monakhov
Currently if some one try to advance bvec beyond it's size we simply dump WARN_ONCE and continue to iterate beyond bvec array boundaries. This simply means that we endup dereferencing/corrupting random memory region. Sane reaction would be to propagate error back to calling context But

[PATCH 7/9] Guard bvec iteration logic v3

2017-04-04 Thread Dmitry Monakhov
Currently if some one try to advance bvec beyond it's size we simply dump WARN_ONCE and continue to iterate beyond bvec array boundaries. This simply means that we endup dereferencing/corrupting random memory region. Sane reaction would be to propagate error back to calling context But