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: <CAMZdPi8CPrWvLCnxoaA_f1cUcu=amvSjFb5BVFrG4X1DSCrthg@mail.gmail.com>
Date:   Wed, 3 Feb 2021 15:56:50 +0100
From:   Loic Poulain <loic.poulain@...aro.org>
To:     Willem de Bruijn <willemdebruijn.kernel@...il.com>
Cc:     Jakub Kicinski <kuba@...nel.org>,
        David Miller <davem@...emloft.net>,
        Network Development <netdev@...r.kernel.org>,
        Sean Tranchetti <stranche@...eaurora.org>,
        Subash Abhinov Kasiviswanathan <subashab@...eaurora.org>
Subject: Re: [PATCH net-next v3 2/2] net: qualcomm: rmnet: Fix rx_handler for
 non-linear skbs

On Wed, 3 Feb 2021 at 15:04, Willem de Bruijn
<willemdebruijn.kernel@...il.com> wrote:
>
> On Wed, Feb 3, 2021 at 8:17 AM Loic Poulain <loic.poulain@...aro.org> wrote:
> >
> > There is no guarantee that rmnet rx_handler is only fed with linear
> > skbs, but current rmnet implementation does not check that, leading
> > to crash in case of non linear skbs processed as linear ones.
> >
> > Fix that by ensuring skb linearization before processing.
> >
> > Signed-off-by: Loic Poulain <loic.poulain@...aro.org>
> > Acked-by: Willem de Bruijn <willemb@...gle.com>
> > Reviewed-by: Subash Abhinov Kasiviswanathan <subashab@...eaurora.org>
> > ---
> >  v2: Add this patch to the series to prevent crash
> >  v3: no change
> >
> >  drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
> > index 3d7d3ab..2776c32 100644
> > --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
> > +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
> > @@ -180,7 +180,7 @@ rx_handler_result_t rmnet_rx_handler(struct sk_buff **pskb)
> >         struct rmnet_port *port;
> >         struct net_device *dev;
> >
> > -       if (!skb)
> > +       if (!skb || skb_linearize(skb))
> >                 goto done;
>
> Actually, if skb_linearize fails, the skb must be freed.

Ouch, you're right.

Regards,
Loic

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ