lkml.org 
[lkml]   [2019]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH net 7/7] rxrpc: Use skb_unshare() rather than skb_cow_data()
Date
Hillf Danton <hdanton@sina.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

\
 
 \ /
  Last update: 2019-09-01 09:12    [W:0.074 / U:6.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site