diff options
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/iovec.c | 50 | ||||
-rw-r--r-- | net/core/sock.c | 12 |
2 files changed, 0 insertions, 62 deletions
diff --git a/net/core/iovec.c b/net/core/iovec.c index 7e7aeb01de45..de178e462682 100644 --- a/net/core/iovec.c +++ b/net/core/iovec.c | |||
@@ -75,31 +75,6 @@ int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr_storage *a | |||
75 | 75 | ||
76 | /* | 76 | /* |
77 | * Copy kernel to iovec. Returns -EFAULT on error. | 77 | * Copy kernel to iovec. Returns -EFAULT on error. |
78 | * | ||
79 | * Note: this modifies the original iovec. | ||
80 | */ | ||
81 | |||
82 | int memcpy_toiovec(struct iovec *iov, unsigned char *kdata, int len) | ||
83 | { | ||
84 | while (len > 0) { | ||
85 | if (iov->iov_len) { | ||
86 | int copy = min_t(unsigned int, iov->iov_len, len); | ||
87 | if (copy_to_user(iov->iov_base, kdata, copy)) | ||
88 | return -EFAULT; | ||
89 | kdata += copy; | ||
90 | len -= copy; | ||
91 | iov->iov_len -= copy; | ||
92 | iov->iov_base += copy; | ||
93 | } | ||
94 | iov++; | ||
95 | } | ||
96 | |||
97 | return 0; | ||
98 | } | ||
99 | EXPORT_SYMBOL(memcpy_toiovec); | ||
100 | |||
101 | /* | ||
102 | * Copy kernel to iovec. Returns -EFAULT on error. | ||
103 | */ | 78 | */ |
104 | 79 | ||
105 | int memcpy_toiovecend(const struct iovec *iov, unsigned char *kdata, | 80 | int memcpy_toiovecend(const struct iovec *iov, unsigned char *kdata, |
@@ -125,31 +100,6 @@ int memcpy_toiovecend(const struct iovec *iov, unsigned char *kdata, | |||
125 | EXPORT_SYMBOL(memcpy_toiovecend); | 100 | EXPORT_SYMBOL(memcpy_toiovecend); |
126 | 101 | ||
127 | /* | 102 | /* |
128 | * Copy iovec to kernel. Returns -EFAULT on error. | ||
129 | * | ||
130 | * Note: this modifies the original iovec. | ||
131 | */ | ||
132 | |||
133 | int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len) | ||
134 | { | ||
135 | while (len > 0) { | ||
136 | if (iov->iov_len) { | ||
137 | int copy = min_t(unsigned int, len, iov->iov_len); | ||
138 | if (copy_from_user(kdata, iov->iov_base, copy)) | ||
139 | return -EFAULT; | ||
140 | len -= copy; | ||
141 | kdata += copy; | ||
142 | iov->iov_base += copy; | ||
143 | iov->iov_len -= copy; | ||
144 | } | ||
145 | iov++; | ||
146 | } | ||
147 | |||
148 | return 0; | ||
149 | } | ||
150 | EXPORT_SYMBOL(memcpy_fromiovec); | ||
151 | |||
152 | /* | ||
153 | * Copy iovec from kernel. Returns -EFAULT on error. | 103 | * Copy iovec from kernel. Returns -EFAULT on error. |
154 | */ | 104 | */ |
155 | 105 | ||
diff --git a/net/core/sock.c b/net/core/sock.c index d4f4cea726e7..6ba327da79e1 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -1217,18 +1217,6 @@ static void sock_copy(struct sock *nsk, const struct sock *osk) | |||
1217 | #endif | 1217 | #endif |
1218 | } | 1218 | } |
1219 | 1219 | ||
1220 | /* | ||
1221 | * caches using SLAB_DESTROY_BY_RCU should let .next pointer from nulls nodes | ||
1222 | * un-modified. Special care is taken when initializing object to zero. | ||
1223 | */ | ||
1224 | static inline void sk_prot_clear_nulls(struct sock *sk, int size) | ||
1225 | { | ||
1226 | if (offsetof(struct sock, sk_node.next) != 0) | ||
1227 | memset(sk, 0, offsetof(struct sock, sk_node.next)); | ||
1228 | memset(&sk->sk_node.pprev, 0, | ||
1229 | size - offsetof(struct sock, sk_node.pprev)); | ||
1230 | } | ||
1231 | |||
1232 | void sk_prot_clear_portaddr_nulls(struct sock *sk, int size) | 1220 | void sk_prot_clear_portaddr_nulls(struct sock *sk, int size) |
1233 | { | 1221 | { |
1234 | unsigned long nulls1, nulls2; | 1222 | unsigned long nulls1, nulls2; |