All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Hillf Danton <hdanton@sina.com>
Cc: dhowells@redhat.com, netdev@vger.kernel.org,
	linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 7/7] rxrpc: Use skb_unshare() rather than skb_cow_data()
Date: Sun, 01 Sep 2019 08:11:38 +0100	[thread overview]
Message-ID: <14327.1567321898@warthog.procyon.org.uk> (raw)
In-Reply-To: <20190901065603.432-1-hdanton@sina.com>

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

      parent reply	other threads:[~2019-09-01  7:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190901065603.432-1-hdanton@sina.com>
2019-08-29 13:07 ` [PATCH net 0/7] rxrpc: Fix use of skb_cow_data() David Howells
2019-08-29 13:07   ` [PATCH net 1/7] rxrpc: Improve jumbo packet counting David Howells
2019-08-29 13:07   ` [PATCH net 2/7] rxrpc: Use info in skbuff instead of reparsing a jumbo packet David Howells
2019-08-29 13:07   ` [PATCH net 3/7] rxrpc: Pass the input handler's data skb reference to the Rx ring David Howells
2019-08-29 13:08   ` [PATCH net 4/7] rxrpc: Abstract out rxtx ring cleanup David Howells
2019-08-29 13:08   ` [PATCH net 5/7] rxrpc: Add a private skb flag to indicate transmission-phase skbs David Howells
2019-08-29 13:08   ` [PATCH net 6/7] rxrpc: Use the tx-phase skb flag to simplify tracing David Howells
2019-08-29 13:08   ` [PATCH net 7/7] rxrpc: Use skb_unshare() rather than skb_cow_data() David Howells
2019-08-30 21:55   ` [PATCH net 0/7] rxrpc: Fix use of skb_cow_data() David Miller
2019-09-01  7:11   ` David Howells [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14327.1567321898@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=hdanton@sina.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.