[<prev] [next>] [day] [month] [year] [list]
Message-ID: <14327.1567321898@warthog.procyon.org.uk>
Date: Sun, 01 Sep 2019 08:11:38 +0100
From: David Howells <dhowells@...hat.com>
To: Hillf Danton <hdanton@...a.com>
Cc: dhowells@...hat.com, netdev@...r.kernel.org,
linux-afs@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net 7/7] rxrpc: Use skb_unshare() rather than skb_cow_data()
Hillf Danton <hdanton@...a.com> wrote:
> > + /* Unshare the packet so that it can be modified for in-place
> > + * decryption.
> > + */
> > + if (sp->hdr.securityIndex != 0) {
> > + struct sk_buff *nskb = skb_unshare(skb, GFP_ATOMIC);
> > + if (!nskb) {
> > + rxrpc_eaten_skb(skb, rxrpc_skb_unshared_nomem);
> > + goto out;
> > + }
> > +
> > + if (nskb != skb) {
> > + rxrpc_eaten_skb(skb, rxrpc_skb_received);
> > + rxrpc_new_skb(skb, rxrpc_skb_unshared);
> > + skb = nskb;
> > + sp = rxrpc_skb(skb);
> > + }
> > + }
>
> Unsharing skb makes it perilous to take a peep at it afterwards.
Ah, good point. rxrpc_new_skb() should be after the assignment.
David
Powered by blists - more mailing lists