summaryrefslogtreecommitdiffstats
path: root/kernel/net/phonet
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/net/phonet')
-rw-r--r--kernel/net/phonet/af_phonet.c6
-rw-r--r--kernel/net/phonet/pep.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/kernel/net/phonet/af_phonet.c b/kernel/net/phonet/af_phonet.c
index 32ab87d34..f92575366 100644
--- a/kernel/net/phonet/af_phonet.c
+++ b/kernel/net/phonet/af_phonet.c
@@ -97,7 +97,7 @@ static int pn_socket_create(struct net *net, struct socket *sock, int protocol,
goto out;
}
- sk = sk_alloc(net, PF_PHONET, GFP_KERNEL, pnp->prot);
+ sk = sk_alloc(net, PF_PHONET, GFP_KERNEL, pnp->prot, kern);
if (sk == NULL) {
err = -ENOMEM;
goto out;
@@ -377,6 +377,10 @@ static int phonet_rcv(struct sk_buff *skb, struct net_device *dev,
struct sockaddr_pn sa;
u16 len;
+ skb = skb_share_check(skb, GFP_ATOMIC);
+ if (!skb)
+ return NET_RX_DROP;
+
/* check we have at least a full Phonet header */
if (!pskb_pull(skb, sizeof(struct phonethdr)))
goto out;
diff --git a/kernel/net/phonet/pep.c b/kernel/net/phonet/pep.c
index 6de2aeb98..850a86cde 100644
--- a/kernel/net/phonet/pep.c
+++ b/kernel/net/phonet/pep.c
@@ -845,7 +845,7 @@ static struct sock *pep_sock_accept(struct sock *sk, int flags, int *errp)
}
/* Create a new to-be-accepted sock */
- newsk = sk_alloc(sock_net(sk), PF_PHONET, GFP_KERNEL, sk->sk_prot);
+ newsk = sk_alloc(sock_net(sk), PF_PHONET, GFP_KERNEL, sk->sk_prot, 0);
if (!newsk) {
pep_reject_conn(sk, skb, PN_PIPE_ERR_OVERLOAD, GFP_KERNEL);
err = -ENOBUFS;