diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-20 20:43:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-20 20:43:29 -0400 |
commit | db6d8c7a4027b48d797b369a53f8470aaeed7063 (patch) | |
tree | e140c104a89abc2154e1f41a7db8ebecbb6fa0b4 /fs | |
parent | 3a533374283aea50eab3976d8a6d30532175f009 (diff) | |
parent | fb65a7c091529bfffb1262515252c0d0f6241c5c (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (1232 commits)
iucv: Fix bad merging.
net_sched: Add size table for qdiscs
net_sched: Add accessor function for packet length for qdiscs
net_sched: Add qdisc_enqueue wrapper
highmem: Export totalhigh_pages.
ipv6 mcast: Omit redundant address family checks in ip6_mc_source().
net: Use standard structures for generic socket address structures.
ipv6 netns: Make several "global" sysctl variables namespace aware.
netns: Use net_eq() to compare net-namespaces for optimization.
ipv6: remove unused macros from net/ipv6.h
ipv6: remove unused parameter from ip6_ra_control
tcp: fix kernel panic with listening_get_next
tcp: Remove redundant checks when setting eff_sacks
tcp: options clean up
tcp: Fix MD5 signatures for non-linear skbs
sctp: Update sctp global memory limit allocations.
sctp: remove unnecessary byteshifting, calculate directly in big-endian
sctp: Allow only 1 listening socket with SO_REUSEADDR
sctp: Do not leak memory on multiple listen() calls
sctp: Support ipv6only AF_INET6 sockets.
...
Diffstat (limited to 'fs')
-rw-r--r-- | fs/compat_ioctl.c | 114 | ||||
-rw-r--r-- | fs/proc/proc_net.c | 32 |
2 files changed, 34 insertions, 112 deletions
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index c54eaab71a19..7b3a03c7c6a9 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c | |||
@@ -58,7 +58,6 @@ | |||
58 | #include <linux/syscalls.h> | 58 | #include <linux/syscalls.h> |
59 | #include <linux/i2c.h> | 59 | #include <linux/i2c.h> |
60 | #include <linux/i2c-dev.h> | 60 | #include <linux/i2c-dev.h> |
61 | #include <linux/wireless.h> | ||
62 | #include <linux/atalk.h> | 61 | #include <linux/atalk.h> |
63 | #include <linux/loop.h> | 62 | #include <linux/loop.h> |
64 | 63 | ||
@@ -1759,64 +1758,6 @@ static int do_i2c_smbus_ioctl(unsigned int fd, unsigned int cmd, unsigned long a | |||
1759 | return sys_ioctl(fd, cmd, (unsigned long)tdata); | 1758 | return sys_ioctl(fd, cmd, (unsigned long)tdata); |
1760 | } | 1759 | } |
1761 | 1760 | ||
1762 | struct compat_iw_point { | ||
1763 | compat_caddr_t pointer; | ||
1764 | __u16 length; | ||
1765 | __u16 flags; | ||
1766 | }; | ||
1767 | |||
1768 | static int do_wireless_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) | ||
1769 | { | ||
1770 | struct iwreq __user *iwr; | ||
1771 | struct iwreq __user *iwr_u; | ||
1772 | struct iw_point __user *iwp; | ||
1773 | struct compat_iw_point __user *iwp_u; | ||
1774 | compat_caddr_t pointer_u; | ||
1775 | void __user *pointer; | ||
1776 | __u16 length, flags; | ||
1777 | int ret; | ||
1778 | |||
1779 | iwr_u = compat_ptr(arg); | ||
1780 | iwp_u = (struct compat_iw_point __user *) &iwr_u->u.data; | ||
1781 | iwr = compat_alloc_user_space(sizeof(*iwr)); | ||
1782 | if (iwr == NULL) | ||
1783 | return -ENOMEM; | ||
1784 | |||
1785 | iwp = &iwr->u.data; | ||
1786 | |||
1787 | if (!access_ok(VERIFY_WRITE, iwr, sizeof(*iwr))) | ||
1788 | return -EFAULT; | ||
1789 | |||
1790 | if (__copy_in_user(&iwr->ifr_ifrn.ifrn_name[0], | ||
1791 | &iwr_u->ifr_ifrn.ifrn_name[0], | ||
1792 | sizeof(iwr->ifr_ifrn.ifrn_name))) | ||
1793 | return -EFAULT; | ||
1794 | |||
1795 | if (__get_user(pointer_u, &iwp_u->pointer) || | ||
1796 | __get_user(length, &iwp_u->length) || | ||
1797 | __get_user(flags, &iwp_u->flags)) | ||
1798 | return -EFAULT; | ||
1799 | |||
1800 | if (__put_user(compat_ptr(pointer_u), &iwp->pointer) || | ||
1801 | __put_user(length, &iwp->length) || | ||
1802 | __put_user(flags, &iwp->flags)) | ||
1803 | return -EFAULT; | ||
1804 | |||
1805 | ret = sys_ioctl(fd, cmd, (unsigned long) iwr); | ||
1806 | |||
1807 | if (__get_user(pointer, &iwp->pointer) || | ||
1808 | __get_user(length, &iwp->length) || | ||
1809 | __get_user(flags, &iwp->flags)) | ||
1810 | return -EFAULT; | ||
1811 | |||
1812 | if (__put_user(ptr_to_compat(pointer), &iwp_u->pointer) || | ||
1813 | __put_user(length, &iwp_u->length) || | ||
1814 | __put_user(flags, &iwp_u->flags)) | ||
1815 | return -EFAULT; | ||
1816 | |||
1817 | return ret; | ||
1818 | } | ||
1819 | |||
1820 | /* Since old style bridge ioctl's endup using SIOCDEVPRIVATE | 1761 | /* Since old style bridge ioctl's endup using SIOCDEVPRIVATE |
1821 | * for some operations; this forces use of the newer bridge-utils that | 1762 | * for some operations; this forces use of the newer bridge-utils that |
1822 | * use compatiable ioctls | 1763 | * use compatiable ioctls |
@@ -2405,6 +2346,7 @@ COMPATIBLE_IOCTL(HCIGETDEVLIST) | |||
2405 | COMPATIBLE_IOCTL(HCIGETDEVINFO) | 2346 | COMPATIBLE_IOCTL(HCIGETDEVINFO) |
2406 | COMPATIBLE_IOCTL(HCIGETCONNLIST) | 2347 | COMPATIBLE_IOCTL(HCIGETCONNLIST) |
2407 | COMPATIBLE_IOCTL(HCIGETCONNINFO) | 2348 | COMPATIBLE_IOCTL(HCIGETCONNINFO) |
2349 | COMPATIBLE_IOCTL(HCIGETAUTHINFO) | ||
2408 | COMPATIBLE_IOCTL(HCISETRAW) | 2350 | COMPATIBLE_IOCTL(HCISETRAW) |
2409 | COMPATIBLE_IOCTL(HCISETSCAN) | 2351 | COMPATIBLE_IOCTL(HCISETSCAN) |
2410 | COMPATIBLE_IOCTL(HCISETAUTH) | 2352 | COMPATIBLE_IOCTL(HCISETAUTH) |
@@ -2501,36 +2443,6 @@ COMPATIBLE_IOCTL(I2C_TENBIT) | |||
2501 | COMPATIBLE_IOCTL(I2C_PEC) | 2443 | COMPATIBLE_IOCTL(I2C_PEC) |
2502 | COMPATIBLE_IOCTL(I2C_RETRIES) | 2444 | COMPATIBLE_IOCTL(I2C_RETRIES) |
2503 | COMPATIBLE_IOCTL(I2C_TIMEOUT) | 2445 | COMPATIBLE_IOCTL(I2C_TIMEOUT) |
2504 | /* wireless */ | ||
2505 | COMPATIBLE_IOCTL(SIOCSIWCOMMIT) | ||
2506 | COMPATIBLE_IOCTL(SIOCGIWNAME) | ||
2507 | COMPATIBLE_IOCTL(SIOCSIWNWID) | ||
2508 | COMPATIBLE_IOCTL(SIOCGIWNWID) | ||
2509 | COMPATIBLE_IOCTL(SIOCSIWFREQ) | ||
2510 | COMPATIBLE_IOCTL(SIOCGIWFREQ) | ||
2511 | COMPATIBLE_IOCTL(SIOCSIWMODE) | ||
2512 | COMPATIBLE_IOCTL(SIOCGIWMODE) | ||
2513 | COMPATIBLE_IOCTL(SIOCSIWSENS) | ||
2514 | COMPATIBLE_IOCTL(SIOCGIWSENS) | ||
2515 | COMPATIBLE_IOCTL(SIOCSIWRANGE) | ||
2516 | COMPATIBLE_IOCTL(SIOCSIWPRIV) | ||
2517 | COMPATIBLE_IOCTL(SIOCSIWSTATS) | ||
2518 | COMPATIBLE_IOCTL(SIOCSIWAP) | ||
2519 | COMPATIBLE_IOCTL(SIOCGIWAP) | ||
2520 | COMPATIBLE_IOCTL(SIOCSIWRATE) | ||
2521 | COMPATIBLE_IOCTL(SIOCGIWRATE) | ||
2522 | COMPATIBLE_IOCTL(SIOCSIWRTS) | ||
2523 | COMPATIBLE_IOCTL(SIOCGIWRTS) | ||
2524 | COMPATIBLE_IOCTL(SIOCSIWFRAG) | ||
2525 | COMPATIBLE_IOCTL(SIOCGIWFRAG) | ||
2526 | COMPATIBLE_IOCTL(SIOCSIWTXPOW) | ||
2527 | COMPATIBLE_IOCTL(SIOCGIWTXPOW) | ||
2528 | COMPATIBLE_IOCTL(SIOCSIWRETRY) | ||
2529 | COMPATIBLE_IOCTL(SIOCGIWRETRY) | ||
2530 | COMPATIBLE_IOCTL(SIOCSIWPOWER) | ||
2531 | COMPATIBLE_IOCTL(SIOCGIWPOWER) | ||
2532 | COMPATIBLE_IOCTL(SIOCSIWAUTH) | ||
2533 | COMPATIBLE_IOCTL(SIOCGIWAUTH) | ||
2534 | /* hiddev */ | 2446 | /* hiddev */ |
2535 | COMPATIBLE_IOCTL(HIDIOCGVERSION) | 2447 | COMPATIBLE_IOCTL(HIDIOCGVERSION) |
2536 | COMPATIBLE_IOCTL(HIDIOCAPPLICATION) | 2448 | COMPATIBLE_IOCTL(HIDIOCAPPLICATION) |
@@ -2761,29 +2673,7 @@ COMPATIBLE_IOCTL(USBDEVFS_IOCTL32) | |||
2761 | HANDLE_IOCTL(I2C_FUNCS, w_long) | 2673 | HANDLE_IOCTL(I2C_FUNCS, w_long) |
2762 | HANDLE_IOCTL(I2C_RDWR, do_i2c_rdwr_ioctl) | 2674 | HANDLE_IOCTL(I2C_RDWR, do_i2c_rdwr_ioctl) |
2763 | HANDLE_IOCTL(I2C_SMBUS, do_i2c_smbus_ioctl) | 2675 | HANDLE_IOCTL(I2C_SMBUS, do_i2c_smbus_ioctl) |
2764 | /* wireless */ | 2676 | /* bridge */ |
2765 | HANDLE_IOCTL(SIOCGIWRANGE, do_wireless_ioctl) | ||
2766 | HANDLE_IOCTL(SIOCGIWPRIV, do_wireless_ioctl) | ||
2767 | HANDLE_IOCTL(SIOCGIWSTATS, do_wireless_ioctl) | ||
2768 | HANDLE_IOCTL(SIOCSIWSPY, do_wireless_ioctl) | ||
2769 | HANDLE_IOCTL(SIOCGIWSPY, do_wireless_ioctl) | ||
2770 | HANDLE_IOCTL(SIOCSIWTHRSPY, do_wireless_ioctl) | ||
2771 | HANDLE_IOCTL(SIOCGIWTHRSPY, do_wireless_ioctl) | ||
2772 | HANDLE_IOCTL(SIOCSIWMLME, do_wireless_ioctl) | ||
2773 | HANDLE_IOCTL(SIOCGIWAPLIST, do_wireless_ioctl) | ||
2774 | HANDLE_IOCTL(SIOCSIWSCAN, do_wireless_ioctl) | ||
2775 | HANDLE_IOCTL(SIOCGIWSCAN, do_wireless_ioctl) | ||
2776 | HANDLE_IOCTL(SIOCSIWESSID, do_wireless_ioctl) | ||
2777 | HANDLE_IOCTL(SIOCGIWESSID, do_wireless_ioctl) | ||
2778 | HANDLE_IOCTL(SIOCSIWNICKN, do_wireless_ioctl) | ||
2779 | HANDLE_IOCTL(SIOCGIWNICKN, do_wireless_ioctl) | ||
2780 | HANDLE_IOCTL(SIOCSIWENCODE, do_wireless_ioctl) | ||
2781 | HANDLE_IOCTL(SIOCGIWENCODE, do_wireless_ioctl) | ||
2782 | HANDLE_IOCTL(SIOCSIWGENIE, do_wireless_ioctl) | ||
2783 | HANDLE_IOCTL(SIOCGIWGENIE, do_wireless_ioctl) | ||
2784 | HANDLE_IOCTL(SIOCSIWENCODEEXT, do_wireless_ioctl) | ||
2785 | HANDLE_IOCTL(SIOCGIWENCODEEXT, do_wireless_ioctl) | ||
2786 | HANDLE_IOCTL(SIOCSIWPMKSA, do_wireless_ioctl) | ||
2787 | HANDLE_IOCTL(SIOCSIFBR, old_bridge_ioctl) | 2677 | HANDLE_IOCTL(SIOCSIFBR, old_bridge_ioctl) |
2788 | HANDLE_IOCTL(SIOCGIFBR, old_bridge_ioctl) | 2678 | HANDLE_IOCTL(SIOCGIFBR, old_bridge_ioctl) |
2789 | /* Not implemented in the native kernel */ | 2679 | /* Not implemented in the native kernel */ |
diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c index 83f357b30d71..b224a28e0c15 100644 --- a/fs/proc/proc_net.c +++ b/fs/proc/proc_net.c | |||
@@ -51,6 +51,30 @@ int seq_open_net(struct inode *ino, struct file *f, | |||
51 | } | 51 | } |
52 | EXPORT_SYMBOL_GPL(seq_open_net); | 52 | EXPORT_SYMBOL_GPL(seq_open_net); |
53 | 53 | ||
54 | int single_open_net(struct inode *inode, struct file *file, | ||
55 | int (*show)(struct seq_file *, void *)) | ||
56 | { | ||
57 | int err; | ||
58 | struct net *net; | ||
59 | |||
60 | err = -ENXIO; | ||
61 | net = get_proc_net(inode); | ||
62 | if (net == NULL) | ||
63 | goto err_net; | ||
64 | |||
65 | err = single_open(file, show, net); | ||
66 | if (err < 0) | ||
67 | goto err_open; | ||
68 | |||
69 | return 0; | ||
70 | |||
71 | err_open: | ||
72 | put_net(net); | ||
73 | err_net: | ||
74 | return err; | ||
75 | } | ||
76 | EXPORT_SYMBOL_GPL(single_open_net); | ||
77 | |||
54 | int seq_release_net(struct inode *ino, struct file *f) | 78 | int seq_release_net(struct inode *ino, struct file *f) |
55 | { | 79 | { |
56 | struct seq_file *seq; | 80 | struct seq_file *seq; |
@@ -63,6 +87,14 @@ int seq_release_net(struct inode *ino, struct file *f) | |||
63 | } | 87 | } |
64 | EXPORT_SYMBOL_GPL(seq_release_net); | 88 | EXPORT_SYMBOL_GPL(seq_release_net); |
65 | 89 | ||
90 | int single_release_net(struct inode *ino, struct file *f) | ||
91 | { | ||
92 | struct seq_file *seq = f->private_data; | ||
93 | put_net(seq->private); | ||
94 | return single_release(ino, f); | ||
95 | } | ||
96 | EXPORT_SYMBOL_GPL(single_release_net); | ||
97 | |||
66 | static struct net *get_proc_task_net(struct inode *dir) | 98 | static struct net *get_proc_task_net(struct inode *dir) |
67 | { | 99 | { |
68 | struct task_struct *task; | 100 | struct task_struct *task; |