aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ppp
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-03-19 13:05:34 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-03-19 13:05:34 -0400
commit1200b6809dfd9d73bc4c7db76d288c35fa4b2ebe (patch)
tree552e03de245cdbd0780ca1215914edc4a26540f7 /drivers/net/ppp
parent6b5f04b6cf8ebab9a65d9c0026c650bb2538fd0f (diff)
parentfe30937b65354c7fec244caebbdaae68e28ca797 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller: "Highlights: 1) Support more Realtek wireless chips, from Jes Sorenson. 2) New BPF types for per-cpu hash and arrap maps, from Alexei Starovoitov. 3) Make several TCP sysctls per-namespace, from Nikolay Borisov. 4) Allow the use of SO_REUSEPORT in order to do per-thread processing of incoming TCP/UDP connections. The muxing can be done using a BPF program which hashes the incoming packet. From Craig Gallek. 5) Add a multiplexer for TCP streams, to provide a messaged based interface. BPF programs can be used to determine the message boundaries. From Tom Herbert. 6) Add 802.1AE MACSEC support, from Sabrina Dubroca. 7) Avoid factorial complexity when taking down an inetdev interface with lots of configured addresses. We were doing things like traversing the entire address less for each address removed, and flushing the entire netfilter conntrack table for every address as well. 8) Add and use SKB bulk free infrastructure, from Jesper Brouer. 9) Allow offloading u32 classifiers to hardware, and implement for ixgbe, from John Fastabend. 10) Allow configuring IRQ coalescing parameters on a per-queue basis, from Kan Liang. 11) Extend ethtool so that larger link mode masks can be supported. From David Decotigny. 12) Introduce devlink, which can be used to configure port link types (ethernet vs Infiniband, etc.), port splitting, and switch device level attributes as a whole. From Jiri Pirko. 13) Hardware offload support for flower classifiers, from Amir Vadai. 14) Add "Local Checksum Offload". Basically, for a tunneled packet the checksum of the outer header is 'constant' (because with the checksum field filled into the inner protocol header, the payload of the outer frame checksums to 'zero'), and we can take advantage of that in various ways. From Edward Cree" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1548 commits) bonding: fix bond_get_stats() net: bcmgenet: fix dma api length mismatch net/mlx4_core: Fix backward compatibility on VFs phy: mdio-thunder: Fix some Kconfig typos lan78xx: add ndo_get_stats64 lan78xx: handle statistics counter rollover RDS: TCP: Remove unused constant RDS: TCP: Add sysctl tunables for sndbuf/rcvbuf on rds-tcp socket net: smc911x: convert pxa dma to dmaengine team: remove duplicate set of flag IFF_MULTICAST bonding: remove duplicate set of flag IFF_MULTICAST net: fix a comment typo ethernet: micrel: fix some error codes ip_tunnels, bpf: define IP_TUNNEL_OPTS_MAX and use it bpf, dst: add and use dst_tclassid helper bpf: make skb->tc_classid also readable net: mvneta: bm: clarify dependencies cls_bpf: reset class and reuse major in da ldmvsw: Checkpatch sunvnet.c and sunvnet_common.c ldmvsw: Add ldmvsw.c driver code ...
Diffstat (limited to 'drivers/net/ppp')
-rw-r--r--drivers/net/ppp/ppp_generic.c43
1 files changed, 24 insertions, 19 deletions
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
index d61da9ece3ba..4fd861063ed4 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -575,7 +575,7 @@ static int get_filter(void __user *arg, struct sock_filter **p)
575 575
576static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 576static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
577{ 577{
578 struct ppp_file *pf = file->private_data; 578 struct ppp_file *pf;
579 struct ppp *ppp; 579 struct ppp *ppp;
580 int err = -EFAULT, val, val2, i; 580 int err = -EFAULT, val, val2, i;
581 struct ppp_idle idle; 581 struct ppp_idle idle;
@@ -585,9 +585,14 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
585 void __user *argp = (void __user *)arg; 585 void __user *argp = (void __user *)arg;
586 int __user *p = argp; 586 int __user *p = argp;
587 587
588 if (!pf) 588 mutex_lock(&ppp_mutex);
589 return ppp_unattached_ioctl(current->nsproxy->net_ns, 589
590 pf, file, cmd, arg); 590 pf = file->private_data;
591 if (!pf) {
592 err = ppp_unattached_ioctl(current->nsproxy->net_ns,
593 pf, file, cmd, arg);
594 goto out;
595 }
591 596
592 if (cmd == PPPIOCDETACH) { 597 if (cmd == PPPIOCDETACH) {
593 /* 598 /*
@@ -602,7 +607,6 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
602 * this fd and reopening /dev/ppp. 607 * this fd and reopening /dev/ppp.
603 */ 608 */
604 err = -EINVAL; 609 err = -EINVAL;
605 mutex_lock(&ppp_mutex);
606 if (pf->kind == INTERFACE) { 610 if (pf->kind == INTERFACE) {
607 ppp = PF_TO_PPP(pf); 611 ppp = PF_TO_PPP(pf);
608 rtnl_lock(); 612 rtnl_lock();
@@ -616,15 +620,13 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
616 } else 620 } else
617 pr_warn("PPPIOCDETACH file->f_count=%ld\n", 621 pr_warn("PPPIOCDETACH file->f_count=%ld\n",
618 atomic_long_read(&file->f_count)); 622 atomic_long_read(&file->f_count));
619 mutex_unlock(&ppp_mutex); 623 goto out;
620 return err;
621 } 624 }
622 625
623 if (pf->kind == CHANNEL) { 626 if (pf->kind == CHANNEL) {
624 struct channel *pch; 627 struct channel *pch;
625 struct ppp_channel *chan; 628 struct ppp_channel *chan;
626 629
627 mutex_lock(&ppp_mutex);
628 pch = PF_TO_CHANNEL(pf); 630 pch = PF_TO_CHANNEL(pf);
629 631
630 switch (cmd) { 632 switch (cmd) {
@@ -646,17 +648,16 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
646 err = chan->ops->ioctl(chan, cmd, arg); 648 err = chan->ops->ioctl(chan, cmd, arg);
647 up_read(&pch->chan_sem); 649 up_read(&pch->chan_sem);
648 } 650 }
649 mutex_unlock(&ppp_mutex); 651 goto out;
650 return err;
651 } 652 }
652 653
653 if (pf->kind != INTERFACE) { 654 if (pf->kind != INTERFACE) {
654 /* can't happen */ 655 /* can't happen */
655 pr_err("PPP: not interface or channel??\n"); 656 pr_err("PPP: not interface or channel??\n");
656 return -EINVAL; 657 err = -EINVAL;
658 goto out;
657 } 659 }
658 660
659 mutex_lock(&ppp_mutex);
660 ppp = PF_TO_PPP(pf); 661 ppp = PF_TO_PPP(pf);
661 switch (cmd) { 662 switch (cmd) {
662 case PPPIOCSMRU: 663 case PPPIOCSMRU:
@@ -831,7 +832,10 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
831 default: 832 default:
832 err = -ENOTTY; 833 err = -ENOTTY;
833 } 834 }
835
836out:
834 mutex_unlock(&ppp_mutex); 837 mutex_unlock(&ppp_mutex);
838
835 return err; 839 return err;
836} 840}
837 841
@@ -844,7 +848,6 @@ static int ppp_unattached_ioctl(struct net *net, struct ppp_file *pf,
844 struct ppp_net *pn; 848 struct ppp_net *pn;
845 int __user *p = (int __user *)arg; 849 int __user *p = (int __user *)arg;
846 850
847 mutex_lock(&ppp_mutex);
848 switch (cmd) { 851 switch (cmd) {
849 case PPPIOCNEWUNIT: 852 case PPPIOCNEWUNIT:
850 /* Create a new ppp unit */ 853 /* Create a new ppp unit */
@@ -894,7 +897,7 @@ static int ppp_unattached_ioctl(struct net *net, struct ppp_file *pf,
894 default: 897 default:
895 err = -ENOTTY; 898 err = -ENOTTY;
896 } 899 }
897 mutex_unlock(&ppp_mutex); 900
898 return err; 901 return err;
899} 902}
900 903
@@ -2437,13 +2440,15 @@ ppp_set_compress(struct ppp *ppp, unsigned long arg)
2437 unsigned char ccp_option[CCP_MAX_OPTION_LENGTH]; 2440 unsigned char ccp_option[CCP_MAX_OPTION_LENGTH];
2438 2441
2439 err = -EFAULT; 2442 err = -EFAULT;
2440 if (copy_from_user(&data, (void __user *) arg, sizeof(data)) || 2443 if (copy_from_user(&data, (void __user *) arg, sizeof(data)))
2441 (data.length <= CCP_MAX_OPTION_LENGTH && 2444 goto out;
2442 copy_from_user(ccp_option, (void __user *) data.ptr, data.length))) 2445 if (data.length > CCP_MAX_OPTION_LENGTH)
2443 goto out; 2446 goto out;
2447 if (copy_from_user(ccp_option, (void __user *) data.ptr, data.length))
2448 goto out;
2449
2444 err = -EINVAL; 2450 err = -EINVAL;
2445 if (data.length > CCP_MAX_OPTION_LENGTH || 2451 if (data.length < 2 || ccp_option[1] < 2 || ccp_option[1] > data.length)
2446 ccp_option[1] < 2 || ccp_option[1] > data.length)
2447 goto out; 2452 goto out;
2448 2453
2449 cp = try_then_request_module( 2454 cp = try_then_request_module(