aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/console_struct.h5
-rw-r--r--include/linux/kernel.h12
-rw-r--r--include/linux/sched.h1
-rw-r--r--include/linux/slub_def.h25
-rw-r--r--include/net/cipso_ipv4.h20
-rw-r--r--include/net/netlabel.h14
6 files changed, 40 insertions, 37 deletions
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
index a461f76fb004..dc77fed7b285 100644
--- a/include/linux/console_struct.h
+++ b/include/linux/console_struct.h
@@ -9,6 +9,9 @@
9 * to achieve effects such as fast scrolling by changing the origin. 9 * to achieve effects such as fast scrolling by changing the origin.
10 */ 10 */
11 11
12#ifndef _LINUX_CONSOLE_STRUCT_H
13#define _LINUX_CONSOLE_STRUCT_H
14
12#include <linux/wait.h> 15#include <linux/wait.h>
13#include <linux/vt.h> 16#include <linux/vt.h>
14#include <linux/workqueue.h> 17#include <linux/workqueue.h>
@@ -130,3 +133,5 @@ extern void vc_SAK(struct work_struct *work);
130#define CUR_DEFAULT CUR_UNDERLINE 133#define CUR_DEFAULT CUR_UNDERLINE
131 134
132#define CON_IS_VISIBLE(conp) (*conp->vc_display_fg == conp) 135#define CON_IS_VISIBLE(conp) (*conp->vc_display_fg == conp)
136
137#endif /* _LINUX_CONSOLE_STRUCT_H */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 45353d757cd0..7a4852505914 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -218,10 +218,14 @@ enum {
218 DUMP_PREFIX_ADDRESS, 218 DUMP_PREFIX_ADDRESS,
219 DUMP_PREFIX_OFFSET 219 DUMP_PREFIX_OFFSET
220}; 220};
221extern void hex_dump_to_buffer(const void *buf, size_t len, char *linebuf, 221extern void hex_dump_to_buffer(const void *buf, size_t len,
222 size_t linebuflen); 222 int rowsize, int groupsize,
223extern void print_hex_dump(const char *level, int prefix_type, 223 char *linebuf, size_t linebuflen, bool ascii);
224 void *buf, size_t len); 224extern void print_hex_dump(const char *level, const char *prefix_str,
225 int prefix_type, int rowsize, int groupsize,
226 void *buf, size_t len, bool ascii);
227extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
228 void *buf, size_t len);
225#define hex_asc(x) "0123456789abcdef"[x] 229#define hex_asc(x) "0123456789abcdef"[x]
226 230
227#ifdef DEBUG 231#ifdef DEBUG
diff --git a/include/linux/sched.h b/include/linux/sched.h
index d58e74b98367..693f0e6c54d4 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1162,6 +1162,7 @@ static inline void put_task_struct(struct task_struct *t)
1162 /* Not implemented yet, only for 486*/ 1162 /* Not implemented yet, only for 486*/
1163#define PF_STARTING 0x00000002 /* being created */ 1163#define PF_STARTING 0x00000002 /* being created */
1164#define PF_EXITING 0x00000004 /* getting shut down */ 1164#define PF_EXITING 0x00000004 /* getting shut down */
1165#define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */
1165#define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ 1166#define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */
1166#define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ 1167#define PF_SUPERPRIV 0x00000100 /* used super-user privileges */
1167#define PF_DUMPCORE 0x00000200 /* dumped core */ 1168#define PF_DUMPCORE 0x00000200 /* dumped core */
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 0764c829d967..a0ad37463d62 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -70,11 +70,8 @@ extern struct kmem_cache kmalloc_caches[KMALLOC_SHIFT_HIGH + 1];
70 */ 70 */
71static inline int kmalloc_index(size_t size) 71static inline int kmalloc_index(size_t size)
72{ 72{
73 /* 73 if (!size)
74 * We should return 0 if size == 0 but we use the smallest object 74 return 0;
75 * here for SLAB legacy reasons.
76 */
77 WARN_ON_ONCE(size == 0);
78 75
79 if (size > KMALLOC_MAX_SIZE) 76 if (size > KMALLOC_MAX_SIZE)
80 return -1; 77 return -1;
@@ -153,13 +150,25 @@ static inline struct kmem_cache *kmalloc_slab(size_t size)
153#define SLUB_DMA 0 150#define SLUB_DMA 0
154#endif 151#endif
155 152
153
154/*
155 * ZERO_SIZE_PTR will be returned for zero sized kmalloc requests.
156 *
157 * Dereferencing ZERO_SIZE_PTR will lead to a distinct access fault.
158 *
159 * ZERO_SIZE_PTR can be passed to kfree though in the same way that NULL can.
160 * Both make kfree a no-op.
161 */
162#define ZERO_SIZE_PTR ((void *)16)
163
164
156static inline void *kmalloc(size_t size, gfp_t flags) 165static inline void *kmalloc(size_t size, gfp_t flags)
157{ 166{
158 if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { 167 if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) {
159 struct kmem_cache *s = kmalloc_slab(size); 168 struct kmem_cache *s = kmalloc_slab(size);
160 169
161 if (!s) 170 if (!s)
162 return NULL; 171 return ZERO_SIZE_PTR;
163 172
164 return kmem_cache_alloc(s, flags); 173 return kmem_cache_alloc(s, flags);
165 } else 174 } else
@@ -172,7 +181,7 @@ static inline void *kzalloc(size_t size, gfp_t flags)
172 struct kmem_cache *s = kmalloc_slab(size); 181 struct kmem_cache *s = kmalloc_slab(size);
173 182
174 if (!s) 183 if (!s)
175 return NULL; 184 return ZERO_SIZE_PTR;
176 185
177 return kmem_cache_zalloc(s, flags); 186 return kmem_cache_zalloc(s, flags);
178 } else 187 } else
@@ -188,7 +197,7 @@ static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
188 struct kmem_cache *s = kmalloc_slab(size); 197 struct kmem_cache *s = kmalloc_slab(size);
189 198
190 if (!s) 199 if (!s)
191 return NULL; 200 return ZERO_SIZE_PTR;
192 201
193 return kmem_cache_alloc_node(s, flags, node); 202 return kmem_cache_alloc_node(s, flags, node);
194 } else 203 } else
diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h
index 4f90f5554fac..a6bb94530cfd 100644
--- a/include/net/cipso_ipv4.h
+++ b/include/net/cipso_ipv4.h
@@ -203,12 +203,10 @@ static inline int cipso_v4_cache_add(const struct sk_buff *skb,
203 203
204#ifdef CONFIG_NETLABEL 204#ifdef CONFIG_NETLABEL
205void cipso_v4_error(struct sk_buff *skb, int error, u32 gateway); 205void cipso_v4_error(struct sk_buff *skb, int error, u32 gateway);
206int cipso_v4_socket_setattr(const struct socket *sock, 206int cipso_v4_sock_setattr(struct sock *sk,
207 const struct cipso_v4_doi *doi_def, 207 const struct cipso_v4_doi *doi_def,
208 const struct netlbl_lsm_secattr *secattr); 208 const struct netlbl_lsm_secattr *secattr);
209int cipso_v4_sock_getattr(struct sock *sk, struct netlbl_lsm_secattr *secattr); 209int cipso_v4_sock_getattr(struct sock *sk, struct netlbl_lsm_secattr *secattr);
210int cipso_v4_socket_getattr(const struct socket *sock,
211 struct netlbl_lsm_secattr *secattr);
212int cipso_v4_skbuff_getattr(const struct sk_buff *skb, 210int cipso_v4_skbuff_getattr(const struct sk_buff *skb,
213 struct netlbl_lsm_secattr *secattr); 211 struct netlbl_lsm_secattr *secattr);
214int cipso_v4_validate(unsigned char **option); 212int cipso_v4_validate(unsigned char **option);
@@ -220,9 +218,9 @@ static inline void cipso_v4_error(struct sk_buff *skb,
220 return; 218 return;
221} 219}
222 220
223static inline int cipso_v4_socket_setattr(const struct socket *sock, 221static inline int cipso_v4_sock_setattr(struct sock *sk,
224 const struct cipso_v4_doi *doi_def, 222 const struct cipso_v4_doi *doi_def,
225 const struct netlbl_lsm_secattr *secattr) 223 const struct netlbl_lsm_secattr *secattr)
226{ 224{
227 return -ENOSYS; 225 return -ENOSYS;
228} 226}
@@ -233,12 +231,6 @@ static inline int cipso_v4_sock_getattr(struct sock *sk,
233 return -ENOSYS; 231 return -ENOSYS;
234} 232}
235 233
236static inline int cipso_v4_socket_getattr(const struct socket *sock,
237 struct netlbl_lsm_secattr *secattr)
238{
239 return -ENOSYS;
240}
241
242static inline int cipso_v4_skbuff_getattr(const struct sk_buff *skb, 234static inline int cipso_v4_skbuff_getattr(const struct sk_buff *skb,
243 struct netlbl_lsm_secattr *secattr) 235 struct netlbl_lsm_secattr *secattr)
244{ 236{
diff --git a/include/net/netlabel.h b/include/net/netlabel.h
index 83da7e1f0d3d..9b7d6f2ac9a3 100644
--- a/include/net/netlabel.h
+++ b/include/net/netlabel.h
@@ -332,17 +332,15 @@ static inline int netlbl_secattr_catmap_setrng(
332 */ 332 */
333 333
334#ifdef CONFIG_NETLABEL 334#ifdef CONFIG_NETLABEL
335int netlbl_socket_setattr(const struct socket *sock, 335int netlbl_sock_setattr(struct sock *sk,
336 const struct netlbl_lsm_secattr *secattr); 336 const struct netlbl_lsm_secattr *secattr);
337int netlbl_sock_getattr(struct sock *sk, 337int netlbl_sock_getattr(struct sock *sk,
338 struct netlbl_lsm_secattr *secattr); 338 struct netlbl_lsm_secattr *secattr);
339int netlbl_socket_getattr(const struct socket *sock,
340 struct netlbl_lsm_secattr *secattr);
341int netlbl_skbuff_getattr(const struct sk_buff *skb, 339int netlbl_skbuff_getattr(const struct sk_buff *skb,
342 struct netlbl_lsm_secattr *secattr); 340 struct netlbl_lsm_secattr *secattr);
343void netlbl_skbuff_err(struct sk_buff *skb, int error); 341void netlbl_skbuff_err(struct sk_buff *skb, int error);
344#else 342#else
345static inline int netlbl_socket_setattr(const struct socket *sock, 343static inline int netlbl_sock_setattr(struct sock *sk,
346 const struct netlbl_lsm_secattr *secattr) 344 const struct netlbl_lsm_secattr *secattr)
347{ 345{
348 return -ENOSYS; 346 return -ENOSYS;
@@ -354,12 +352,6 @@ static inline int netlbl_sock_getattr(struct sock *sk,
354 return -ENOSYS; 352 return -ENOSYS;
355} 353}
356 354
357static inline int netlbl_socket_getattr(const struct socket *sock,
358 struct netlbl_lsm_secattr *secattr)
359{
360 return -ENOSYS;
361}
362
363static inline int netlbl_skbuff_getattr(const struct sk_buff *skb, 355static inline int netlbl_skbuff_getattr(const struct sk_buff *skb,
364 struct netlbl_lsm_secattr *secattr) 356 struct netlbl_lsm_secattr *secattr)
365{ 357{