diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/9p/Kconfig | 10 | ||||
-rw-r--r-- | net/compat.c | 54 | ||||
-rw-r--r-- | net/core/pktgen.c | 9 | ||||
-rw-r--r-- | net/core/rtnetlink.c | 4 | ||||
-rw-r--r-- | net/core/scm.c | 2 | ||||
-rw-r--r-- | net/ipv4/af_inet.c | 1 | ||||
-rw-r--r-- | net/ipv4/ip_input.c | 10 | ||||
-rw-r--r-- | net/ipv4/ipmr.c | 9 | ||||
-rw-r--r-- | net/ipv4/tcp_htcp.c | 14 | ||||
-rw-r--r-- | net/ipv4/udp.c | 1 | ||||
-rw-r--r-- | net/ipv6/datagram.c | 5 | ||||
-rw-r--r-- | net/ipv6/ip6mr.c | 4 | ||||
-rw-r--r-- | net/ipv6/ipv6_sockglue.c | 5 | ||||
-rw-r--r-- | net/ipv6/proc.c | 6 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 22 | ||||
-rw-r--r-- | net/phonet/af_phonet.c | 56 | ||||
-rw-r--r-- | net/sched/sch_api.c | 2 | ||||
-rw-r--r-- | net/sched/sch_generic.c | 7 | ||||
-rw-r--r-- | net/socket.c | 80 | ||||
-rw-r--r-- | net/sunrpc/auth_generic.c | 20 |
20 files changed, 121 insertions, 200 deletions
diff --git a/net/9p/Kconfig b/net/9p/Kconfig index c42c0c400bf9..0663f99e977a 100644 --- a/net/9p/Kconfig +++ b/net/9p/Kconfig | |||
@@ -13,22 +13,24 @@ menuconfig NET_9P | |||
13 | 13 | ||
14 | If unsure, say N. | 14 | If unsure, say N. |
15 | 15 | ||
16 | if NET_9P | ||
17 | |||
16 | config NET_9P_VIRTIO | 18 | config NET_9P_VIRTIO |
17 | depends on NET_9P && EXPERIMENTAL && VIRTIO | 19 | depends on EXPERIMENTAL && VIRTIO |
18 | tristate "9P Virtio Transport (Experimental)" | 20 | tristate "9P Virtio Transport (Experimental)" |
19 | help | 21 | help |
20 | This builds support for a transports between | 22 | This builds support for a transports between |
21 | guest partitions and a host partition. | 23 | guest partitions and a host partition. |
22 | 24 | ||
23 | config NET_9P_RDMA | 25 | config NET_9P_RDMA |
24 | depends on NET_9P && INFINIBAND && EXPERIMENTAL | 26 | depends on INET && INFINIBAND && EXPERIMENTAL |
25 | tristate "9P RDMA Transport (Experimental)" | 27 | tristate "9P RDMA Transport (Experimental)" |
26 | help | 28 | help |
27 | This builds support for a RDMA transport. | 29 | This builds support for an RDMA transport. |
28 | 30 | ||
29 | config NET_9P_DEBUG | 31 | config NET_9P_DEBUG |
30 | bool "Debug information" | 32 | bool "Debug information" |
31 | depends on NET_9P | ||
32 | help | 33 | help |
33 | Say Y if you want the 9P subsystem to log debug information. | 34 | Say Y if you want the 9P subsystem to log debug information. |
34 | 35 | ||
36 | endif | ||
diff --git a/net/compat.c b/net/compat.c index 67fb6a3834a3..a3a2ba0fac08 100644 --- a/net/compat.c +++ b/net/compat.c | |||
@@ -226,14 +226,14 @@ int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *dat | |||
226 | return 0; /* XXX: return error? check spec. */ | 226 | return 0; /* XXX: return error? check spec. */ |
227 | } | 227 | } |
228 | 228 | ||
229 | if (level == SOL_SOCKET && type == SO_TIMESTAMP) { | 229 | if (level == SOL_SOCKET && type == SCM_TIMESTAMP) { |
230 | struct timeval *tv = (struct timeval *)data; | 230 | struct timeval *tv = (struct timeval *)data; |
231 | ctv.tv_sec = tv->tv_sec; | 231 | ctv.tv_sec = tv->tv_sec; |
232 | ctv.tv_usec = tv->tv_usec; | 232 | ctv.tv_usec = tv->tv_usec; |
233 | data = &ctv; | 233 | data = &ctv; |
234 | len = sizeof(ctv); | 234 | len = sizeof(ctv); |
235 | } | 235 | } |
236 | if (level == SOL_SOCKET && type == SO_TIMESTAMPNS) { | 236 | if (level == SOL_SOCKET && type == SCM_TIMESTAMPNS) { |
237 | struct timespec *ts = (struct timespec *)data; | 237 | struct timespec *ts = (struct timespec *)data; |
238 | cts.tv_sec = ts->tv_sec; | 238 | cts.tv_sec = ts->tv_sec; |
239 | cts.tv_nsec = ts->tv_nsec; | 239 | cts.tv_nsec = ts->tv_nsec; |
@@ -725,7 +725,7 @@ EXPORT_SYMBOL(compat_mc_getsockopt); | |||
725 | static unsigned char nas[19]={AL(0),AL(3),AL(3),AL(3),AL(2),AL(3), | 725 | static unsigned char nas[19]={AL(0),AL(3),AL(3),AL(3),AL(2),AL(3), |
726 | AL(3),AL(3),AL(4),AL(4),AL(4),AL(6), | 726 | AL(3),AL(3),AL(4),AL(4),AL(4),AL(6), |
727 | AL(6),AL(2),AL(5),AL(5),AL(3),AL(3), | 727 | AL(6),AL(2),AL(5),AL(5),AL(3),AL(3), |
728 | AL(6)}; | 728 | AL(4)}; |
729 | #undef AL | 729 | #undef AL |
730 | 730 | ||
731 | asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg, unsigned flags) | 731 | asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg, unsigned flags) |
@@ -738,52 +738,13 @@ asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg, uns | |||
738 | return sys_recvmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT); | 738 | return sys_recvmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT); |
739 | } | 739 | } |
740 | 740 | ||
741 | asmlinkage long compat_sys_paccept(int fd, struct sockaddr __user *upeer_sockaddr, | ||
742 | int __user *upeer_addrlen, | ||
743 | const compat_sigset_t __user *sigmask, | ||
744 | compat_size_t sigsetsize, int flags) | ||
745 | { | ||
746 | compat_sigset_t ss32; | ||
747 | sigset_t ksigmask, sigsaved; | ||
748 | int ret; | ||
749 | |||
750 | if (sigmask) { | ||
751 | if (sigsetsize != sizeof(compat_sigset_t)) | ||
752 | return -EINVAL; | ||
753 | if (copy_from_user(&ss32, sigmask, sizeof(ss32))) | ||
754 | return -EFAULT; | ||
755 | sigset_from_compat(&ksigmask, &ss32); | ||
756 | |||
757 | sigdelsetmask(&ksigmask, sigmask(SIGKILL)|sigmask(SIGSTOP)); | ||
758 | sigprocmask(SIG_SETMASK, &ksigmask, &sigsaved); | ||
759 | } | ||
760 | |||
761 | ret = do_accept(fd, upeer_sockaddr, upeer_addrlen, flags); | ||
762 | |||
763 | if (ret == -ERESTARTNOHAND) { | ||
764 | /* | ||
765 | * Don't restore the signal mask yet. Let do_signal() deliver | ||
766 | * the signal on the way back to userspace, before the signal | ||
767 | * mask is restored. | ||
768 | */ | ||
769 | if (sigmask) { | ||
770 | memcpy(¤t->saved_sigmask, &sigsaved, | ||
771 | sizeof(sigsaved)); | ||
772 | set_restore_sigmask(); | ||
773 | } | ||
774 | } else if (sigmask) | ||
775 | sigprocmask(SIG_SETMASK, &sigsaved, NULL); | ||
776 | |||
777 | return ret; | ||
778 | } | ||
779 | |||
780 | asmlinkage long compat_sys_socketcall(int call, u32 __user *args) | 741 | asmlinkage long compat_sys_socketcall(int call, u32 __user *args) |
781 | { | 742 | { |
782 | int ret; | 743 | int ret; |
783 | u32 a[6]; | 744 | u32 a[6]; |
784 | u32 a0, a1; | 745 | u32 a0, a1; |
785 | 746 | ||
786 | if (call < SYS_SOCKET || call > SYS_PACCEPT) | 747 | if (call < SYS_SOCKET || call > SYS_ACCEPT4) |
787 | return -EINVAL; | 748 | return -EINVAL; |
788 | if (copy_from_user(a, args, nas[call])) | 749 | if (copy_from_user(a, args, nas[call])) |
789 | return -EFAULT; | 750 | return -EFAULT; |
@@ -804,7 +765,7 @@ asmlinkage long compat_sys_socketcall(int call, u32 __user *args) | |||
804 | ret = sys_listen(a0, a1); | 765 | ret = sys_listen(a0, a1); |
805 | break; | 766 | break; |
806 | case SYS_ACCEPT: | 767 | case SYS_ACCEPT: |
807 | ret = do_accept(a0, compat_ptr(a1), compat_ptr(a[2]), 0); | 768 | ret = sys_accept4(a0, compat_ptr(a1), compat_ptr(a[2]), 0); |
808 | break; | 769 | break; |
809 | case SYS_GETSOCKNAME: | 770 | case SYS_GETSOCKNAME: |
810 | ret = sys_getsockname(a0, compat_ptr(a1), compat_ptr(a[2])); | 771 | ret = sys_getsockname(a0, compat_ptr(a1), compat_ptr(a[2])); |
@@ -844,9 +805,8 @@ asmlinkage long compat_sys_socketcall(int call, u32 __user *args) | |||
844 | case SYS_RECVMSG: | 805 | case SYS_RECVMSG: |
845 | ret = compat_sys_recvmsg(a0, compat_ptr(a1), a[2]); | 806 | ret = compat_sys_recvmsg(a0, compat_ptr(a1), a[2]); |
846 | break; | 807 | break; |
847 | case SYS_PACCEPT: | 808 | case SYS_ACCEPT4: |
848 | ret = compat_sys_paccept(a0, compat_ptr(a1), compat_ptr(a[2]), | 809 | ret = sys_accept4(a0, compat_ptr(a1), compat_ptr(a[2]), a[3]); |
849 | compat_ptr(a[3]), a[4], a[5]); | ||
850 | break; | 810 | break; |
851 | default: | 811 | default: |
852 | ret = -EINVAL; | 812 | ret = -EINVAL; |
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index a47f5bad110d..8997e912aaaf 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -1973,13 +1973,7 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev) | |||
1973 | 1973 | ||
1974 | /* make sure that we don't pick a non-existing transmit queue */ | 1974 | /* make sure that we don't pick a non-existing transmit queue */ |
1975 | ntxq = pkt_dev->odev->real_num_tx_queues; | 1975 | ntxq = pkt_dev->odev->real_num_tx_queues; |
1976 | if (ntxq > num_online_cpus() && (pkt_dev->flags & F_QUEUE_MAP_CPU)) { | 1976 | |
1977 | printk(KERN_WARNING "pktgen: WARNING: QUEUE_MAP_CPU " | ||
1978 | "disabled because CPU count (%d) exceeds number " | ||
1979 | "of tx queues (%d) on %s\n", num_online_cpus(), ntxq, | ||
1980 | pkt_dev->odev->name); | ||
1981 | pkt_dev->flags &= ~F_QUEUE_MAP_CPU; | ||
1982 | } | ||
1983 | if (ntxq <= pkt_dev->queue_map_min) { | 1977 | if (ntxq <= pkt_dev->queue_map_min) { |
1984 | printk(KERN_WARNING "pktgen: WARNING: Requested " | 1978 | printk(KERN_WARNING "pktgen: WARNING: Requested " |
1985 | "queue_map_min (zero-based) (%d) exceeds valid range " | 1979 | "queue_map_min (zero-based) (%d) exceeds valid range " |
@@ -2202,6 +2196,7 @@ static void set_cur_queue_map(struct pktgen_dev *pkt_dev) | |||
2202 | } | 2196 | } |
2203 | pkt_dev->cur_queue_map = t; | 2197 | pkt_dev->cur_queue_map = t; |
2204 | } | 2198 | } |
2199 | pkt_dev->cur_queue_map = pkt_dev->cur_queue_map % pkt_dev->odev->real_num_tx_queues; | ||
2205 | } | 2200 | } |
2206 | 2201 | ||
2207 | /* Increment/randomize headers according to flags and current values | 2202 | /* Increment/randomize headers according to flags and current values |
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 31f29d2989fd..4dfb6b4d4559 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -878,7 +878,9 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm, | |||
878 | if (ifm->ifi_change) | 878 | if (ifm->ifi_change) |
879 | flags = (flags & ifm->ifi_change) | | 879 | flags = (flags & ifm->ifi_change) | |
880 | (dev->flags & ~ifm->ifi_change); | 880 | (dev->flags & ~ifm->ifi_change); |
881 | dev_change_flags(dev, flags); | 881 | err = dev_change_flags(dev, flags); |
882 | if (err < 0) | ||
883 | goto errout; | ||
882 | } | 884 | } |
883 | 885 | ||
884 | if (tb[IFLA_TXQLEN]) | 886 | if (tb[IFLA_TXQLEN]) |
diff --git a/net/core/scm.c b/net/core/scm.c index ab242cc1acca..b12303dd39d9 100644 --- a/net/core/scm.c +++ b/net/core/scm.c | |||
@@ -75,7 +75,6 @@ static int scm_fp_copy(struct cmsghdr *cmsg, struct scm_fp_list **fplp) | |||
75 | if (!fpl) | 75 | if (!fpl) |
76 | return -ENOMEM; | 76 | return -ENOMEM; |
77 | *fplp = fpl; | 77 | *fplp = fpl; |
78 | INIT_LIST_HEAD(&fpl->list); | ||
79 | fpl->count = 0; | 78 | fpl->count = 0; |
80 | } | 79 | } |
81 | fpp = &fpl->fp[fpl->count]; | 80 | fpp = &fpl->fp[fpl->count]; |
@@ -301,7 +300,6 @@ struct scm_fp_list *scm_fp_dup(struct scm_fp_list *fpl) | |||
301 | 300 | ||
302 | new_fpl = kmalloc(sizeof(*fpl), GFP_KERNEL); | 301 | new_fpl = kmalloc(sizeof(*fpl), GFP_KERNEL); |
303 | if (new_fpl) { | 302 | if (new_fpl) { |
304 | INIT_LIST_HEAD(&new_fpl->list); | ||
305 | for (i=fpl->count-1; i>=0; i--) | 303 | for (i=fpl->count-1; i>=0; i--) |
306 | get_file(fpl->fp[i]); | 304 | get_file(fpl->fp[i]); |
307 | memcpy(new_fpl, fpl, sizeof(*fpl)); | 305 | memcpy(new_fpl, fpl, sizeof(*fpl)); |
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 1fbff5fa4241..1aa2dc9e380e 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -1117,6 +1117,7 @@ int inet_sk_rebuild_header(struct sock *sk) | |||
1117 | }, | 1117 | }, |
1118 | }, | 1118 | }, |
1119 | .proto = sk->sk_protocol, | 1119 | .proto = sk->sk_protocol, |
1120 | .flags = inet_sk_flowi_flags(sk), | ||
1120 | .uli_u = { | 1121 | .uli_u = { |
1121 | .ports = { | 1122 | .ports = { |
1122 | .sport = inet->sport, | 1123 | .sport = inet->sport, |
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index 861978a4f1a8..cfb38ac9d698 100644 --- a/net/ipv4/ip_input.c +++ b/net/ipv4/ip_input.c | |||
@@ -209,9 +209,17 @@ static int ip_local_deliver_finish(struct sk_buff *skb) | |||
209 | 209 | ||
210 | hash = protocol & (MAX_INET_PROTOS - 1); | 210 | hash = protocol & (MAX_INET_PROTOS - 1); |
211 | ipprot = rcu_dereference(inet_protos[hash]); | 211 | ipprot = rcu_dereference(inet_protos[hash]); |
212 | if (ipprot != NULL && (net == &init_net || ipprot->netns_ok)) { | 212 | if (ipprot != NULL) { |
213 | int ret; | 213 | int ret; |
214 | 214 | ||
215 | if (!net_eq(net, &init_net) && !ipprot->netns_ok) { | ||
216 | if (net_ratelimit()) | ||
217 | printk("%s: proto %d isn't netns-ready\n", | ||
218 | __func__, protocol); | ||
219 | kfree_skb(skb); | ||
220 | goto out; | ||
221 | } | ||
222 | |||
215 | if (!ipprot->no_policy) { | 223 | if (!ipprot->no_policy) { |
216 | if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) { | 224 | if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) { |
217 | kfree_skb(skb); | 225 | kfree_skb(skb); |
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index b42e082cc170..25924b1eb2ef 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -1945,13 +1945,14 @@ int __init ip_mr_init(void) | |||
1945 | goto proc_cache_fail; | 1945 | goto proc_cache_fail; |
1946 | #endif | 1946 | #endif |
1947 | return 0; | 1947 | return 0; |
1948 | reg_notif_fail: | ||
1949 | kmem_cache_destroy(mrt_cachep); | ||
1950 | #ifdef CONFIG_PROC_FS | 1948 | #ifdef CONFIG_PROC_FS |
1951 | proc_vif_fail: | ||
1952 | unregister_netdevice_notifier(&ip_mr_notifier); | ||
1953 | proc_cache_fail: | 1949 | proc_cache_fail: |
1954 | proc_net_remove(&init_net, "ip_mr_vif"); | 1950 | proc_net_remove(&init_net, "ip_mr_vif"); |
1951 | proc_vif_fail: | ||
1952 | unregister_netdevice_notifier(&ip_mr_notifier); | ||
1955 | #endif | 1953 | #endif |
1954 | reg_notif_fail: | ||
1955 | del_timer(&ipmr_expire_timer); | ||
1956 | kmem_cache_destroy(mrt_cachep); | ||
1956 | return err; | 1957 | return err; |
1957 | } | 1958 | } |
diff --git a/net/ipv4/tcp_htcp.c b/net/ipv4/tcp_htcp.c index af99776146ff..937549b8a921 100644 --- a/net/ipv4/tcp_htcp.c +++ b/net/ipv4/tcp_htcp.c | |||
@@ -69,9 +69,12 @@ static u32 htcp_cwnd_undo(struct sock *sk) | |||
69 | const struct tcp_sock *tp = tcp_sk(sk); | 69 | const struct tcp_sock *tp = tcp_sk(sk); |
70 | struct htcp *ca = inet_csk_ca(sk); | 70 | struct htcp *ca = inet_csk_ca(sk); |
71 | 71 | ||
72 | ca->last_cong = ca->undo_last_cong; | 72 | if (ca->undo_last_cong) { |
73 | ca->maxRTT = ca->undo_maxRTT; | 73 | ca->last_cong = ca->undo_last_cong; |
74 | ca->old_maxB = ca->undo_old_maxB; | 74 | ca->maxRTT = ca->undo_maxRTT; |
75 | ca->old_maxB = ca->undo_old_maxB; | ||
76 | ca->undo_last_cong = 0; | ||
77 | } | ||
75 | 78 | ||
76 | return max(tp->snd_cwnd, (tp->snd_ssthresh << 7) / ca->beta); | 79 | return max(tp->snd_cwnd, (tp->snd_ssthresh << 7) / ca->beta); |
77 | } | 80 | } |
@@ -268,7 +271,10 @@ static void htcp_state(struct sock *sk, u8 new_state) | |||
268 | case TCP_CA_Open: | 271 | case TCP_CA_Open: |
269 | { | 272 | { |
270 | struct htcp *ca = inet_csk_ca(sk); | 273 | struct htcp *ca = inet_csk_ca(sk); |
271 | ca->last_cong = jiffies; | 274 | if (ca->undo_last_cong) { |
275 | ca->last_cong = jiffies; | ||
276 | ca->undo_last_cong = 0; | ||
277 | } | ||
272 | } | 278 | } |
273 | break; | 279 | break; |
274 | case TCP_CA_CWR: | 280 | case TCP_CA_CWR: |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index cf02701ced48..98c1fd09be88 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -633,6 +633,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
633 | .saddr = saddr, | 633 | .saddr = saddr, |
634 | .tos = tos } }, | 634 | .tos = tos } }, |
635 | .proto = sk->sk_protocol, | 635 | .proto = sk->sk_protocol, |
636 | .flags = inet_sk_flowi_flags(sk), | ||
636 | .uli_u = { .ports = | 637 | .uli_u = { .ports = |
637 | { .sport = inet->sport, | 638 | { .sport = inet->sport, |
638 | .dport = dport } } }; | 639 | .dport = dport } } }; |
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c index 410046a8cc91..e44deb8d4df2 100644 --- a/net/ipv6/datagram.c +++ b/net/ipv6/datagram.c | |||
@@ -661,6 +661,11 @@ int datagram_send_ctl(struct net *net, | |||
661 | switch (rthdr->type) { | 661 | switch (rthdr->type) { |
662 | #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) | 662 | #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) |
663 | case IPV6_SRCRT_TYPE_2: | 663 | case IPV6_SRCRT_TYPE_2: |
664 | if (rthdr->hdrlen != 2 || | ||
665 | rthdr->segments_left != 1) { | ||
666 | err = -EINVAL; | ||
667 | goto exit_f; | ||
668 | } | ||
664 | break; | 669 | break; |
665 | #endif | 670 | #endif |
666 | default: | 671 | default: |
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 52a7eb0e2c2c..0524769632e7 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c | |||
@@ -224,7 +224,7 @@ static struct file_operations ip6mr_vif_fops = { | |||
224 | .open = ip6mr_vif_open, | 224 | .open = ip6mr_vif_open, |
225 | .read = seq_read, | 225 | .read = seq_read, |
226 | .llseek = seq_lseek, | 226 | .llseek = seq_lseek, |
227 | .release = seq_release, | 227 | .release = seq_release_private, |
228 | }; | 228 | }; |
229 | 229 | ||
230 | static void *ipmr_mfc_seq_start(struct seq_file *seq, loff_t *pos) | 230 | static void *ipmr_mfc_seq_start(struct seq_file *seq, loff_t *pos) |
@@ -338,7 +338,7 @@ static struct file_operations ip6mr_mfc_fops = { | |||
338 | .open = ipmr_mfc_open, | 338 | .open = ipmr_mfc_open, |
339 | .read = seq_read, | 339 | .read = seq_read, |
340 | .llseek = seq_lseek, | 340 | .llseek = seq_lseek, |
341 | .release = seq_release, | 341 | .release = seq_release_private, |
342 | }; | 342 | }; |
343 | #endif | 343 | #endif |
344 | 344 | ||
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 4e5eac301f91..2aa294be0c79 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c | |||
@@ -366,11 +366,16 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname, | |||
366 | } | 366 | } |
367 | 367 | ||
368 | /* routing header option needs extra check */ | 368 | /* routing header option needs extra check */ |
369 | retv = -EINVAL; | ||
369 | if (optname == IPV6_RTHDR && opt && opt->srcrt) { | 370 | if (optname == IPV6_RTHDR && opt && opt->srcrt) { |
370 | struct ipv6_rt_hdr *rthdr = opt->srcrt; | 371 | struct ipv6_rt_hdr *rthdr = opt->srcrt; |
371 | switch (rthdr->type) { | 372 | switch (rthdr->type) { |
372 | #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) | 373 | #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) |
373 | case IPV6_SRCRT_TYPE_2: | 374 | case IPV6_SRCRT_TYPE_2: |
375 | if (rthdr->hdrlen != 2 || | ||
376 | rthdr->segments_left != 1) | ||
377 | goto sticky_done; | ||
378 | |||
374 | break; | 379 | break; |
375 | #endif | 380 | #endif |
376 | default: | 381 | default: |
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c index 07f0b76e7427..97c17fdd6f75 100644 --- a/net/ipv6/proc.c +++ b/net/ipv6/proc.c | |||
@@ -132,7 +132,7 @@ static struct snmp_mib snmp6_udplite6_list[] = { | |||
132 | 132 | ||
133 | static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib) | 133 | static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib) |
134 | { | 134 | { |
135 | static char name[32]; | 135 | char name[32]; |
136 | int i; | 136 | int i; |
137 | 137 | ||
138 | /* print by name -- deprecated items */ | 138 | /* print by name -- deprecated items */ |
@@ -144,7 +144,7 @@ static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib) | |||
144 | p = icmp6type2name[icmptype]; | 144 | p = icmp6type2name[icmptype]; |
145 | if (!p) /* don't print un-named types here */ | 145 | if (!p) /* don't print un-named types here */ |
146 | continue; | 146 | continue; |
147 | (void) snprintf(name, sizeof(name)-1, "Icmp6%s%s", | 147 | snprintf(name, sizeof(name), "Icmp6%s%s", |
148 | i & 0x100 ? "Out" : "In", p); | 148 | i & 0x100 ? "Out" : "In", p); |
149 | seq_printf(seq, "%-32s\t%lu\n", name, | 149 | seq_printf(seq, "%-32s\t%lu\n", name, |
150 | snmp_fold_field(mib, i)); | 150 | snmp_fold_field(mib, i)); |
@@ -157,7 +157,7 @@ static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib) | |||
157 | val = snmp_fold_field(mib, i); | 157 | val = snmp_fold_field(mib, i); |
158 | if (!val) | 158 | if (!val) |
159 | continue; | 159 | continue; |
160 | (void) snprintf(name, sizeof(name)-1, "Icmp6%sType%u", | 160 | snprintf(name, sizeof(name), "Icmp6%sType%u", |
161 | i & 0x100 ? "Out" : "In", i & 0xff); | 161 | i & 0x100 ? "Out" : "In", i & 0xff); |
162 | seq_printf(seq, "%-32s\t%lu\n", name, val); | 162 | seq_printf(seq, "%-32s\t%lu\n", name, val); |
163 | } | 163 | } |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 87665d7bb4f9..409bb7716236 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -2560,25 +2560,3 @@ void ieee80211_mlme_notify_scan_completed(struct ieee80211_local *local) | |||
2560 | ieee80211_restart_sta_timer(sdata); | 2560 | ieee80211_restart_sta_timer(sdata); |
2561 | rcu_read_unlock(); | 2561 | rcu_read_unlock(); |
2562 | } | 2562 | } |
2563 | |||
2564 | /* driver notification call */ | ||
2565 | void ieee80211_notify_mac(struct ieee80211_hw *hw, | ||
2566 | enum ieee80211_notification_types notif_type) | ||
2567 | { | ||
2568 | struct ieee80211_local *local = hw_to_local(hw); | ||
2569 | struct ieee80211_sub_if_data *sdata; | ||
2570 | |||
2571 | switch (notif_type) { | ||
2572 | case IEEE80211_NOTIFY_RE_ASSOC: | ||
2573 | rcu_read_lock(); | ||
2574 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { | ||
2575 | if (sdata->vif.type != NL80211_IFTYPE_STATION) | ||
2576 | continue; | ||
2577 | |||
2578 | ieee80211_sta_req_auth(sdata, &sdata->u.sta); | ||
2579 | } | ||
2580 | rcu_read_unlock(); | ||
2581 | break; | ||
2582 | } | ||
2583 | } | ||
2584 | EXPORT_SYMBOL(ieee80211_notify_mac); | ||
diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c index defeb7a0d502..9d211f12582b 100644 --- a/net/phonet/af_phonet.c +++ b/net/phonet/af_phonet.c | |||
@@ -33,9 +33,30 @@ | |||
33 | #include <net/phonet/phonet.h> | 33 | #include <net/phonet/phonet.h> |
34 | #include <net/phonet/pn_dev.h> | 34 | #include <net/phonet/pn_dev.h> |
35 | 35 | ||
36 | static struct net_proto_family phonet_proto_family; | 36 | /* Transport protocol registration */ |
37 | static struct phonet_protocol *phonet_proto_get(int protocol); | 37 | static struct phonet_protocol *proto_tab[PHONET_NPROTO] __read_mostly; |
38 | static inline void phonet_proto_put(struct phonet_protocol *pp); | 38 | static DEFINE_SPINLOCK(proto_tab_lock); |
39 | |||
40 | static struct phonet_protocol *phonet_proto_get(int protocol) | ||
41 | { | ||
42 | struct phonet_protocol *pp; | ||
43 | |||
44 | if (protocol >= PHONET_NPROTO) | ||
45 | return NULL; | ||
46 | |||
47 | spin_lock(&proto_tab_lock); | ||
48 | pp = proto_tab[protocol]; | ||
49 | if (pp && !try_module_get(pp->prot->owner)) | ||
50 | pp = NULL; | ||
51 | spin_unlock(&proto_tab_lock); | ||
52 | |||
53 | return pp; | ||
54 | } | ||
55 | |||
56 | static inline void phonet_proto_put(struct phonet_protocol *pp) | ||
57 | { | ||
58 | module_put(pp->prot->owner); | ||
59 | } | ||
39 | 60 | ||
40 | /* protocol family functions */ | 61 | /* protocol family functions */ |
41 | 62 | ||
@@ -144,8 +165,8 @@ static int pn_send(struct sk_buff *skb, struct net_device *dev, | |||
144 | struct phonethdr *ph; | 165 | struct phonethdr *ph; |
145 | int err; | 166 | int err; |
146 | 167 | ||
147 | if (skb->len + 2 > 0xffff) { | 168 | if (skb->len + 2 > 0xffff /* Phonet length field limit */ || |
148 | /* Phonet length field would overflow */ | 169 | skb->len + sizeof(struct phonethdr) > dev->mtu) { |
149 | err = -EMSGSIZE; | 170 | err = -EMSGSIZE; |
150 | goto drop; | 171 | goto drop; |
151 | } | 172 | } |
@@ -375,10 +396,6 @@ static struct packet_type phonet_packet_type = { | |||
375 | .func = phonet_rcv, | 396 | .func = phonet_rcv, |
376 | }; | 397 | }; |
377 | 398 | ||
378 | /* Transport protocol registration */ | ||
379 | static struct phonet_protocol *proto_tab[PHONET_NPROTO] __read_mostly; | ||
380 | static DEFINE_SPINLOCK(proto_tab_lock); | ||
381 | |||
382 | int __init_or_module phonet_proto_register(int protocol, | 399 | int __init_or_module phonet_proto_register(int protocol, |
383 | struct phonet_protocol *pp) | 400 | struct phonet_protocol *pp) |
384 | { | 401 | { |
@@ -412,27 +429,6 @@ void phonet_proto_unregister(int protocol, struct phonet_protocol *pp) | |||
412 | } | 429 | } |
413 | EXPORT_SYMBOL(phonet_proto_unregister); | 430 | EXPORT_SYMBOL(phonet_proto_unregister); |
414 | 431 | ||
415 | static struct phonet_protocol *phonet_proto_get(int protocol) | ||
416 | { | ||
417 | struct phonet_protocol *pp; | ||
418 | |||
419 | if (protocol >= PHONET_NPROTO) | ||
420 | return NULL; | ||
421 | |||
422 | spin_lock(&proto_tab_lock); | ||
423 | pp = proto_tab[protocol]; | ||
424 | if (pp && !try_module_get(pp->prot->owner)) | ||
425 | pp = NULL; | ||
426 | spin_unlock(&proto_tab_lock); | ||
427 | |||
428 | return pp; | ||
429 | } | ||
430 | |||
431 | static inline void phonet_proto_put(struct phonet_protocol *pp) | ||
432 | { | ||
433 | module_put(pp->prot->owner); | ||
434 | } | ||
435 | |||
436 | /* Module registration */ | 432 | /* Module registration */ |
437 | static int __init phonet_init(void) | 433 | static int __init phonet_init(void) |
438 | { | 434 | { |
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index b16ad2972c6b..6ab4a2f92ca0 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
@@ -417,6 +417,8 @@ static int qdisc_dump_stab(struct sk_buff *skb, struct qdisc_size_table *stab) | |||
417 | struct nlattr *nest; | 417 | struct nlattr *nest; |
418 | 418 | ||
419 | nest = nla_nest_start(skb, TCA_STAB); | 419 | nest = nla_nest_start(skb, TCA_STAB); |
420 | if (nest == NULL) | ||
421 | goto nla_put_failure; | ||
420 | NLA_PUT(skb, TCA_STAB_BASE, sizeof(stab->szopts), &stab->szopts); | 422 | NLA_PUT(skb, TCA_STAB_BASE, sizeof(stab->szopts), &stab->szopts); |
421 | nla_nest_end(skb, nest); | 423 | nla_nest_end(skb, nest); |
422 | 424 | ||
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 93cd30ce6501..cdcd16fcfeda 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
@@ -270,6 +270,8 @@ static void dev_watchdog_down(struct net_device *dev) | |||
270 | void netif_carrier_on(struct net_device *dev) | 270 | void netif_carrier_on(struct net_device *dev) |
271 | { | 271 | { |
272 | if (test_and_clear_bit(__LINK_STATE_NOCARRIER, &dev->state)) { | 272 | if (test_and_clear_bit(__LINK_STATE_NOCARRIER, &dev->state)) { |
273 | if (dev->reg_state == NETREG_UNINITIALIZED) | ||
274 | return; | ||
273 | linkwatch_fire_event(dev); | 275 | linkwatch_fire_event(dev); |
274 | if (netif_running(dev)) | 276 | if (netif_running(dev)) |
275 | __netdev_watchdog_up(dev); | 277 | __netdev_watchdog_up(dev); |
@@ -285,8 +287,11 @@ EXPORT_SYMBOL(netif_carrier_on); | |||
285 | */ | 287 | */ |
286 | void netif_carrier_off(struct net_device *dev) | 288 | void netif_carrier_off(struct net_device *dev) |
287 | { | 289 | { |
288 | if (!test_and_set_bit(__LINK_STATE_NOCARRIER, &dev->state)) | 290 | if (!test_and_set_bit(__LINK_STATE_NOCARRIER, &dev->state)) { |
291 | if (dev->reg_state == NETREG_UNINITIALIZED) | ||
292 | return; | ||
289 | linkwatch_fire_event(dev); | 293 | linkwatch_fire_event(dev); |
294 | } | ||
290 | } | 295 | } |
291 | EXPORT_SYMBOL(netif_carrier_off); | 296 | EXPORT_SYMBOL(netif_carrier_off); |
292 | 297 | ||
diff --git a/net/socket.c b/net/socket.c index 57550c3bcabe..92764d836891 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -1426,8 +1426,8 @@ asmlinkage long sys_listen(int fd, int backlog) | |||
1426 | * clean when we restucture accept also. | 1426 | * clean when we restucture accept also. |
1427 | */ | 1427 | */ |
1428 | 1428 | ||
1429 | long do_accept(int fd, struct sockaddr __user *upeer_sockaddr, | 1429 | asmlinkage long sys_accept4(int fd, struct sockaddr __user *upeer_sockaddr, |
1430 | int __user *upeer_addrlen, int flags) | 1430 | int __user *upeer_addrlen, int flags) |
1431 | { | 1431 | { |
1432 | struct socket *sock, *newsock; | 1432 | struct socket *sock, *newsock; |
1433 | struct file *newfile; | 1433 | struct file *newfile; |
@@ -1510,66 +1510,10 @@ out_fd: | |||
1510 | goto out_put; | 1510 | goto out_put; |
1511 | } | 1511 | } |
1512 | 1512 | ||
1513 | #if 0 | ||
1514 | #ifdef HAVE_SET_RESTORE_SIGMASK | ||
1515 | asmlinkage long sys_paccept(int fd, struct sockaddr __user *upeer_sockaddr, | ||
1516 | int __user *upeer_addrlen, | ||
1517 | const sigset_t __user *sigmask, | ||
1518 | size_t sigsetsize, int flags) | ||
1519 | { | ||
1520 | sigset_t ksigmask, sigsaved; | ||
1521 | int ret; | ||
1522 | |||
1523 | if (sigmask) { | ||
1524 | /* XXX: Don't preclude handling different sized sigset_t's. */ | ||
1525 | if (sigsetsize != sizeof(sigset_t)) | ||
1526 | return -EINVAL; | ||
1527 | if (copy_from_user(&ksigmask, sigmask, sizeof(ksigmask))) | ||
1528 | return -EFAULT; | ||
1529 | |||
1530 | sigdelsetmask(&ksigmask, sigmask(SIGKILL)|sigmask(SIGSTOP)); | ||
1531 | sigprocmask(SIG_SETMASK, &ksigmask, &sigsaved); | ||
1532 | } | ||
1533 | |||
1534 | ret = do_accept(fd, upeer_sockaddr, upeer_addrlen, flags); | ||
1535 | |||
1536 | if (ret < 0 && signal_pending(current)) { | ||
1537 | /* | ||
1538 | * Don't restore the signal mask yet. Let do_signal() deliver | ||
1539 | * the signal on the way back to userspace, before the signal | ||
1540 | * mask is restored. | ||
1541 | */ | ||
1542 | if (sigmask) { | ||
1543 | memcpy(¤t->saved_sigmask, &sigsaved, | ||
1544 | sizeof(sigsaved)); | ||
1545 | set_restore_sigmask(); | ||
1546 | } | ||
1547 | } else if (sigmask) | ||
1548 | sigprocmask(SIG_SETMASK, &sigsaved, NULL); | ||
1549 | |||
1550 | return ret; | ||
1551 | } | ||
1552 | #else | ||
1553 | asmlinkage long sys_paccept(int fd, struct sockaddr __user *upeer_sockaddr, | ||
1554 | int __user *upeer_addrlen, | ||
1555 | const sigset_t __user *sigmask, | ||
1556 | size_t sigsetsize, int flags) | ||
1557 | { | ||
1558 | /* The platform does not support restoring the signal mask in the | ||
1559 | * return path. So we do not allow using paccept() with a signal | ||
1560 | * mask. */ | ||
1561 | if (sigmask) | ||
1562 | return -EINVAL; | ||
1563 | |||
1564 | return do_accept(fd, upeer_sockaddr, upeer_addrlen, flags); | ||
1565 | } | ||
1566 | #endif | ||
1567 | #endif | ||
1568 | |||
1569 | asmlinkage long sys_accept(int fd, struct sockaddr __user *upeer_sockaddr, | 1513 | asmlinkage long sys_accept(int fd, struct sockaddr __user *upeer_sockaddr, |
1570 | int __user *upeer_addrlen) | 1514 | int __user *upeer_addrlen) |
1571 | { | 1515 | { |
1572 | return do_accept(fd, upeer_sockaddr, upeer_addrlen, 0); | 1516 | return sys_accept4(fd, upeer_sockaddr, upeer_addrlen, 0); |
1573 | } | 1517 | } |
1574 | 1518 | ||
1575 | /* | 1519 | /* |
@@ -2096,7 +2040,7 @@ static const unsigned char nargs[19]={ | |||
2096 | AL(0),AL(3),AL(3),AL(3),AL(2),AL(3), | 2040 | AL(0),AL(3),AL(3),AL(3),AL(2),AL(3), |
2097 | AL(3),AL(3),AL(4),AL(4),AL(4),AL(6), | 2041 | AL(3),AL(3),AL(4),AL(4),AL(4),AL(6), |
2098 | AL(6),AL(2),AL(5),AL(5),AL(3),AL(3), | 2042 | AL(6),AL(2),AL(5),AL(5),AL(3),AL(3), |
2099 | AL(6) | 2043 | AL(4) |
2100 | }; | 2044 | }; |
2101 | 2045 | ||
2102 | #undef AL | 2046 | #undef AL |
@@ -2115,7 +2059,7 @@ asmlinkage long sys_socketcall(int call, unsigned long __user *args) | |||
2115 | unsigned long a0, a1; | 2059 | unsigned long a0, a1; |
2116 | int err; | 2060 | int err; |
2117 | 2061 | ||
2118 | if (call < 1 || call > SYS_PACCEPT) | 2062 | if (call < 1 || call > SYS_ACCEPT4) |
2119 | return -EINVAL; | 2063 | return -EINVAL; |
2120 | 2064 | ||
2121 | /* copy_from_user should be SMP safe. */ | 2065 | /* copy_from_user should be SMP safe. */ |
@@ -2143,9 +2087,8 @@ asmlinkage long sys_socketcall(int call, unsigned long __user *args) | |||
2143 | err = sys_listen(a0, a1); | 2087 | err = sys_listen(a0, a1); |
2144 | break; | 2088 | break; |
2145 | case SYS_ACCEPT: | 2089 | case SYS_ACCEPT: |
2146 | err = | 2090 | err = sys_accept4(a0, (struct sockaddr __user *)a1, |
2147 | do_accept(a0, (struct sockaddr __user *)a1, | 2091 | (int __user *)a[2], 0); |
2148 | (int __user *)a[2], 0); | ||
2149 | break; | 2092 | break; |
2150 | case SYS_GETSOCKNAME: | 2093 | case SYS_GETSOCKNAME: |
2151 | err = | 2094 | err = |
@@ -2192,12 +2135,9 @@ asmlinkage long sys_socketcall(int call, unsigned long __user *args) | |||
2192 | case SYS_RECVMSG: | 2135 | case SYS_RECVMSG: |
2193 | err = sys_recvmsg(a0, (struct msghdr __user *)a1, a[2]); | 2136 | err = sys_recvmsg(a0, (struct msghdr __user *)a1, a[2]); |
2194 | break; | 2137 | break; |
2195 | case SYS_PACCEPT: | 2138 | case SYS_ACCEPT4: |
2196 | err = | 2139 | err = sys_accept4(a0, (struct sockaddr __user *)a1, |
2197 | sys_paccept(a0, (struct sockaddr __user *)a1, | 2140 | (int __user *)a[2], a[3]); |
2198 | (int __user *)a[2], | ||
2199 | (const sigset_t __user *) a[3], | ||
2200 | a[4], a[5]); | ||
2201 | break; | 2141 | break; |
2202 | default: | 2142 | default: |
2203 | err = -EINVAL; | 2143 | err = -EINVAL; |
diff --git a/net/sunrpc/auth_generic.c b/net/sunrpc/auth_generic.c index 744b79fdcb19..4028502f0528 100644 --- a/net/sunrpc/auth_generic.c +++ b/net/sunrpc/auth_generic.c | |||
@@ -133,13 +133,29 @@ static int | |||
133 | generic_match(struct auth_cred *acred, struct rpc_cred *cred, int flags) | 133 | generic_match(struct auth_cred *acred, struct rpc_cred *cred, int flags) |
134 | { | 134 | { |
135 | struct generic_cred *gcred = container_of(cred, struct generic_cred, gc_base); | 135 | struct generic_cred *gcred = container_of(cred, struct generic_cred, gc_base); |
136 | int i; | ||
136 | 137 | ||
137 | if (gcred->acred.uid != acred->uid || | 138 | if (gcred->acred.uid != acred->uid || |
138 | gcred->acred.gid != acred->gid || | 139 | gcred->acred.gid != acred->gid || |
139 | gcred->acred.group_info != acred->group_info || | ||
140 | gcred->acred.machine_cred != acred->machine_cred) | 140 | gcred->acred.machine_cred != acred->machine_cred) |
141 | return 0; | 141 | goto out_nomatch; |
142 | |||
143 | /* Optimisation in the case where pointers are identical... */ | ||
144 | if (gcred->acred.group_info == acred->group_info) | ||
145 | goto out_match; | ||
146 | |||
147 | /* Slow path... */ | ||
148 | if (gcred->acred.group_info->ngroups != acred->group_info->ngroups) | ||
149 | goto out_nomatch; | ||
150 | for (i = 0; i < gcred->acred.group_info->ngroups; i++) { | ||
151 | if (GROUP_AT(gcred->acred.group_info, i) != | ||
152 | GROUP_AT(acred->group_info, i)) | ||
153 | goto out_nomatch; | ||
154 | } | ||
155 | out_match: | ||
142 | return 1; | 156 | return 1; |
157 | out_nomatch: | ||
158 | return 0; | ||
143 | } | 159 | } |
144 | 160 | ||
145 | void __init rpc_init_generic_auth(void) | 161 | void __init rpc_init_generic_auth(void) |