.. | .. |
---|
49 | 49 | return 0; |
---|
50 | 50 | } |
---|
51 | 51 | |
---|
52 | | -static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) |
---|
| 52 | +static int do_bnep_sock_ioctl(struct socket *sock, unsigned int cmd, void __user *argp) |
---|
53 | 53 | { |
---|
54 | 54 | struct bnep_connlist_req cl; |
---|
55 | 55 | struct bnep_connadd_req ca; |
---|
56 | 56 | struct bnep_conndel_req cd; |
---|
57 | 57 | struct bnep_conninfo ci; |
---|
58 | 58 | struct socket *nsock; |
---|
59 | | - void __user *argp = (void __user *)arg; |
---|
60 | 59 | __u32 supp_feat = BIT(BNEP_SETUP_RESPONSE); |
---|
61 | 60 | int err; |
---|
62 | 61 | |
---|
63 | | - BT_DBG("cmd %x arg %lx", cmd, arg); |
---|
| 62 | + BT_DBG("cmd %x arg %p", cmd, argp); |
---|
64 | 63 | |
---|
65 | 64 | switch (cmd) { |
---|
66 | 65 | case BNEPCONNADD: |
---|
.. | .. |
---|
134 | 133 | return 0; |
---|
135 | 134 | } |
---|
136 | 135 | |
---|
| 136 | +static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) |
---|
| 137 | +{ |
---|
| 138 | + return do_bnep_sock_ioctl(sock, cmd, (void __user *)arg); |
---|
| 139 | +} |
---|
| 140 | + |
---|
137 | 141 | #ifdef CONFIG_COMPAT |
---|
138 | 142 | static int bnep_sock_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) |
---|
139 | 143 | { |
---|
| 144 | + void __user *argp = compat_ptr(arg); |
---|
140 | 145 | if (cmd == BNEPGETCONNLIST) { |
---|
141 | 146 | struct bnep_connlist_req cl; |
---|
| 147 | + unsigned __user *p = argp; |
---|
142 | 148 | u32 uci; |
---|
143 | 149 | int err; |
---|
144 | 150 | |
---|
145 | | - if (get_user(cl.cnum, (u32 __user *) arg) || |
---|
146 | | - get_user(uci, (u32 __user *) (arg + 4))) |
---|
| 151 | + if (get_user(cl.cnum, p) || get_user(uci, p + 1)) |
---|
147 | 152 | return -EFAULT; |
---|
148 | 153 | |
---|
149 | 154 | cl.ci = compat_ptr(uci); |
---|
.. | .. |
---|
153 | 158 | |
---|
154 | 159 | err = bnep_get_connlist(&cl); |
---|
155 | 160 | |
---|
156 | | - if (!err && put_user(cl.cnum, (u32 __user *) arg)) |
---|
| 161 | + if (!err && put_user(cl.cnum, p)) |
---|
157 | 162 | err = -EFAULT; |
---|
158 | 163 | |
---|
159 | 164 | return err; |
---|
160 | 165 | } |
---|
161 | 166 | |
---|
162 | | - return bnep_sock_ioctl(sock, cmd, arg); |
---|
| 167 | + return do_bnep_sock_ioctl(sock, cmd, argp); |
---|
163 | 168 | } |
---|
164 | 169 | #endif |
---|
165 | 170 | |
---|
.. | .. |
---|
177 | 182 | .recvmsg = sock_no_recvmsg, |
---|
178 | 183 | .listen = sock_no_listen, |
---|
179 | 184 | .shutdown = sock_no_shutdown, |
---|
180 | | - .setsockopt = sock_no_setsockopt, |
---|
181 | | - .getsockopt = sock_no_getsockopt, |
---|
182 | 185 | .connect = sock_no_connect, |
---|
183 | 186 | .socketpair = sock_no_socketpair, |
---|
184 | 187 | .accept = sock_no_accept, |
---|