]> git.baikalelectronics.ru Git - kernel.git/commitdiff
Revert "kcm: remove any offset before parsing messages"
authorDavid S. Miller <davem@davemloft.net>
Tue, 18 Sep 2018 01:43:42 +0000 (18:43 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Sep 2018 01:43:42 +0000 (18:43 -0700)
This reverts commit e6f2a9845c4353f958f1fc8a73776649363bf4d7.

I just read that this causes regressions.

Signed-off-by: David S. Miller <davem@davemloft.net>
net/kcm/kcmsock.c

index 36c438b95955f167d9912bcf178fbc7d58d2f22e..571d824e4e2499e1f591701ed0e25c4aff73b00a 100644 (file)
@@ -381,32 +381,8 @@ static int kcm_parse_func_strparser(struct strparser *strp, struct sk_buff *skb)
 {
        struct kcm_psock *psock = container_of(strp, struct kcm_psock, strp);
        struct bpf_prog *prog = psock->bpf_prog;
-       struct sk_buff *clone_skb = NULL;
-       struct strp_msg *stm;
-       int rc;
-
-       stm = strp_msg(skb);
-       if (stm->offset) {
-               skb = clone_skb = skb_clone(skb, GFP_ATOMIC);
-               if (!clone_skb)
-                       return -ENOMEM;
-
-               if (!pskb_pull(clone_skb, stm->offset)) {
-                       rc = -ENOMEM;
-                       goto out;
-               }
-
-               /* reset cloned skb's offset for bpf programs using it */
-               stm = strp_msg(clone_skb);
-               stm->offset = 0;
-       }
-
-       rc = (*prog->bpf_func)(skb, prog->insnsi);
-out:
-       if (clone_skb)
-               kfree_skb(clone_skb);
 
-       return rc;
+       return (*prog->bpf_func)(skb, prog->insnsi);
 }
 
 static int kcm_read_sock_done(struct strparser *strp, int err)