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]
Date:   Mon, 1 Feb 2021 16:20:33 -0500
From:   Willem de Bruijn <willemdebruijn.kernel@...il.com>
To:     Jakub Kicinski <kuba@...nel.org>
Cc:     Loic Poulain <loic.poulain@...aro.org>,
        David Miller <davem@...emloft.net>,
        Network Development <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next] net: mhi-net: Add de-aggeration support

On Mon, Feb 1, 2021 at 3:55 PM Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Mon, 1 Feb 2021 13:33:05 -0500 Willem de Bruijn wrote:
> > On Mon, Feb 1, 2021 at 11:41 AM Loic Poulain <loic.poulain@...aro.org> wrote:
> > > On Mon, 1 Feb 2021 at 15:24, Willem de Bruijn wrote:
> > > > What is this path to rmnet, if not the usual xmit path / validate_xmit_skb?
> > >
> > > I mean, not sure what to do exactly here, instead of using
> > > skb_copy_expand to re-aggregate data from the different skbs, Jakub
> > > suggests chaining the skbs instead (via 'frag_list' and 'next' pointer
> > > I assume), and to push this chained skb to net core via netif_rx. In
> > > that case, I assume the de-fragmentation/linearization will happen in
> > > the net core, right? If the transported protocol is rmnet, the packet
> > > is supposed to reach the rmnet_rx_handler at some point, but rmnet
> > > only works with standard/linear skbs.
> >
> > If it has that limitation, the rx_handler should have a check and linearize.
>
> Do you mean it's there or we should add it?

I mean that if rmnet cannot handle non-linear skbs, then
rmnet_rx_handler should linearize to be safe. It should not just rely
on __netif_receive_skb_core passing it only linear packets. That is
fragile.

I suppose the requirement is due to how rmnet_map_deaggregate splits
packets, with bare memcpy + skb_pull. I don't see a linearize call. If
only this path is affected, an skb_linearize could also be limited to
this branch. Or the code converted to handle skb frags and frag_list.

That said, addressing the fragile behavior is somewhat tangential to
the aim of this patch: passing such packets to
__netif_receive_skb_core. Your comment rightly asked about the logic
during allocation failure. If instead the whole packet is just
discarded at that point, I suppose the current approach works.

> > That is simpler than this skb_copy_expand, and as far as I can see no
> > more expensive.
>
> rx_handler is only used by uppers which are 100% SW. I think the right
> path is to fix the upper, rather than add a check to the fastpath, no?

Right. I think we're on the same page. I did not mean linearizing
before calling any rx_handler. Just specific inside this rx_handler
implementation.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ