Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1632881

Re: [PATCH v6 3/5] rxrpc: check return value of skb_to_sgvec always

From "Jason A. Donenfeld" <Jason@zx2c4.com>
Newsgroups linux.kernel
Subject Re: [PATCH v6 3/5] rxrpc: check return value of skb_to_sgvec always
Date 2017-04-28 15:40 +0200
Message-ID <tBehQ-7VW-17@gated-at.bofh.it> (permalink)
References <tAb2F-6Ff-25@gated-at.bofh.it> <tAdHb-8nI-5@gated-at.bofh.it> <tAdHc-8nI-23@gated-at.bofh.it> <tBczn-6JZ-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Sabrina,

Thanks for the review.

On Fri, Apr 28, 2017 at 1:41 PM, Sabrina Dubroca <sd@queasysnail.net> wrote:
> >       sg_init_table(sg, nsg);
> > -     skb_to_sgvec(skb, sg, offset, len);
> > +     if (unlikely(skb_to_sgvec(skb, sg, offset, len) < 0))
> > +             goto nomem;
>
> You're leaking sg when nsg > 4, you'll need to add this:
>
>         if (sg != _sg)
>                 kfree(sg);

Nice catch. I'll fix this up in the next revision.


>
>
>
> BTW, when you resubmit, please Cc: the maintainers of the files you're
> changing for each patch, so that they can review this stuff. And send
> patch 1 to all of them, otherwise they might be surprised that we even
> need <0 checking after calls to skb_to_sgvec.
>
> You might also want to add a cover letter.

Both good ideas. Will do.

Jason

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/5] skbuff: return -EMSGSIZE in skb_to_sgvec to prevent overflow "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-04-25 16:10 +0200
  [PATCH v2 1/5] skbuff: return -EMSGSIZE in skb_to_sgvec to prevent overflow "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-04-25 16:20 +0200
    [PATCH v3 1/5] skbuff: return -EMSGSIZE in skb_to_sgvec to prevent overflow "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-04-25 16:30 +0200
  [PATCH 2/5] ipsec: check return value of skb_to_sgvec always "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-04-25 16:20 +0200
  [PATCH 4/5] macsec: check return value of skb_to_sgvec always "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-04-25 16:20 +0200
  Re: [PATCH 1/5] skbuff: return -EMSGSIZE in skb_to_sgvec to  prevent overflow David Miller <davem@davemloft.net> - 2017-04-25 16:50 +0200
    [PATCH v4 1/5] skbuff: return -EMSGSIZE in skb_to_sgvec to prevent overflow "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-04-25 17:10 +0200
      Re: [PATCH v4 1/5] skbuff: return -EMSGSIZE in skb_to_sgvec to  prevent overflow David Miller <davem@davemloft.net> - 2017-04-25 17:20 +0200
        [PATCH v5 1/5] skbuff: return -EMSGSIZE in skb_to_sgvec to prevent overflow "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-04-25 18:00 +0200
          [PATCH v5 3/5] rxrpc: check return value of skb_to_sgvec always "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-04-25 18:00 +0200
          [PATCH v5 4/5] macsec: check return value of skb_to_sgvec always "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-04-25 18:00 +0200
          [PATCH v5 2/5] ipsec: check return value of skb_to_sgvec always "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-04-25 18:00 +0200
          [PATCH v5 5/5] virtio_net: check return value of skb_to_sgvec always "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-04-25 18:00 +0200
          [PATCH v6 2/5] ipsec: check return value of skb_to_sgvec always "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-04-25 20:50 +0200
          [PATCH v6 4/5] macsec: check return value of skb_to_sgvec always "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-04-25 20:50 +0200
          [PATCH v6 5/5] virtio_net: check return value of skb_to_sgvec always "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-04-25 20:50 +0200
          [PATCH v6 1/5] skbuff: return -EMSGSIZE in skb_to_sgvec to prevent overflow "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-04-25 20:50 +0200
            [PATCH v6 3/5] rxrpc: check return value of skb_to_sgvec always "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-04-25 20:50 +0200
              Re: [PATCH v6 3/5] rxrpc: check return value of skb_to_sgvec always Sabrina Dubroca <sd@queasysnail.net> - 2017-04-28 13:50 +0200
                Re: [PATCH v6 3/5] rxrpc: check return value of skb_to_sgvec always "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-04-28 15:40 +0200
            Re: [PATCH v6 1/5] skbuff: return -EMSGSIZE in skb_to_sgvec to  prevent overflow "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-04-27 11:30 +0200
              Re: [PATCH v6 1/5] skbuff: return -EMSGSIZE in skb_to_sgvec to  prevent overflow Sabrina Dubroca <sd@queasysnail.net> - 2017-04-27 13:40 +0200
                Re: [PATCH v6 1/5] skbuff: return -EMSGSIZE in skb_to_sgvec to  prevent overflow "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-04-27 14:10 +0200
                RE: [PATCH v6 1/5] skbuff: return -EMSGSIZE in skb_to_sgvec to  prevent overflow David Laight <David.Laight@ACULAB.COM> - 2017-04-27 17:00 +0200
              Re: [PATCH v6 1/5] skbuff: return -EMSGSIZE in skb_to_sgvec to  prevent overflow David Miller <davem@davemloft.net> - 2017-04-27 18:00 +0200
            Re: [PATCH v6 1/5] skbuff: return -EMSGSIZE in skb_to_sgvec to  prevent overflow Sabrina Dubroca <sd@queasysnail.net> - 2017-04-28 18:20 +0200
              Re: [PATCH v6 1/5] skbuff: return -EMSGSIZE in skb_to_sgvec to  prevent overflow "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-04-29 00:50 +0200
  Re: [PATCH 1/5] skbuff: return -EMSGSIZE in skb_to_sgvec to prevent  overflow Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2017-04-25 17:50 +0200

csiph-web