aboutsummaryrefslogtreecommitdiffstats
path: root/net/socket.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-06-05 06:19:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-06-05 06:19:04 -0400
commit4d3797d7e1861ac1af150a6189315786c5e1c820 (patch)
treeaa7eff5dc1e297e1560eaa85d1fac5735e0650c1 /net/socket.c
parent844ce9f2044723a9da0f4bce588cca410e774d24 (diff)
parent5343a7f8be11951cb3095b91e8e4eb506cfacc0f (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix timeouts with direct mode authentication in mac80211, from Stanislaw Gruszka. 2) Aggregation sessions can deadlock in ath9k, from Felix Fietkau. 3) Netfilter's xt_addrtype doesn't work with ipv6 due to route lookups creating undesirable cache entries, from Florian Westphal. 4) Fix netfilter's ipt_ULOG from generating non-NULL terminated strings. 5) Fix netdev transmit queue crashes in mac80211, from Johannes Berg. 6) Fix copy and paste error in 802.11 stack that broke reporting of 64-bit station tx statistics, from Felix Fietkau. 7) When qlge_probe fails, it leaks the netdev. Fix from Wei Yongjun. 8) SKB control block (where we store the IP options information, amongst other things) must be cleared properly otherwise ICMP sending can crash for IP tunnels. Fix from Eric Dumazet. 9) Verification of Energy Efficient Ether support was coded wrongly, the test was inversed. Fix from Giuseppe CAVALLARO. 10) TCP handles redirects improperly because the wrong flow key is used for the route lookup. From Michal Kubecek. 11) Don't interpret MSG_CMSG_COMPAT from userspace, fix from Andy Lutomirski. 12) The new AF_VSOCK was missing from the lockdep string table, fix from Federico Vaga. 13) be2net doesn't handle checksumming of IP fragments properly, from Somnath Kotur. 14) Fix several bugs in the device address list code that lead to crashes and other misbehaviors. From Jay Vosburgh. 15) Fix ipv6 segmentation handling of fragmented GRE tunnel traffic, from Pravin B Shalr. 16) Fix usage of stale policies in IPSEC layer, from Paul Moore. 17) Fix team driver dump of ports when there are a large number of them, from Jiri Pirko. 18) Fix softlockups in UDP ipv4 socket lookup causes by and error in the hlist_nulls_for_each_entry_rcu() macro. From Eric Dumazet. 19) Fix several regressions added by the high rate accuracy changes to the htb packet scheduler. From Eric Dumazet. 20) Fix DMA'ing onto the stack in esd_usb2 and peak_usb CAN drivers, from Olivier Sobrie and Marc Kleine-Budde. 21) Fix unremovable network devices due to missing route pointer installation in the per-device ipv6 address list entries. From Gao feng. 22) Apply the tg3 5719 DMA workaround on 5720 chips as well, otherwise we get stalls. From Nithin Sujir. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (68 commits) net_sched: htb: do not mix 1ns and 64ns time units net: fix sk_buff head without data area tg3: Add read dma workaround for 5720 net: ethernet: xilinx_emaclite: set protocol selector bits when writing ANAR bnx2x: Fix bridged GSO for 57710/57711 chips net: fec: add fallback to random MAC address bnx2x: fix TCP offload for tunneling ipv4 over ipv6 ipv6: assign rt6_info to inet6_ifaddr in init_loopback net/mlx4_core: Keep VF assigned MAC in the PF admin table net/mlx4_en: Handle unassigned VF MAC address correctly net/mlx4_core: Return -EPROBE_DEFER when a VF is probed before PF is sufficiently initialized net/mlx4_en: Fix adaptive moderation cq update net: can: peak_usb: Do not do dma on the stack net: can: esd_usb2: Do not do dma on the stack net: can: kvaser_usb: fix reception on "USBcan Pro" and "USBcan R" type hardware. net_sched: restore "overhead xxx" handling net: force a reload of first item in hlist_nulls_for_each_entry_rcu hyperv: Fix vlan_proto setting in netvsc_recv_callback() team: fix port list dump for big number of ports list: introduce list_first_entry_or_null ...
Diffstat (limited to 'net/socket.c')
-rw-r--r--net/socket.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/net/socket.c b/net/socket.c
index 6b94633ca61d..9ff6366fee13 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -2075,8 +2075,12 @@ SYSCALL_DEFINE3(sendmsg, int, fd, struct msghdr __user *, msg, unsigned int, fla
2075{ 2075{
2076 int fput_needed, err; 2076 int fput_needed, err;
2077 struct msghdr msg_sys; 2077 struct msghdr msg_sys;
2078 struct socket *sock = sockfd_lookup_light(fd, &err, &fput_needed); 2078 struct socket *sock;
2079
2080 if (flags & MSG_CMSG_COMPAT)
2081 return -EINVAL;
2079 2082
2083 sock = sockfd_lookup_light(fd, &err, &fput_needed);
2080 if (!sock) 2084 if (!sock)
2081 goto out; 2085 goto out;
2082 2086
@@ -2149,6 +2153,8 @@ int __sys_sendmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen,
2149SYSCALL_DEFINE4(sendmmsg, int, fd, struct mmsghdr __user *, mmsg, 2153SYSCALL_DEFINE4(sendmmsg, int, fd, struct mmsghdr __user *, mmsg,
2150 unsigned int, vlen, unsigned int, flags) 2154 unsigned int, vlen, unsigned int, flags)
2151{ 2155{
2156 if (flags & MSG_CMSG_COMPAT)
2157 return -EINVAL;
2152 return __sys_sendmmsg(fd, mmsg, vlen, flags); 2158 return __sys_sendmmsg(fd, mmsg, vlen, flags);
2153} 2159}
2154 2160
@@ -2249,8 +2255,12 @@ SYSCALL_DEFINE3(recvmsg, int, fd, struct msghdr __user *, msg,
2249{ 2255{
2250 int fput_needed, err; 2256 int fput_needed, err;
2251 struct msghdr msg_sys; 2257 struct msghdr msg_sys;
2252 struct socket *sock = sockfd_lookup_light(fd, &err, &fput_needed); 2258 struct socket *sock;
2259
2260 if (flags & MSG_CMSG_COMPAT)
2261 return -EINVAL;
2253 2262
2263 sock = sockfd_lookup_light(fd, &err, &fput_needed);
2254 if (!sock) 2264 if (!sock)
2255 goto out; 2265 goto out;
2256 2266
@@ -2375,6 +2385,9 @@ SYSCALL_DEFINE5(recvmmsg, int, fd, struct mmsghdr __user *, mmsg,
2375 int datagrams; 2385 int datagrams;
2376 struct timespec timeout_sys; 2386 struct timespec timeout_sys;
2377 2387
2388 if (flags & MSG_CMSG_COMPAT)
2389 return -EINVAL;
2390
2378 if (!timeout) 2391 if (!timeout)
2379 return __sys_recvmmsg(fd, mmsg, vlen, flags, NULL); 2392 return __sys_recvmmsg(fd, mmsg, vlen, flags, NULL);
2380 2393
@@ -2492,15 +2505,31 @@ SYSCALL_DEFINE2(socketcall, int, call, unsigned long __user *, args)
2492 (int __user *)a[4]); 2505 (int __user *)a[4]);
2493 break; 2506 break;
2494 case SYS_SENDMSG: 2507 case SYS_SENDMSG:
2508 if (a[2] & MSG_CMSG_COMPAT) {
2509 err = -EINVAL;
2510 break;
2511 }
2495 err = sys_sendmsg(a0, (struct msghdr __user *)a1, a[2]); 2512 err = sys_sendmsg(a0, (struct msghdr __user *)a1, a[2]);
2496 break; 2513 break;
2497 case SYS_SENDMMSG: 2514 case SYS_SENDMMSG:
2515 if (a[3] & MSG_CMSG_COMPAT) {
2516 err = -EINVAL;
2517 break;
2518 }
2498 err = sys_sendmmsg(a0, (struct mmsghdr __user *)a1, a[2], a[3]); 2519 err = sys_sendmmsg(a0, (struct mmsghdr __user *)a1, a[2], a[3]);
2499 break; 2520 break;
2500 case SYS_RECVMSG: 2521 case SYS_RECVMSG:
2522 if (a[2] & MSG_CMSG_COMPAT) {
2523 err = -EINVAL;
2524 break;
2525 }
2501 err = sys_recvmsg(a0, (struct msghdr __user *)a1, a[2]); 2526 err = sys_recvmsg(a0, (struct msghdr __user *)a1, a[2]);
2502 break; 2527 break;
2503 case SYS_RECVMMSG: 2528 case SYS_RECVMMSG:
2529 if (a[3] & MSG_CMSG_COMPAT) {
2530 err = -EINVAL;
2531 break;
2532 }
2504 err = sys_recvmmsg(a0, (struct mmsghdr __user *)a1, a[2], a[3], 2533 err = sys_recvmmsg(a0, (struct mmsghdr __user *)a1, a[2], a[3],
2505 (struct timespec __user *)a[4]); 2534 (struct timespec __user *)a[4]);
2506 break; 2535 break;