| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * |
|---|
| 3 | 4 | * Author Karsten Keil <kkeil@novell.com> |
|---|
| 4 | 5 | * |
|---|
| 5 | 6 | * Copyright 2008 by Karsten Keil <kkeil@novell.com> |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 8 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 9 | | - * published by the Free Software Foundation. |
|---|
| 10 | | - * |
|---|
| 11 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 12 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 14 | | - * GNU General Public License for more details. |
|---|
| 15 | | - * |
|---|
| 16 | 7 | */ |
|---|
| 17 | 8 | |
|---|
| 18 | 9 | #include <linux/mISDNif.h> |
|---|
| .. | .. |
|---|
| 103 | 94 | static inline void |
|---|
| 104 | 95 | mISDN_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_buff *skb) |
|---|
| 105 | 96 | { |
|---|
| 106 | | - struct timeval tv; |
|---|
| 97 | + struct __kernel_old_timeval tv; |
|---|
| 107 | 98 | |
|---|
| 108 | 99 | if (_pms(sk)->cmask & MISDN_TIME_STAMP) { |
|---|
| 109 | 100 | skb_get_timestamp(skb, &tv); |
|---|
| .. | .. |
|---|
| 236 | 227 | } |
|---|
| 237 | 228 | |
|---|
| 238 | 229 | done: |
|---|
| 239 | | - if (skb) |
|---|
| 240 | | - kfree_skb(skb); |
|---|
| 230 | + kfree_skb(skb); |
|---|
| 241 | 231 | release_sock(sk); |
|---|
| 242 | 232 | return err; |
|---|
| 243 | 233 | } |
|---|
| .. | .. |
|---|
| 411 | 401 | } |
|---|
| 412 | 402 | |
|---|
| 413 | 403 | static int data_sock_setsockopt(struct socket *sock, int level, int optname, |
|---|
| 414 | | - char __user *optval, unsigned int len) |
|---|
| 404 | + sockptr_t optval, unsigned int len) |
|---|
| 415 | 405 | { |
|---|
| 416 | 406 | struct sock *sk = sock->sk; |
|---|
| 417 | 407 | int err = 0, opt = 0; |
|---|
| 418 | 408 | |
|---|
| 419 | 409 | if (*debug & DEBUG_SOCKET) |
|---|
| 420 | | - printk(KERN_DEBUG "%s(%p, %d, %x, %p, %d)\n", __func__, sock, |
|---|
| 421 | | - level, optname, optval, len); |
|---|
| 410 | + printk(KERN_DEBUG "%s(%p, %d, %x, optval, %d)\n", __func__, sock, |
|---|
| 411 | + level, optname, len); |
|---|
| 422 | 412 | |
|---|
| 423 | 413 | lock_sock(sk); |
|---|
| 424 | 414 | |
|---|
| 425 | 415 | switch (optname) { |
|---|
| 426 | 416 | case MISDN_TIME_STAMP: |
|---|
| 427 | | - if (get_user(opt, (int __user *)optval)) { |
|---|
| 417 | + if (copy_from_sockptr(&opt, optval, sizeof(int))) { |
|---|
| 428 | 418 | err = -EFAULT; |
|---|
| 429 | 419 | break; |
|---|
| 430 | 420 | } |
|---|
| .. | .. |
|---|
| 748 | 738 | .recvmsg = sock_no_recvmsg, |
|---|
| 749 | 739 | .listen = sock_no_listen, |
|---|
| 750 | 740 | .shutdown = sock_no_shutdown, |
|---|
| 751 | | - .setsockopt = sock_no_setsockopt, |
|---|
| 752 | | - .getsockopt = sock_no_getsockopt, |
|---|
| 753 | 741 | .connect = sock_no_connect, |
|---|
| 754 | 742 | .socketpair = sock_no_socketpair, |
|---|
| 755 | 743 | .accept = sock_no_accept, |
|---|